Beispiel #1
0
        public void TurnToPlayer()
        {
            var turnSpeed = TurnSpeed;

            TurnSpeed = 2f;
            CDGMath.TurnToFace(this, m_target.Position);
            TurnSpeed = turnSpeed;
        }
Beispiel #2
0
 public override void Update(GameTime gameTime)
 {
     if (Difficulty == GameTypes.EnemyDifficulty.MINIBOSS)
     {
         if (!m_isTouchingGround && IsWeighted && CurrentSpeed == 0f &&
             SpriteName == "EnemyBlobBossAir_Character")
         {
             CurrentSpeed = Speed;
         }
         if (!m_currentActiveLB.IsActive && m_isTouchingGround && SpriteName != "EnemyBlobBossIdle_Character")
         {
             ChangeSprite("EnemyBlobBossIdle_Character");
             PlayAnimation();
         }
     }
     else
     {
         if (!m_isTouchingGround && IsWeighted && CurrentSpeed == 0f && SpriteName == "EnemyBlobAir_Character")
         {
             CurrentSpeed = Speed;
         }
         if (!m_currentActiveLB.IsActive && m_isTouchingGround && SpriteName != "EnemyBlobIdle_Character")
         {
             ChangeSprite("EnemyBlobIdle_Character");
             PlayAnimation();
         }
     }
     if (IsNeo)
     {
         foreach (var current in m_levelScreen.CurrentRoom.EnemyList)
         {
             if (current != this && current is EnemyObj_Blob)
             {
                 var num = Vector2.Distance(Position, current.Position);
                 if (num < 150f)
                 {
                     var facePosition = 2f * Position - current.Position;
                     CDGMath.TurnToFace(this, facePosition);
                 }
             }
         }
         foreach (var current2 in m_levelScreen.CurrentRoom.TempEnemyList)
         {
             if (current2 != this && current2 is EnemyObj_Blob)
             {
                 var num2 = Vector2.Distance(Position, current2.Position);
                 if (num2 < 150f)
                 {
                     var facePosition2 = 2f * Position - current2.Position;
                     CDGMath.TurnToFace(this, facePosition2);
                 }
             }
         }
     }
     base.Update(gameTime);
 }