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)); }
public ThrowAction(AActor actor) { _actor = actor; _actionStateMachine = actor.actionStateMachine; }
private Vector2 position; // Holds actor's position public MoveLeftAction(AActor actor) { _actor = actor; _actionStateMachine = _actor.actionStateMachine; }
public StandAction(AActor actor) { _actor = actor; _actionStateMachine = actor.actionStateMachine; _keyLocker = new KeyLocker(); }
public AttackAction(AActor actor) { _actor = actor; _actionStateMachine = actor.actionStateMachine; }
private Vector2 position; // Holds actor's position public CrouchAction(AActor actor) { _actor = actor; _actionStateMachine = actor.actionStateMachine; }
public JumpAction(AActor actor) { _actor = actor; _actionStateMachine = _actor.actionStateMachine; }