GameOver Image
by Temasek Polytechnic (#0001) · in Torque X Platformer Kit · 05/08/2008 (7:37 pm) · 0 replies
Hi,
I have 3 levels in my game.I used the GameOver image in Platformer Starter Kit to show that the game has ended.It works for the 1st level, but it does not work for the 2nd and 3rd level.So i added a property and public method like below:
public void GameOver2()
{
if (_gameIsOver2)
return;
T2DAnimatedSprite gameOver2Image = TorqueObjectDatabase.Instance.CloneObject("GameOver2Animation");
T2DSceneCamera camera = T2DSceneGraph.Instance.Camera as T2DSceneCamera;
camera.Dismount();
gameOver2Image.Position = camera.Position;
TorqueObjectDatabase.Instance.Register(gameOver21mage);
_gameIsOver2= true;
}
public void GameOver3()
{
if (_gameIsOver3)
return;
T2DAnimatedSprite gameOver3Image = TorqueObjectDatabase.Instance.CloneObject("GameOver3Animation");
T2DSceneCamera camera = T2DSceneGraph.Instance.Camera as T2DSceneCamera;
camera.Dismount();
gameOver3Image.Position = camera.Position;
TorqueObjectDatabase.Instance.Register(gameOver3image);
_gameIsOver3= true;
}
But it does not work. How do i solve this so that it will show the GameOver image in the 2nd and 3rd level?
I have 3 levels in my game.I used the GameOver image in Platformer Starter Kit to show that the game has ended.It works for the 1st level, but it does not work for the 2nd and 3rd level.So i added a property and public method like below:
public void GameOver2()
{
if (_gameIsOver2)
return;
T2DAnimatedSprite gameOver2Image = TorqueObjectDatabase.Instance.CloneObject
T2DSceneCamera camera = T2DSceneGraph.Instance.Camera as T2DSceneCamera;
camera.Dismount();
gameOver2Image.Position = camera.Position;
TorqueObjectDatabase.Instance.Register(gameOver21mage);
_gameIsOver2= true;
}
public void GameOver3()
{
if (_gameIsOver3)
return;
T2DAnimatedSprite gameOver3Image = TorqueObjectDatabase.Instance.CloneObject
T2DSceneCamera camera = T2DSceneGraph.Instance.Camera as T2DSceneCamera;
camera.Dismount();
gameOver3Image.Position = camera.Position;
TorqueObjectDatabase.Instance.Register(gameOver3image);
_gameIsOver3= true;
}
But it does not work. How do i solve this so that it will show the GameOver image in the 2nd and 3rd level?