Game Development Community

unload / load next level

by Matthew Taaffe · in Torque X Platformer Kit · 01/27/2010 (8:35 am) · 3 replies

Hi, im new to torque x and someone else i know does mostly the code not me, but they are away so ive been trying to do it.

Ive been using the PlatformerDemo template when you start the project and i made some nice levels but i have searched on the internet to see how i can load the next level. I have the gameover and congrats animation come up if i collect the gold egg or die so that works fine.

Here is where is loads the level:


protected override void BeginRun()
{
base.BeginRun();

// load the test level
SceneLoader.Load(@"datalevelstest_level_01.txscene");



But in the "levelCompleted" i read somewhere to unload the 1st level then load in the next but what happenes is, either it crashes when i get the gold egg and the congrats animation comes in but i cant move or it loads the same level but the camera does not move and the congrats animation stays on the screen.


public void LevelCompleted()
{
SceneLoader.Unload(@"datalevelstest_level_01.txscene");
SceneLoader.Load(@"datalevelslevel_01.txscene");

if (_gameIsOver)
return;


Where am i going wrong? Please help.

#1
01/31/2010 (3:53 am)
I started about 2 or 3 different thread posts about this very question.. no one was able to answer my question with a straight answer.. Finally sent a few emails to garagegames and still havent heard back..Evidentally there is a issue with the platformer kit having difficulty loading levels and then releasing the first level..

I was told twice that the way to fix it is to load a splash screen in between level transitions.. But I have no idea how to do that..

If you find out the answer please let me know.. Ill do the same if I ever get a step by step answer
#2
07/03/2010 (11:57 pm)
*bump* I'm having the same problem (I'm still new to TorqueX too). Did anyone find a sure-fire way to work with it?
#3
07/04/2010 (7:31 am)
Look at this thread, especially my posts.
http://www.torquepowered.com/community/forums/viewthread/85251
It's only a few threads lower...