Example #1
0
 //CONSTRUCTOR
 public GameManager(ContentManager content)
 {
     _Player = new Player(content);
     _AI = new AI(content);
     _TWM = new TileWorldManager(content);
     _Timer = new Timer(content);
 }
Example #2
0
 public void shootAI(Player player, AI Ai)
 {
     this.player = player;
     this.enemy = Ai;
     shoot = true;
     currentPosition = new Vector2(player.getPosition().X, player.getPosition().Y);
     destinationPosition = new Vector2(Ai.getPosition().X+2, Ai.getPosition().Y);
 }
Example #3
0
        public void Update(GameTime gameTime, Player player)
        {
            fElapsed += (float)gameTime.ElapsedGameTime.TotalSeconds;

            if (fElapsed >= actionRate)
            {
                MoveToAttackY(player);
                fElapsed = 0f;
            }
        }
Example #4
0
 //BUILDING AI
 //No need to move to attack X since they will always be in there
 public void MoveToAttackY(Player player)
 {
     if (_Position.Y == player._Position.Y)
         return;
     if (_Position.Y > player._Position.Y)
         _Position.Y--;
     if (_Position.Y < player._Position.Y)
         _Position.Y++;
 }
Example #5
0
 public void shootPlayer(Player player)
 {
     shoot = true;
     destinationPosition = new Vector2(player.getPosition().X, player.getPosition().Y);
 }