Springs and curves
Learning paths through this topic
Chase a moving target smoothly with a speed limit and no overshoot
A companion, camera or cursor that smoothly follows can zoom across the screen when the target teleports and swing past it when the target stops. Here is how to follow gently, cap the speed, and arrive without a wobble, in two dimensions.
Pull a menu cursor gently toward the nearest button without flickering between two
On a controller, aiming a free cursor at small buttons is fiddly. A soft pull toward the nearest button makes it easy, but if two buttons are close the pull can jump between them, and a pull that is too strong makes it hard to leave. Here is a pull that is strong only near the centre.
Let a glider or parachute slow a fall smoothly toward its steady speed from any start
Opening a parachute should not stop the player at once, and falling without one should not speed up forever. Here is how the fall speed approaches its natural limit, whether you start slow, or fall fast and open the chute, with exact distances for any frame rate.
Roll a gold counter up to the new total without a slow crawl at the end
When loot lands, the number should run up smoothly, and a second pickup in the middle must carry on instead of restarting. A plain smooth slide makes the last few coins take forever to arrive. This shows how to make it land cleanly every time.
Make a hanging lantern or sign swing believably, also after a very hard hit
A simple wobble looks right for a gentle nudge and wrong for a big swing, where a real hanging thing slows at the top and takes longer per swing. Here is how to get both right, and keep the swing identical on fast and slow machines.
Bob the first-person view with every footstep, and stop it gently when you stop
A walking bob that runs on the clock slides along when you crouch, speeds up at the wrong moment and snaps back when you stop. Here is how to tie the bob to the ground covered, so it matches your pace, fades away softly and stays still in the air.
Show a health bar that drops at once and a pale chip that drains later
Players read a hit best when the bar falls straight away and a lighter stripe shows how much was just lost, then fades out. Here is how to time that stripe so rapid hits and healing in between never make it jump or cheat.
Pulse the screen edges like a heartbeat that speeds up as health drops
A low-health warning should feel like a pounding heart, with two quick beats and a pause, getting faster as things get worse. A simple fade in and out looks like a lamp, and changing its speed on the fly makes it hiccup. Here is how to do it without either flaw.
Lower the old tool, swap at the bottom and raise the new one, even when scrolling fast
Switching the held axe or torch looks wrong if the new item pops in at once or if every scroll click replays the whole animation. Here is a swap that changes at the right instant, turns around cleanly when you switch back, and never queues up.
Hold the swing for a moment on impact, but never let hits lock the game
A tiny pause when an axe bites into wood or a club hits a beast makes every blow feel heavy. But with fast attacks or many hits the pauses can add up until the game seems stuck. Here is a way to keep the punch and cap the total.
Make a sign, bush or button wobble when hit, even by many hits in a row
A single kick that sets something swinging is easy. The trouble starts when many hits arrive together: the wobble grows without limit, the object flies off its place, or each hit restarts and looks fake. Here is how to add hits up and keep the result believable.
Fill a hold-to-use ring that unwinds when released and triggers only once
Opening a chest or bandaging a wound by holding a key is easy until the player keeps holding, looks at something else mid-fill, or taps repeatedly. Here is how the ring behaves in each case so the action happens exactly once and never by accident.