To act on timer events, fantomEngine provides the OnObjectTimer
method in the engine
class. We need to modify it.
OnObjectTimer
method in the engine
class by adding a Select
statement on timerId
.Method OnObjectTimer:Int(timerId:Int, obj:ftObject) Select timerId
g.tmShowMenu
. Here, we deal with the automatic switch from the title screen to the menu screen.Case g.tmShowMenu
g.gmTitle
, and then activate the menu layer.If g.gameMode = g.gmTitle Then g.gameMode = g.gmMenu g.ActivateLayer(g.gameMode) Endif
g.tmObjRemove
. Here, we deal with deleting the particle objects. After that, close the Select
statement.Case g.tmObjRemove obj.Remove() End Return 0 End
The OnObjectTimer
method will take care of the title screen's switch to the menu screen and the removing of particles.