Beta 2 Level Editor and Schedule Functions
by Mike Lilligreen · in Torque Game Builder · 03/30/2006 (2:22 pm) · 0 replies
Perhaps not really a bug, but at least a question of how the level editor should handle scripts with unending loops via schedule.
Add a function similar to CreateEnemy() from the basic spacescroller tutorial which at the bottom of the function has a
schedule(2000, 0, "createEnemy");
Call CreateEnemy from the startGame function, right after loadLevel. In the level editor, choose Run Game, and afterwards hit the stop button to bring you back to the editor. The schedule function keeps getting called, which if it is creating sprites will keep plastering them all over the scene view.
Obviously like the real spacescroller you stick the schedule inside an if statement which checks stuff like player dead status or if the scene is paused so you can stop it. But should hitting the stop button in the level editor also have a similar effect? Or should the only thing the stop button do is call toggleLevelEditor?
Add a function similar to CreateEnemy() from the basic spacescroller tutorial which at the bottom of the function has a
schedule(2000, 0, "createEnemy");
Call CreateEnemy from the startGame function, right after loadLevel. In the level editor, choose Run Game, and afterwards hit the stop button to bring you back to the editor. The schedule function keeps getting called, which if it is creating sprites will keep plastering them all over the scene view.
Obviously like the real spacescroller you stick the schedule inside an if statement which checks stuff like player dead status or if the scene is paused so you can stop it. But should hitting the stop button in the level editor also have a similar effect? Or should the only thing the stop button do is call toggleLevelEditor?
About the author