Punch and impact
Learning paths through this topic
Walking diagonally into a wall should slide along it, not stop dead
A hero that freezes whenever it brushes a wall feels glued to the map, especially in caves and houses full of corners. Sliding looks simple, but a fast step can also jump straight through a thin wall. Here is the order of the checks and the safe step size.
Screen shake that grows with big hits and calms down on its own
Shake that is the same for every hit feels cheap, and shake that piles up from several hits can fling the picture off the screen. A single stored value for how shaken the screen is solves both. Here is how to turn it into movement and how fast to let it fade.
A dramatic slow-motion moment that ends on time and eases back
Slow motion for a last kill or a near miss often lasts five times longer than planned, snaps back with a jerk, or cuts the sound at a strange moment. The cause is which clock measures the effect. Here is the shape of the ramp and how long to hold.
Squashing and stretching a character without making it look like it grows
Scaling a character taller when it jumps and flatter when it lands gives life, but done by hand it swells, sinks into the floor or floats above it. A simple relation between the two directions and the right anchor point prevent that.
A sword swing that hits an enemy ten times in one slash
The damage area of an attack exists for several frames, so one slash can hurt the same enemy over and over, or miss because the area is there before the swing looks ready. Here is the timing of start, hit and recovery, and the memory that fixes the repeat.
A three-hit attack chain where an early button press is not lost
Players press attack again while the first swing is still going, and the game either ignores it or fires the next hit at once and breaks the rhythm. Remembering the press for exactly one swing makes chains feel smooth. Here is what to remember and what to clear.
Gun recoil that climbs while firing and settles after, without fighting the player
Recoil that snaps back during a burst undoes itself, and recoil that never returns leaves the aim stuck at the ceiling. And if the player pulls down to compensate, the game must not pull a second time. Here is the timing for rise, pause, recovery and the player's share.