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! > The heart of the game—the engine class

The heart of the game—the engine class

All the objects can be created now—static objects such as text and also dynamic objects such as the tiles or particles. The could move now but there is no reaction to the input or collision checks, for example. That is where the engine class comes into play. To act on collisions and touch checks, and to update objects and layers, we will utilize the fantomEngine's callback methods.

Touch me—acting on touch hits

Let's start with the touch events. The touchable objects in our game are the text buttons. They have a specific tag value and that is what we can check against. Remember, the OnObjectTouch method will be called when the mouse cursor or a touch is over the object during a call of the TouchCheck statement.


  

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