예제 #1
0
 internal AxisControl(IInputManager inputManager, GameActions negative, GameActions positive)
 {
     _inputManager   = inputManager;
     _negativeAction = negative;
     _positiveAction = positive;
     _inputManager.AddKeyListener((int)_negativeAction, ProcessNegative);
     _inputManager.AddKeyListener((int)_positiveAction, ProcessPositive);
 }
예제 #2
0
        public PlayerMind(IEntity ent)
        {
            IdleState = "Idle_Right";
            body      = ent;
            input.AddKeyListener(OnNewKeyInput);
            //Add states to player for things liek climbing in order to counter the limitations of gravity
            StateMachine = new StateMachine <IEntity>(body);

            SpriteSheet = new SpriteSheetAnimation(body.Texture);
            Animations  = new AnimationMachine <IEntity>(body);

            StateMachine.AddState(new EmptyState <IEntity>(), "BaseState");
            StateMachine.AddState(new DamagedPlayerState <IEntity>(((Player)body), StateMachine, Animations), "Damaged");

            Animations.AddState(new AnimationState(body, SpriteSheet, 0, 0, 0, 1), "Idle_Left");
            Animations.AddState(new AnimationState(body, SpriteSheet, 0, 1, 0, 1), "Idle_Right");
            Animations.AddState(new AnimationState(body, SpriteSheet, 12, 0), "Walking_Left");
            Animations.AddState(new AnimationState(body, SpriteSheet, 12, 1), "Walking_Right");
            Animations.AddState(new AnimationState(body, SpriteSheet, 12, 2), "Climbing");
        }
예제 #3
0
 public WeaponControl(IInputManager inputManager)
 {
     _inputManager = inputManager;
     inputManager.AddKeyListener((int)GameActions.Shot, ShotKeyStateChange);
 }
예제 #4
0
 public void Init(IAppStateManager appStateManager, IInputManager inputManager)
 {
     _appStateManager = appStateManager;
     _inputManager    = inputManager;
     _inputManager.AddKeyListener((int)GameActions.Escape, Back);
 }