Beispiel #1
0
        public Player(frmSpaceGame form)
        {
            this.form   = form;
            Speed       = 5;
            PlayerShips = new List <PictureBox>();

            Init();
        }
Beispiel #2
0
        public Laser(frmSpaceGame form)
        {
            this.form  = form;
            Speed      = 5;
            this.laser = new PictureBox();

            Init();
        }
Beispiel #3
0
        public static void CalculateScore(PictureBox enemy, frmSpaceGame form)
        {
            if (enemy.BackColor == Color.Blue)
            {
                TotalScore += 1;
            }
            else if (enemy.BackColor == Color.Red)
            {
                TotalScore += 2;
            }

            form.Text = "Score: " + TotalScore;
        }
Beispiel #4
0
        public Enemy(frmSpaceGame form)
        {
            rand      = new Random();
            this.form = form;
            enemies   = new List <PictureBox>();

            enemy = new PictureBox()
            {
                BackColor = GetColor(rand.Next(1, 3)),
                Width     = rand.Next(30, 50),
                Height    = rand.Next(30, 50),
                Tag       = "Enemy",
                Visible   = true
            };

            Init();
        }