Esempio n. 1
0
 //Update everything. Move the enemy to the same position as its corresponding EnemyPosition. If too far on the left or right, return a "true" so that the enemies can proceed closer to the player.
 public bool EnemyUpdate(GameTime gameTime, EnemyPosition invaderPosition)
 {
     X = invaderPosition.x - frameWidth / 2;
     Y = invaderPosition.y;
     if (X > main.width - width && moveRight == true) {
         return true;
     } 
     else if (X < width / 2 && moveRight == false) 
     {
         return true;
     }
     
     return false;
 }
Esempio n. 2
0
        //Update everything. Move the enemy to the same position as its corresponding EnemyPosition. If too far on the left or right, return a "true" so that the enemies can proceed closer to the player.
        public bool EnemyUpdate(GameTime gameTime, EnemyPosition invaderPosition)
        {
            X = invaderPosition.x - frameWidth / 2;
            Y = invaderPosition.y;
            if (X > main.width - width && moveRight == true) {
                return true;
            }
            else if (X < width / 2 && moveRight == false)
            {
                return true;
            }

            return false;
        }