Game Development Community

Loading the next Level

by Andrew Nare · in Torque Game Builder · 02/07/2009 (1:53 pm) · 5 replies

Hi, me again.

I'm stuck once again in building my game. I can't figure out how to load the next level after the player collides with an object. Nothing I do seems to work and there doesn't appear to be any resources for this type of thing.

Any help would be appreciated, thanks.

#1
02/07/2009 (3:40 pm)
The best way is to schedule the loadLevel function after the event:

sceneWindow2d.schedule(100, "loadLevel", "game/data/levels/myNewLevel.t2d");

The reason why you have to use schedule is to avoid crashing when the scenegraph destroys an object that is still in use.
#2
02/07/2009 (3:54 pm)
Thank for the help, but I have another question, where would I schedule the event?

EDIT: Finally figured it out. Modified a behavior to do that. Thanks again for the help.
#3
02/08/2009 (8:23 am)
Okay, I have another problem. No matter what I try I cannot get background music to play. Nothing seems to work.
#4
02/08/2009 (9:09 am)
Why don't you explain what you tried already to get music playing?
#5
02/08/2009 (9:19 am)
I've only really tried this topic (www.garagegames.com/community/forums/viewthread/77530) Everytime the level loads the console says Unable to locate audio profile ' '. I probably missed something really simple.