While trying to make the player's gaming experience an enjoyable one, it's important that the information displayed is relevant to the game and placed strategically so it doesn't interfere with the main gaming area.
Create a new local function called
hud()
.local hud = function()
Display the text for the eggs that are caught during gameplay.
eggText = display.newText( "Caught: " .. eggCount, 0, 0, "Arial", 45 ) eggText:setTextColor( 255, 255, 255, 255 ) eggText.xScale = 0.5; eggText.yScale = 0.5 eggText.x = (480 - (eggText.contentWidth * 0.5)) - 15 eggText.y = 305 gameGroup:insert( eggText )
Add in the text to track the lives.
livesText = display.newText( "Lives: " .. gameLives, 0, 0, "Arial", 45 ) livesText:setTextColor( 255, 255, 255, 255 ) --> white livesText.xScale = 0.5; livesText.yScale = 0.5 --> for clear retina display text livesText.x = (480 - (livesText...