Esempio n. 1
0
        public override void Initialize(Vector2 position)
        {
            _inputHandler = new InputHandler();
            Id            = Guid.NewGuid();
            Active        = true;
            Speed         = 0;
            BaseSpeed     = 140;
            TopSpeed      = 400;
            Acceleration  = 1.015f;
            CurrentAccelerationDirection = DirectionEnum.NoDirection;
            _pushDirection = DirectionEnum.NoDirection;

            var sprites = Sprites.Instance;

            SpriteHandler = new SpriteHandler(position);
            SpriteHandler.InitializeAnimation(SpriteKeys.Quote.RunRight, sprites.GetSprite(SpriteKeys.Quote.RunRight), 64, 64, 4, 80, Color.White, 1f, true);
            SpriteHandler.InitializeAnimation(SpriteKeys.Quote.RunLeft, sprites.GetSprite(SpriteKeys.Quote.RunLeft), 64, 64, 4, 80, Color.White, 1f, true);
            SpriteHandler.InitializeAnimation(SpriteKeys.Quote.PushRight, sprites.GetSprite(SpriteKeys.Quote.PushRight), 64, 64, 4, 80, Color.White, 1f, true);
            SpriteHandler.InitializeAnimation(SpriteKeys.Quote.PushLeft, sprites.GetSprite(SpriteKeys.Quote.PushLeft), 64, 64, 4, 80, Color.White, 1f, true);
            SpriteHandler.InitializeAnimation(SpriteKeys.Quote.StandRight, sprites.GetSprite(SpriteKeys.Quote.StandRight), 64, 64, 1, 80, Color.White, 1f, true);
            SpriteHandler.InitializeAnimation(SpriteKeys.Quote.StandLeft, sprites.GetSprite(SpriteKeys.Quote.StandLeft), 64, 64, 1, 80, Color.White, 1f, true);
            SpriteHandler.Initialize(SpriteKeys.Quote.StandRight);

            var grid = CollisionGrid.Instance;

            CollisionCellPositions = grid.UpdateCellPosition(this);
        }
Esempio n. 2
0
        public override void Initialize(Vector2 position)
        {
            Id           = Guid.NewGuid();
            Active       = true;
            Speed        = 0;
            BaseSpeed    = 0;
            TopSpeed     = 0;
            Acceleration = 0;
            CurrentAccelerationDirection = DirectionEnum.NoDirection;

            var sprites = Sprites.Instance;

            SpriteHandler = new SpriteHandler(position);
            SpriteHandler.InitializeAnimation(SpriteKeys.DiamondBlock.Stand, sprites.GetSprite(SpriteKeys.DiamondBlock.Stand), 64, 64, 1, 80, Color.White, 1f, true);
            SpriteHandler.Initialize(SpriteKeys.DiamondBlock.Stand);

            var grid = CollisionGrid.Instance;

            CollisionCellPositions = grid.UpdateCellPosition(this);
        }