SceneWindow2D.loadLevel Crashes
by Seth Willits · in Torque Game Builder · 05/02/2008 (7:53 pm) · 2 replies
I have a new project set up, and I copied over the genericButton behavior from the playground project, and I have the button calling a function in which I do... sceneWindow2D.loadLevel("game/data/levels/level.t2d") and it crashes TGB. Seems kinda... wrong. If I load level.t2d as the default level with startGame() then it works just fine there, but I'm trying to switch to it from my title screen and it goes kablamo.
Any thoughts?
Any thoughts?
About the author
http://www.sethwillits.com/
#2
05/03/2008 (7:53 am)
I did finally figure out that you had to use schedule in the button's callback to eventually call loadLevel. The tutorial glosses over what the schedule is for, so that wasn't exactly clear. At any rate, crashing isn't ideal; a warning in the console would have been a whole lot more useful.
Associate Mike Lilligreen
Retired T2Der
For a solution see the last section of the asteroids tutorial:
tdn.garagegames.com/wiki/TGB/Tutorials/Asteroids/Section9