Inside the OnObjectTouch
method of the engine
class, we want to start a new game when the PLAY or RESET button are hit. If the EXIT button was hit, we want to end the game. And if an atom element got hit, we want to start a chain reaction.
1. Insert a
Select
statement with a call to the object'sGetTag
method.Class engine Extends ftEngine Method OnObjectTouch:Int(obj:ftObject, touchId:Int) Select obj.GetTag()
2. Add a
Case
statement with the game'sgrpAtom
constant. This identifies an atom element.Case g.grpAtom
3. Now, check if this object already has a transition going on.
If obj.GetTransitionCount() = 0 Then
4. Create a new rotation transition by relative
90
degrees to its current angle and with a transition ID of1
. This ID needs to be set so that theOnObjectTransition
method is called, once the transition is completed.obj.CreateTransRot(90,200, True,1)
5. Now, raise the game's
collCount
field by1
and set the objects ID with a negative...