public Laser(int x, int y, Lasers lasers)
 {
     X           = x;
     Y           = y;
     Width       = 5;
     Height      = 5;
     stepSize    = 1;
     this.lasers = lasers;
     lasers.Add(this);
 }
Example #2
0
        public void CheckHit(Lasers lasers)
        {
            int i = 0;

            while ((i < alienList.Count))
            {
                Alien monster = alienList[i];
                monster.CheckHit(lasers);
                if (monster.Dead)
                {
                    this.Remove(monster);
                    score.Increment();
                }
                i = i + 1;
            }
        }
        public Form1()
        {
            InitializeComponent();

            paper  = gamePictureBox.CreateGraphics();
            user   = new User(UserImage);
            score  = new Score(ScoreLabel);
            aliens = new Aliens(score);
            Alien monster = new Alien(60, 20, AlienImage);

            aliens.Add(monster);
            monster = new Alien(100, 20 + AlienImage.Height, AlienImage);
            aliens.Add(monster);
            monster = new Alien(140, 20 + AlienImage.Height * 2, AlienImage);
            aliens.Add(monster);
            lasers = new Lasers();
            bombs  = new Bombs();
            wall   = new Wall(100, 50 + AlienImage.Height * 2);
        }
Example #4
0
 public void CheckHit(Lasers lasers)
 {
     lasers.CheckHit(this);
 }