Time for action – making the power shot

We need to create a separate function for powerShot, so that it can be called when the panda is set for launch:

  1. Display the 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

The powerShot object is created through the createPowerShot() function and is called when the panda is setting up for launch.