コード例 #1
0
        public override void Update(Player0 player)
        {
            base.Update(player);

            // nothing to do
            player.Velocity = Vector2f.Zero;

            if (!player.ObstacleAt(Side.Down))
            {
                player.ChangeMovement(new Falling());
            }
        }
コード例 #2
0
        public override void Update(Player0 player)
        {
            base.Update(player);

            if (!player.ObstacleAt(Side.Down))
            {
                player.ChangeMovement(new Falling(this));
            }

            else
            {
                player.Velocity.X = Freeze ? 0 : Direction.X * WalkingStep;
            }
        }
コード例 #3
0
        public override void Update(Player0 player)
        {
            base.Update(player);

            if (player.Velocity.Y == 0 && player.ObstacleAt(Side.Down))
            {
                player.ChangeToPreviousMovement();
            }

            else
            {
                // air control
                player.Velocity.X  = Freeze ? 0 : Direction.X * FallStep;
                player.Velocity.Y += Gravity;
            }
        }
コード例 #4
0
        public override void Update(Player0 player)
        {
            base.Update(player);

            if (Jump.Y == 0 && player.ObstacleAt(Side.Down))
            {
                player.ChangeToPreviousMovement();
            }

            else
            {
                if (Jump != Vector2f.Zero)
                {
                    player.Velocity = Jump;
                    Jump            = Vector2f.Zero;
                }

                // air control
                player.Velocity.X  = Freeze ? 0 : Direction.X * AirStep * RunMultiplier;
                player.Velocity.Y += Gravity;
            }
        }