We need to create a separate function for powerShot
, so that it can be called when the panda is set for launch:
powerShot
object through a new local function called createPowerShot()
. Insert it in the gameGroup
group:local createPowerShot = function() powerShot = display.newImage( "glow.png" ) powerShot.xScale = 1.0; powerShot.yScale = 1.0 powerShot.isVisible = false gameGroup:insert( powerShot ) end