Esempio n. 1
0
        public CommandExecutor(
            GameState state,
            ICommandList commands,
            IXleGameControl gameControl,
            IXleInput input,
            ISoundMan soundMan,
            IPlayerDeathHandler deathHandler,
            IPlayerAnimator characterAnimator,
            ITextArea textArea)
        {
            gameState           = state;
            this.commands       = commands;
            this.gameControl    = gameControl;
            this.input          = input;
            this.textArea       = textArea;
            this.soundMan       = soundMan;
            this.playerAnimator = characterAnimator;
            this.deathHandler   = deathHandler;

            input.DoCommand += (sender, args) =>
            {
                DoCommand(args.Command, args.KeyString);
            };

            mDirectionMap[Keys.Right] = Direction.East;
            mDirectionMap[Keys.Up]    = Direction.North;
            mDirectionMap[Keys.Left]  = Direction.West;
            mDirectionMap[Keys.Down]  = Direction.South;

            mDirectionMap[Keys.OemOpenBrackets] = Direction.North;
            mDirectionMap[Keys.OemSemicolon]    = Direction.West;
            mDirectionMap[Keys.OemQuotes]       = Direction.East;
            mDirectionMap[Keys.OemQuestion]     = Direction.South;
        }
Esempio n. 2
0
 public XleRenderer(
     ICommandList commands,
     IXleImages images,
     IPlayerAnimator playerAnimator,
     IXleScreen screen,
     IRectangleRenderer rects,
     IStatsDisplay statsDisplay)
 {
     this.commands       = commands;
     this.images         = images;
     this.Screen         = screen;
     this.rects          = rects;
     this.playerAnimator = playerAnimator;
     this.statsDisplay   = statsDisplay;
 }
Esempio n. 3
0
    public PlayerMovement(
        IPlayerAnimator playerAnimator,
        IPlayerEffects playerEffects,
        Transform playerGroundCheck,
        Rigidbody2D playerRigidBody,
        Transform playerTransform,
        PlayerMotionConstants motionConstants)
    {
        this.playerAnimator    = playerAnimator;
        this.playerEffects     = playerEffects;
        this.playerGroundCheck = playerGroundCheck;
        this.playerRigidBody   = playerRigidBody;
        this.playerTransform   = playerTransform;
        this.motionConstants   = motionConstants;

        playerJump = new PlayerJump(motionConstants);
        playerDash = new PlayerDash(motionConstants, playerEffects);
    }
Esempio n. 4
0
 public Finish(LevelManager levelManager, IPlayerAnimator animator, ITouchInput input)
 {
     _levelManager = levelManager;
     _animator     = animator;
     _input        = input;
 }
Esempio n. 5
0
 public Start(IPlayerAnimator animator, ITouchInput input)
 {
     _animator = animator;
     _input    = input;
 }
Esempio n. 6
0
 void SetupAnimtor()
 {
     playerAnimator = Substitute.For <IPlayerAnimator>();
 }