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

6. Game #5, Balls Out! > Time for action — detailing the OnObjectTransition met...

Time for action — detailing the OnObjectTransition method

The OnObjectTransition method is called whenever a transition finishes and this transition had an ID assigned to it. So we will need to act on it:

  1. First, perform a SELECT operation on the transition ID.
    Method OnObjectTransition:Int(transId:Int, obj:ftObject)
    Select transId
    
  2. Check against the tidParticle constant. If it is, the particle needs to be removed. Call the object's Remove method to do this:
    Case g.tidParticle
    obj.Remove()
    
  3. Check against the tidGameOver constant. If it is, activate the title layer:
    Case g.tidGameOver
    g.layerTitle.SetActive(True)
    
  4. Make the Game Over text invisible and scale it back to 1.0:
    g.txtGameOver.SetVisible(False)
    g.txtGameOver.SetScale(1.0)
    

  

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