Game Development Community

Current scene data

by Paul Bellezza · in Torque X 2D · 12/02/2007 (3:36 pm) · 1 replies

Hi -

I'm trying to write a component that will cause a new level to load when I hit an object. I'd like the component to check what the current level is so it can just go to the next one. This would save some hassle because then I won't have to write lots of different components that load one level each, I can just put a big if/then statement in one component that handles it all.

Only problem is... I don't know how to check for what the current level is. Anyone know how to do this? Thanks.

#1
12/02/2007 (5:45 pm)
I checked the sceneloader code out, and they have a dictionarylist that stored all the scenes, as well as a lastloaded, unfortunately, both are not availible as a property. Nonetheless, you can easily setup your own levelmanager and expose out the current level, last level, especially since they expose the events. The torquecombatpro has a pretty good example of it.

I am still learning the engine myself, so if there is a way to get the current scene loaded without implementing a level manager I am all ears :)