示例#1
0
        void End(EndGame end)
        {
            stopAllTimers();
            this.graphics.Clear(Color.White);
            graphics.DrawRectangle(mainGridPen, bounds); // smeni ovde
            DoubleBuffered = true;

            for (int k = 0; k < 9; k++)
            {
                for (int i = 0, j = 10; i < 15; i++, j += 10 + (ImgTank.Width / 2))
                {
                    graphics.DrawRectangle(matrixPen, j + i * (ImgTank.Width / 2), 3 * k * (ImgTank.Height / 2) + 10, ImgTank.Width + 10, ImgTank.Height + 20);
                }
            }

            if (end == EndGame.WIN)
            {
                MessageBox.Show("WELL PLAYED!");
                level++;
                newGame(difficulty, level);
            }

            else
            {
                ended = true;
                if (!arcade)
                {
                    MessageBox.Show("You got shot, cap'n!", "Game over");
                }

                else
                {
                    p.score2 = (int)this.calculatePoints();
                    f.SaveCurrentPlayer();
                    MessageBox.Show("You fought valiantly, soldier! Sadly, your tank was destroyed. \r\n\r\n\t\t          Score: " + calculatePoints(), "Game over");
                }

                this.Close();
            }
        }
示例#2
0
 public void SaveCurrentPlayer()
 {
     f.SaveCurrentPlayer();
 }