Right now, we need to set the offscreen position for the panda and have it transition to its starting launch location, so the user can interact with it.
After adding the variables, create a new local function called
startNewRound()
and add anif
statement to initiate thepanda
object into the scene:local startNewRound = function() if panda then
Add a new local function called
activateRound()
withinstartNewRound()
. Set the starting position of thepanda
display object on screen and addground:toFront()
, so that the ground appears in front of the panda character:local activateRound = function() waitingForNewRound = false if restartTimer then timer.cancel( restartTimer ) end ground:toFront() panda.x = 240 panda.y = 300 panda.rotation = 0 panda.isVisible = true
Create another local function called
pandaLoaded()
. SetgameIsActive
totrue
and set thepanda
object's air and hit properties tofalse
. Addpanda:toFront...