Spielerando

Timing and easing

Learning paths through this topic

Record a ghost run and replay it at the right speed on any computer

A ghost of your best run is a fine rival, until it runs too fast on a quicker screen, creeps on a slower one, or takes a huge file because it saved every frame. Here is a way to record on a fixed beat and replay by the clock, so the ghost always arrives when you did.

Time a grappling hook that flies out, pulls you in or returns after a miss

A grappling hook has three stories: it hits and pulls, it misses and comes back, and it hits in the middle of a long frame. Done carelessly the rope ends past the target, the pull starts a moment late, or the miss lasts a different time on each screen. Here is the timing for all three.

Let players hold a grenade to shorten the fuse and throw it back

A grenade fuse that restarts when thrown cannot be cooked, one that does not stop when held cannot be thrown back, and a slow frame can let it blow up a little late and in the wrong place. Here is the timing that lets all three work.

Make a machine gun fire the same number of shots on any screen

On a fast screen your gun shoots like a toy, on a slow one it sputters, and holding the button after a long pause sometimes gives a sudden burst. Here is how to make the rate honest and keep every bullet where it belongs.

Freeze the game for a moment on a hit, then slow down, without stalling the menu

A short freeze on impact and a slow-motion finish make hits feel heavy. The trap is that effects meant to end after a certain time never end while time is stopped, or the freeze eats into the slow part. Here is a clean way to clock all of it.

Stop endless combos by letting the stun shrink with every hit

If every hit stuns an enemy for the same time, a patient player can chain hits forever and the enemy never gets to move. Here is how to make each follow-up hit buy less time, let the target break free at the end, and keep the count honest after a pause.

Make hold-to-open actions fill while held and slowly drain when you let go

A progress ring for opening a chest or hacking a door is easy to get wrong: letting go for one frame wipes everything, completing fires the action twice, or it opens again when the button is still down. Here is a ring that is forgiving and completes exactly once.

Make a buff icon blink faster as it runs out without the blink glitching

A bonus that is about to end should warn the player by blinking faster and faster. The obvious formula, speed times time, makes the icon flash at random moments each time the speed changes. The correct way is to add up small steps. Here is the idea and the exact warning curve.

Spawn a fixed number of sparkles per second even when the income is enormous

One particle per click or per coin works until an upgrade makes it a thousand per second and the phone starts to crawl. Capping the number is the obvious step, but it hides how strong the player has become, and it loses the fractions that small rates need. Here is a spawn rule that does both jobs.

Keep a cooldown ring honest when a speed-up starts or ends in the middle

An ability ring that is 60 percent full should still be 60 percent full the moment a haste bonus starts, only filling faster. Storing an end time instead of a fill makes the ring jump, and a ring that finishes twice in one frame loses the spare time. Here is a ring that stores the fill and the speed separately.

Let the counter rise as each flying coin lands, not all at once at the start

Coins that fly up to the counter while the number has already jumped look fake. The number should grow with every landing. This sounds easy, but it must also stay right when the player spends money while coins are still on their way, and it must end on the exact true value. Here is a way to keep picture and value together.

Count down to the player's next local midnight, also when the clocks change

A daily reward that resets at midnight needs a countdown, and "86400 seconds minus the time of day" looks right until the night the clocks change, when it is an hour out. Here is a countdown that asks which hour offset applies at the moment of the reset, plus the rounding rule that stops it from showing zero too early.