Basic Programming Question: endLevel() (solved)
by rennie moffat · in iTorque 2D · 04/12/2011 (9:16 am) · 8 replies
Hi there I have a few basic questions regarding basic programming.
If I load a new level...
with out using endLevel(), does the loadLevel delete all objects from the previous level? And what about the scenegraph? I know that endLevel() deletes the scenegraph too, so I assume one must create a new scenegraph? Also, do many people use endLevel(). I am just wondering about, if it maximizes performance by deleting unused things.
Thanks
If I load a new level...
sceneWindow2D.loadLevel("game/data/levels/doLittle.t2d");with out using endLevel(), does the loadLevel delete all objects from the previous level? And what about the scenegraph? I know that endLevel() deletes the scenegraph too, so I assume one must create a new scenegraph? Also, do many people use endLevel(). I am just wondering about, if it maximizes performance by deleting unused things.
Thanks
About the author
My thanks to Garage Games and the Garage Games Community combined with owned determination I got one game up, Temple Racer and I am looking to build more interesting, fun games for the mass market of the iOS app store.
#2
04/13/2011 (4:49 am)
So say I have an objectX using an enableUpdateCallback(true) on levelX, the I simply, loadLevel(levelY) without using endLevel(), does the computer still compile objectX and it's onUpdate callback?
#3
I'd find this out for you but can't seem to find loadLevel anywhere in the source code =S
04/13/2011 (7:25 am)
Hmmm,I'd find this out for you but can't seem to find loadLevel anywhere in the source code =S
#4
I was just busy doing other stuff when this question popped in my head.
Thanks for your help!
Roll eyes.
:)))((
No worries tho I am on it.
Cheers.
04/13/2011 (8:59 am)
I know I know. I was just busy doing other stuff when this question popped in my head.
Thanks for your help!
Roll eyes.
:)))((
No worries tho I am on it.
Cheers.
#5
04/13/2011 (9:58 am)
Always call endlevel() when a level is no longer needed, you will run into alot of problems if you don't.
#6
Thanks. Sorry for the easily answerable question via test, just busy. And asking.
Thanks.
04/13/2011 (9:59 am)
Even if you can go back to that level? If so, I assume this means you also always, create a new scenegraph on LevelLoad?Thanks. Sorry for the easily answerable question via test, just busy. And asking.
Thanks.
#7
04/13/2011 (3:52 pm)
Even if you go back to the level, you still need to end it first.
Torque 3D Owner Marc Dreamora Schaerer
Gayasoft
This control is exposed to you explicitely so you can remove what is not needed on the next level anymore and keep what is going to be reused.