Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

5. Animating our Game > Time for action – making the power shot

Time for action – making the power shot

We need to create a separate function for the powerShot so 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 into 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

What just happened?

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


  

You are currently reading a PREVIEW of this book.

                                                                                        

Get instant access to over
$1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint