コード例 #1
0
 /// <summary>
 /// Updates the enemy using the AI
 /// </summary>
 /// <param name="ElapsedTime">Time in seconds since last update</param>
 /// <param name="enemy">Enemy to update</param>
 public override void Update(float ElapsedTime, Enemy enemy)
 {
     enemy.position = enemy.initialPosition;
 }
コード例 #2
0
ファイル: Enemy.cs プロジェクト: Rob7045713/DungeonCrawler
 public RelaxState(Enemy enemy, float relaxTime)
 {
     this.enemy = enemy;
     this.relaxTime = relaxTime;
     enemy.velocity = new Vector2(0, 0);
 }
コード例 #3
0
ファイル: Enemy.cs プロジェクト: Rob7045713/DungeonCrawler
 public ReturnState(Enemy enemy)
 {
     this.enemy = enemy;
     enemy.velocity = new Vector2(0, 0);
 }
コード例 #4
0
ファイル: Enemy.cs プロジェクト: Rob7045713/DungeonCrawler
 public ChaseState(Enemy enemy, Player player)
 {
     this.enemy = enemy;
     enemy.chasing = player;
     enemy.velocity = new Vector2(0, 0);
 }
コード例 #5
0
 /// <summary>
 /// Updates the enemy using the AI
 /// </summary>
 /// <param name="ElapsedTime">Time in seconds since last update</param>
 /// <param name="enemy">Enemy to update</param>
 public override void Update(float ElapsedTime, Enemy enemy)
 {
     enemy.velocity = new Vector2(speed * Math.Sign(enemy.chasing.position.X - enemy.position.X), 0);
 }
コード例 #6
0
 /// <summary>
 /// Updates the enemy using the AI
 /// </summary>
 /// <param name="ElapsedTime">Time in seconds since last update</param>
 /// <param name="enemy">Enemy to update</param>
 public override void Update(float ElapsedTime, Enemy enemy)
 {
     enemy.velocity = new Vector2(0, 0);
 }
コード例 #7
0
ファイル: EnemyAI.cs プロジェクト: Rob7045713/DungeonCrawler
 /// <summary>
 /// Updates the enemy using the AI
 /// </summary>
 /// <param name="ElapsedTime">Time in seconds since last update</param>
 /// <param name="enemy">Enemy to update</param>
 public abstract void Update(float ElapsedTime, Enemy enemy);
コード例 #8
0
 /// <summary>
 /// Updates the enemy using the AI
 /// </summary>
 /// <param name="ElapsedTime">Time in seconds since last update</param>
 /// <param name="enemy">Enemy to update</param>
 public override void Update(float ElapsedTime, Enemy enemy)
 {
     Vector2 direction = VectorHelper.Normalize(enemy.chasing.position - enemy.position);
     enemy.velocity = direction * speed;
 }