Let's get started with introducing the variables we'll be using to create our game. There will be a combination of display objects, integers to keep count, and pre-loading the main sound effects during gameplay.
Hide the status bar and add in
display.newGroup()
calledgameGroup
.display.setStatusBar( display.HiddenStatusBar ) local gameGroup = display.newGroup()
Include the external modules in the game.
local sprite = require "sprite" local physics = require "physics" local ui = require "ui"
Add in the display objects.
local background local ground local charObject local friedEgg local scoreText local eggText local livesText local shade local gameOverScreen
Add in the variables.
local gameIsActive = false local startDrop local gameLives = 3 local gameScore = 0 local eggCount = 0 local mRand = math.random
Create the egg boundaries and density.
local eggDensity = 1.0 local...