Reset() public method

Resets the player to life.
public Reset ( Vector2 position ) : void
position Vector2 The position to come to life at.
return void
Ejemplo n.º 1
0
        public void StartNewLife(Player player, bool isKilled)
        {
            float xpos = camera.GetSpawnPoint(game.ScreenManager.GraphicsDevice.Viewport);

            if (isKilled)
            {
                SpawnCorpse(player.Position, player.Flip, PlatformerGame.Players.IndexOf(player));
            }
            if (xpos > 0.0f)
            {
                //player.IsRespawnable = true;
                float ypos = -0.0f;
                player.Reset(new Vector2(xpos, ypos));
            }
            //else if (xpos == -999.9f)
            //{
            //player.IsRespawnable = false;
            //    player.Reset(new Vector2(xpos, 0.0f));
            //}
        }
Ejemplo n.º 2
0
 public void StartAllStages()
 {
     score = 0;
     player.Reset(start);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Restores the player to the starting point to try the level again.
 /// </summary>
 public void StartNewLife()
 {
     Player.Reset(start);
 }
Ejemplo n.º 4
0
 public void StartNewLife(Player player, bool isKilled)
 {
     float xpos = camera.GetSpawnPoint(game.ScreenManager.GraphicsDevice.Viewport);
     if (isKilled)
     {
         SpawnCorpse(player.Position, player.Flip, PlatformerGame.Players.IndexOf(player));
     }
     if (xpos > 0.0f)
     {
         //player.IsRespawnable = true;
         float ypos = -0.0f;
         player.Reset(new Vector2(xpos, ypos));
     }
     //else if (xpos == -999.9f)
     //{
         //player.IsRespawnable = false;
     //    player.Reset(new Vector2(xpos, 0.0f));
     //}
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Restores the player to the starting point to try the level again.
 /// </summary>
 public void StartNewLife(GameTime gameTime)
 {
     Player.Reset(gameTime, start);
 }