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

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

            Init();
        }
Ejemplo n.º 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;
        }
Ejemplo n.º 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();
        }