Timing and easing
Learning paths through this topic
Easing functions
The complete set of movement curves that make things start softly, land softly, swing past the end or bounce. Your game stops looking stiff, because nothing moves at one flat speed any more.
Lerp and smoothstep
The small helpers for blending one number into another: halfway between two values, turning health into a bar, a soft fade near an edge. They are the building blocks behind nearly every smooth effect in a game.
Animation timeline
Puts several moves in a row or side by side and plays them back, with named moments for sounds and effects. Use it for intros, door openings, menus whose parts arrive one by one, and small cutscenes.
Show an ability cooldown clock that does not jump when speed-ups change
The little clock on a skill button is easy until a power-up makes cooldowns faster halfway through: then the clock jumps, the skill becomes ready too early, or the timer shows a wrong number of seconds. Here is a way to count that stays right.
Chain attacks so a button press slightly too early still counts
Players mash the button a little before the current swing allows the next one, and the game ignores them, so combos feel unresponsive. Here is how to remember the press for a short moment and start the next move exactly when the animation permits.
Split a sword swing into wind-up, hit and recovery without missing hits
Players say a swing felt like it should have hit but did nothing. The cause is often a single slow frame that jumped right over the short moment in which the blade can hurt. Here is a way to time the three parts so a slow computer cannot swallow the hit.
Fade from one character animation to another, even when interrupted mid-fade
Switching from standing to running to jumping in one hard cut looks robotic, and a naive fade breaks when the player changes their mind halfway: the character pops or briefly bends into an impossible pose. Here is a fade that always adds up and never pops.
Let a boss attack pattern speed up in a rage phase without jumping
When a boss gets angry and its sweeping attack becomes faster, the spinning beam can suddenly jump to a new angle, and shots meant for fixed moments are skipped or fired twice. Here is how to change speed in the middle and keep everything in place.
Make a popup overshoot by exactly as much as you want
Overshooting entrances give buttons and rewards a lively pop, but the usual magic number gives a surprise: tiny movements barely show it, large ones swing wildly. Here is how to choose the overshoot you want as a percentage and get exactly that.
Apply burning damage in even ticks and keep the beat when set alight again
Damage over time sounds trivial until a second fire arrives: the target either takes an extra hit at once, or the beat restarts so that a flame touched every few moments never hurts. Here is the timing that always deals the promised total.
Fire a three-round burst that finishes even if you let go
A burst weapon feels wrong when letting go cancels the second shot, when mashing the button restarts the burst, or when the pause after a burst starts at the wrong moment. Here is a small timing machine that behaves the way players expect.
Make a quick tap flash long enough to be seen
On fast taps the press highlight turns on and off between two screen refreshes, so the player never sees it and the button feels dead. Here is how to guarantee a minimum visible time and still fade out smoothly after a long hold.