Using multiple scenegraphs with game score
by Manjit Bedi · in Torque Game Builder · 12/12/2007 (8:29 am) · 3 replies
I am working on a game that has at the moment two different game levels.
I would like to have the score digits, lives indicator and so on a separate scene graph. Can anyone provide an example of having multiple scene graphs? This way I have just one routine to update the score digits. Also, there may be the case where I would have a game level where the playfield would scroll and I would definitely need to have the score on a different scene graph then.
So I would have then:
1) scene graph for the score which persists during between different levels
2) scene graph for the main game level
3) scene graph for the bonus level
4) any more game levels later on
When I do level load between the 2 scene graphs, I would keep the score scene graph active.
Thanks for any help. I did have a search through the forums but did not see what I was looking for.
Manjit
I would like to have the score digits, lives indicator and so on a separate scene graph. Can anyone provide an example of having multiple scene graphs? This way I have just one routine to update the score digits. Also, there may be the case where I would have a game level where the playfield would scroll and I would definitely need to have the score on a different scene graph then.
So I would have then:
1) scene graph for the score which persists during between different levels
2) scene graph for the main game level
3) scene graph for the bonus level
4) any more game levels later on
When I do level load between the 2 scene graphs, I would keep the score scene graph active.
Thanks for any help. I did have a search through the forums but did not see what I was looking for.
Manjit
About the author
Been making mobile iOS apps mostly in UI Kit. Been doing a few game related projects more recently.
#2
Both will persist while the game is running. And, you can set the score scene window to visible false when you don't want it to be visible.
12/12/2007 (10:07 am)
Even easier. Go into "mainscreen.gui" and copy and paste SceneWindow2D, rename it now you have two scene windows. All of the functionality is identical:SceneWindow2D.loadLevel(... ScoreWindow2D.loadLevel(...
Both will persist while the game is running. And, you can set the score scene window to visible false when you don't want it to be visible.
Torque 3D Owner Patrick Shaw
Here's an outline for setting up two (or more) scenegraphs:
www.garagegames.com/mg/forums/result.thread.php?qt=69837