Exemple #1
0
        public AActor()
        {
            load();
            direction          = Direction.RIGHT; // Sets starting direction
            health             = 100;
            data               = new Color[health * 10];
            inventory          = new Inventory(30);
            actionStateMachine = new ActionStateMachine();
            spriteAnimations   = new Dictionary <string, SpriteAnimation>();

            actionStateMachine.Add("move", new MoveAction(this));
            actionStateMachine.Add("stand", new StandAction(this));
            actionStateMachine.Add("jump", new JumpAction(this));
            actionStateMachine.Add("attack", new AttackAction(this));
            actionStateMachine.Add("throw", new ThrowAction(this));
            actionStateMachine.Add("crouch", new CrouchAction(this));
            actionStateMachine.Add("moveLeft", new MoveLeftAction(this));
            actionStateMachine.Add("moveRight", new MoveRightAction(this));
        }
Exemple #2
0
 public ThrowAction(AActor actor)
 {
     _actor = actor;
     _actionStateMachine = actor.actionStateMachine;
 }
Exemple #3
0
        private Vector2 position; // Holds actor's position

        public MoveLeftAction(AActor actor)
        {
            _actor = actor;
            _actionStateMachine = _actor.actionStateMachine;
        }
Exemple #4
0
 public StandAction(AActor actor)
 {
     _actor = actor;
     _actionStateMachine = actor.actionStateMachine;
     _keyLocker          = new KeyLocker();
 }
Exemple #5
0
 public AttackAction(AActor actor)
 {
     _actor = actor;
     _actionStateMachine = actor.actionStateMachine;
 }
Exemple #6
0
        private Vector2 position; // Holds actor's position

        public CrouchAction(AActor actor)
        {
            _actor = actor;
            _actionStateMachine = actor.actionStateMachine;
        }
Exemple #7
0
 public JumpAction(AActor actor)
 {
     _actor = actor;
     _actionStateMachine = _actor.actionStateMachine;
 }