Reader small image

You're reading from  Corona SDK Mobile Game Development: Beginner's Guide

Product typeBook
Published inMar 2015
Publisher
ISBN-139781783559343
Edition1st Edition
Tools
Right arrow
Author (1)
Michelle M Fernandez
Michelle M Fernandez
Right arrow

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

What just happened?

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

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Corona SDK Mobile Game Development: Beginner's Guide
Published in: Mar 2015Publisher: ISBN-13: 9781783559343

Author (1)