Slow every animation down for a low-res screen
Every speed in config.js is in pixels per second, so the same numbers cross a small screen in less time than a big one: on 1280x800 the frame covers the width in two thirds of the time it takes on 1920x1080, and the player reads as hurried. One factor now sits behind every animation clock — tickSeconds() for the frame loops, `speed` for the corners timer, and a --motion-stretch custom property for the two CSS fades — so the Speed switch on the queue page slows the drift, the glides, the pong rally, the drag beats, the wash lap, the screenshot intervals and the fades together. It is read per frame rather than baked into the constants, so flipping the switch lands on the next frame: no animation restarts, and one part-way through a beat keeps its place. The trail's stills now age on animation time rather than wall-clock time, so a still fades at the rate the frame that dropped it is moving. The audio crossfade is deliberately left out, being tied to the track that is ending. The flag is saved with the queue, unlike `paused`: it describes the screen the player is on, which a restart does not change. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_011vCaS2whbFjExShoPNnS3A
This commit is contained in:
@@ -92,6 +92,19 @@ export const PONG_MISS_CHANCE = 0.25;
|
||||
// Seconds the ball waits out of play after it gets past the paddle.
|
||||
export const PONG_SERVE_SECONDS = 1.1;
|
||||
|
||||
// Everything that moves is measured in pixels per second, so the same speed
|
||||
// crosses a small screen in less time than a big one: on 1280x800 the frame
|
||||
// covers the width in two thirds of the time it takes on 1920x1080, and the
|
||||
// whole player reads as hurried. The low-res switch on the queue page multiplies
|
||||
// every animation clock — drift, glides, the pong rally, the drag beats, the
|
||||
// wash lap, the screenshot intervals and the fades — by this one factor, which
|
||||
// is the 1280/1920 ratio rounded off. Lower it to slow the party down further.
|
||||
export const LOW_RES_SPEED = 0.65;
|
||||
|
||||
// Whether the player starts in that mode. Persisted with the queue, so a screen
|
||||
// that needs it only has to be told once.
|
||||
export const DEFAULT_LOW_RES = false;
|
||||
|
||||
// The frame animations, keyed by the id sent over the socket. The names must
|
||||
// match the registry in public/player/motion.js, which supplies the code.
|
||||
export const ANIMATIONS = {
|
||||
|
||||
Reference in New Issue
Block a user