Esempio n. 1
0
 public void CallInvader()
 {
     for (int iInvader = 0; iInvader < nInvaders; iInvader++)
     {
         Invader newInvader = new Invader();
         newInvader.Init();
         invadersList.Add(newInvader);
     }
 }
Esempio n. 2
0
        public Boolean OverlapsInvader(Invader anInvader)
        {
            int w0 = this.texture.Width,
                h0 = this.texture.Width,
                w1 = anInvader.texture.Width,
                h1 = anInvader.texture.Height;

            if (this.position.X > anInvader.position.X + w1 || this.position.X + w0 < anInvader.position.X ||
                this.position.Y > anInvader.position.Y + h1 || this.position.Y + h0 < anInvader.position.Y)
            {
                return(false);
            }
            else
            {
                return(true);
            }
        }