Example #1
0
 public MainWindow()
 {
     InitializeComponent();
     if (IntroHasRun == false)
     {
         PlayIntro();
     }
     gameover            = new Gameover(canvas, this);
     controls            = new Rectangle();
     controls.Visibility = Visibility.Hidden;
     controls.Height     = 800;
     controls.Width      = 1200;
     controls.Fill       = new ImageBrush(new BitmapImage(new Uri("controls.png", UriKind.Relative)));
     canvas.Children.Add(controls);
 }
Example #2
0
 //Checks if player is dead
 public void death(Label l, Gameover gameover, Map m)
 {
     if (HP <= 0)
     {
         int maplevel = m.mapNum + 1;
         Alive                = false;
         l.Content            = "Player Defeated";
         rectangle.Visibility = Visibility.Hidden;
         //gameover.gameoverScreen.Visibility = Visibility.Visible;
         //Label lblGameoverText = new Label();
         //lblGameoverText.Content = "Game Over.";
         //Label lblPlayAgain = new Label();
         //lblPlayAgain.Content = "Press 1 to Play Again.";
         gameover.endgame();
         gameover.endgamescore(this, maplevel);
     }
 }