Spielerando

Timing and easing

Learning paths through this topic

Let aim spread widen while firing and tighten only after a short pause

A shooter's crosshair that tightens at once feels like there is no cost to firing, and one that tightens at a frame-dependent speed makes the same pause worth different accuracy on different screens. Here is how to widen it per shot and let it recover fairly.

Make a platform that shakes, drops and comes back only when nobody stands there

Crumbling platforms are fun until they come back inside the player, restart their warning every time a foot touches them, or drop at once on a long frame. Here is a simple three-part timeline that keeps the warning fair and the return safe.

Blink the player after a hit and end visible when protection ends

After a hit the hero flickers while protected. Done carelessly, the hero ends the protection invisible, gets hit again during it and restarts the timer, or flickers at a speed that depends on the screen. Here is the timing that ends cleanly.

Make a dash cover a fixed distance and start its cooldown when it ends

A dash that goes further on a fast screen, or whose cooldown ticks while you are still dashing, feels unreliable in a game of tight jumps. Here is how to make the dash always land in the same spot and give the cooldown to the right part of the time.

Show dialogue letter by letter with natural pauses, and let players skip it

Text that types itself out feels alive, but at a constant speed it reads like a machine, speeds up on fast computers and splits emoji in half. Here is how to time each character, pause where a speaker would, and jump to the end on a button press.

Detect a double tap to dash without triggering it by holding or by mixing directions

Tapping left twice to dash sounds simple, but holding the key fires it, a tap left then right counts as a pair, and a slow frame can swallow the second tap. Here is the small bit of timing that tells a real double tap from everything else.

Speed up enemy attacks on harder levels without making them impossible to dodge

Making enemies faster by scaling every time in their attack shrinks the warning too, until a hit comes with no chance to react. Here is how to keep a warning a human can read while the rest of the attack gets as fierce as you like.

Give enemies a human reaction delay so they aim where you were, not where you are

Enemies that always know your exact position this very frame feel like cheats, and a fixed delay built with a list of recent frames changes with the frame rate. Here is a short memory of where the player was that gives every enemy its own reaction time.

Spawn enemies on a steady beat that does not drift or bunch up after a lag

Timers that add the interval to themselves drift over a long level, and after a lag spike the whole backlog of enemies appears at one spot in the same frame. Here is a schedule that stays on its beat for an hour and spreads late arrivals where they should be.

Play a sound when a swinging or bouncing move first touches its goal

With eased and bouncy movement the object reaches its goal long before the animation ends, so a sound or effect timed at the end comes late. Here is how to find the real moment of arrival, or any other point on the way, and what to do when it never gets there.

Keep movement steady on any screen while drawing it smoothly

If the game world moves in tiny equal steps but the screen refreshes at a different rhythm, characters shimmer or stutter, and one slow frame can make the game fall further and further behind. Here is how to avoid both problems.

Play footstep sounds by distance walked so slow and fast steps both sound right

A footstep sound on a fixed timer sounds like a metronome: a character that creeps stomps at the pace of a sprint, and one that stops mid-stride goes on clicking. Here is a way to tie the steps to the ground covered, with the correct foot and the exact moment.