public void LifeLost(PlayerLife myLife)
 {
     if (IsColliding)
     {
         RemoveLife();
         myLife.Quantity = life;
     }
 }
 public void LifeGained(PlayerLife myLife)
 {
     Game1.songPlayer.Play(extraLifeEffect);
     if (life < 6)
     {
         life++;
         myLife.Quantity = life;
     }
 }
示例#3
0
 public Game1()
 {
     graphics = new GraphicsDeviceManager(this);
     graphics.PreferredBackBufferHeight = Settings.screenHeigth;
     graphics.PreferredBackBufferWidth = Settings.screenWidth;
     Content.RootDirectory = "Content";
     backgroundTitleScreen = new BackgroundSprite("Sprites/TitleScreen");
     backgroundFase1 = new BackgroundSprite("Sprites/Background_Fase1");
     pirateSprite = new PlayerSprite();
     pirateLife = new PlayerLife();
     pirateBombs = new Bombs();
     collisionController = new CollisionControl();
     treasureCoins = new Coins();
     treasureChests = new TreasureChests();
     extraLife = new ExtraLife();
     songPlayer = new SongPlayer();
 }
 public void ResetPlayer(PlayerLife myLife)
 {
     Position = new Vector2(START_POSITION_X, START_POSITION_Y);
     life = 3;
     myLife.Quantity = life;
 }