How do I make my character skid when he is sprinting.

From the Asset Store
The Stickman Sword is suitable for platformer / sidescrolling games
  • I need help making my character skid when he is sprinting in one direction and then he moves in another

    like here

    Tagged:

  • You will want to implement some basic velocity and acceleration physics. Rather than letting the character move at a set speed when you press a key, have a variable called velX and velY for the character. Tell your character to move velX distance left/right every tick, and velY distance up/down every tick. When you press up, increase the vely by a little every tick, and when you press down, decrease it by a little every tick. Same for left and right on velX. Then lower both velocities by about 10% every tick to get natural deacceleration. This will make him slid around, and accelerate smoothly.

    .

    you can multiply the acceleration numbers by a speed variable to change how fast he is.

    Tweak the numbers how you see fit.

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • If you're using the platformer

    set running to when key pressed on the floor

    set skidding to when is moving but not pressing the key on the floor

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)