Game Development Community

What is the correct way to load a level?

by AzraelK · in Torque Game Builder · 10/23/2006 (9:32 am) · 1 replies

What is the correct way to load a level, because if you do this

sceneWindow2D.schedule(2000,"loadLevel","miniplatformer/data/levels/nivel" @ $nivel @ ".t2d");

The game becomes unplayable after ten levels or so, because (aparently) you are not unloading anything from memory.

#1
10/23/2006 (3:45 pm)
LoadLevel calls endLevel before it begins loading objects from the new level file. EndLevel completely clears the old scenegraph (except for persistant objects). Could you maybe post more details on how you're loading levels? I have a feeling there's something else going on here (maybe not cancelling old schedules or trying to update deleted objects or something like that). Also, check for any suspicious warnings in the console.

-Thomas