public EnemyState HandleInput(Elements.Enemy enemy, EStateInput input, EnemyState state)
        {
            switch (input)
            {
                case EStateInput.Move:
                    return new EnemyRunning(direction);
                case EStateInput.SwitchDir:
                    if (direction != 0)
                    {
                        enemy.velocity.X = 0;
                        direction = (EDirection)((int)direction * -1);
                    }
                    return state;
                case EStateInput.Dead:
                    return new EnemyDead();
                case EStateInput.Hit:
                    break;
                case EStateInput.AnimEnd:

                    break;
                case EStateInput.PlayerCollision:
                    enemy.velocity = Vector2.Zero;
                    return new EnemyAttack(direction);
                case EStateInput.Stop:
                    if (state.GetType() != typeof(EnemyIdle))
                        return new EnemyIdle();
                    return this;
                default:
                    break;
            }
            return state;
        }
Example #2
0
 public override EnemyState HandleInput(Elements.Enemy enemy, EStateInput input)
 {
     switch(input)
     {
         case EStateInput.AnimEnd:
             animState = EAnimState.Idle;
             break;
         default:
             break;
     }
     return base.HandleInput(enemy, input, this);
 }
Example #3
0
        public override EnemyState HandleInput(Elements.Enemy enemy, EStateInput input)
        {
            switch (input)
            {
                case EStateInput.AnimEnd:
                    return new EnemyIdle();

                case EStateInput.Dead:
                    return new EnemyDead();
                default:
                    break;
            }
            return this;
        }
Example #4
0
 public abstract EnemyState HandleInput(Elements.Enemy enemy, EStateInput input);
Example #5
0
 public override EnemyState HandleInput(Elements.Enemy enemy, EStateInput input)
 {
     if (input == EStateInput.AnimEnd)
         Managers.Executive.level.removeQueue.Enqueue(enemy);
     return this;
 }
 public override EnemyState HandleInput(Elements.Enemy enemy, EStateInput input)
 {
     throw new NotImplementedException();
 }