Exemplo n.º 1
0
 public MainWindow()
 {
     InitializeComponent();
     if (Data.start == false)
     {
         StartWindow w1 = new StartWindow();
         this.Hide();
         w1.Show();
     }
 }
Exemplo n.º 2
0
        public void check()
        {
            double enemyx  = Canvas.GetLeft(enemy);
            double enemyy  = Canvas.GetTop(enemy);
            double playerx = Canvas.GetLeft(player);
            double playery = Canvas.GetTop(player);
            //double SEnemy = enemy.Height * enemy.Width;
            double HPlayer = player.Height;

            if (enemyx == playerx + HPlayer)
            {
                for (int i = 0; i < 50; i++)
                {
                    if (enemyy == playery || enemyy - i == playery)
                    {
                        MessageBox.Show("You lose!");
                        audio(false);
                        resolve();
                        timer.Stop();
                        this.Hide();
                        StartWindow s1 = new StartWindow();
                        s1.scoreUpdater();
                        s1.Show();
                        break;
                    }
                }
                for (int i = 0; i < 75; i++)
                {
                    if (enemyy == playery || enemyy + i == playery)
                    {
                        MessageBox.Show("You lose!");
                        audio(false);
                        resolve();
                        timer.Stop();
                        this.Hide();
                        StartWindow s1 = new StartWindow();
                        s1.scoreUpdater();
                        s1.Show();
                        break;
                    }
                }
            }
        }