O'Reilly logo

Monkey Game Development by Michael Hartlef

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Time for action — detailing the OnObjectTransition method

Inside this method, we will only check for the transition ID, and if positive, we will delete the object.

Check whether the transition ID is equal to g.triDelete. If yes, then call the Remove method of the object.

Method OnObjectTransition:Int(transId:Int, obj:ftObject)
If transId = g.triDelete Then obj.Remove()
Return 0
End

What just happened?

With this method, you can now use a single line, to automatically delete an object once its transition is done. We use it when a particle has faded out or reached its maximum scale factor.

Controlling the player plane—acting on object update events

To control the player plane, you need to detail the OnObjectUpdate callback method of the engine class. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required