Ejemplo n.º 1
0
        public ISprite CreateFacingRightSprite(Vector2 position, Vector2 velocity, Vector2 acceleration)
        {
            var     adjustedAcceleration = acceleration + BaseAcceleration;
            ISprite sprite = new SpriteMovingNonAnimated(Atlas, position, velocity, adjustedAcceleration, SheetCols, SheetRows, 0);

            AvatarBoundBox(sprite);
            return(sprite);
        }
Ejemplo n.º 2
0
        public ISprite CreateJumpRightSprite(Vector2 position, Vector2 velocity, Vector2 acceleration, bool grounded)
        {
            var adjustedAcceleration = new Vector2(acceleration.X, BaseAcceleration.Y);
            var adjustedVelocity     = velocity;

            if (grounded)
            {
                adjustedVelocity = new Vector2(velocity.X, -500);
            }
            ISprite sprite =
                new SpriteMovingNonAnimated(Atlas, position, adjustedVelocity, adjustedAcceleration, SheetCols, SheetRows, 1);

            AvatarBoundBox(sprite);
            return(sprite);
        }