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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.40.189