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()); } }
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; } }
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; } }
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; } }