Repository navigation
Add time scale, pause and stepping, more console commands, and timers and tweens - #3
Merged
Merged
Conversation
… and tweens Batch 2 of ROADMAP.md. - Time: Pancake::timeScale, pause, step, getFps and getUnscaledDeltaTime. The scene gets the frame time times the time scale, zero while paused, or exactly one physics step per step() while paused. Components keep updating while paused, so a pause menu can still read input. - Display: Pancake::vsync and fullscreen, applied by the main loop. - Console commands: pause, step, timescale, spawn, kill and tp (by id or name), fps (an overlay showing frame rate, pause and time scale), vsync and fullscreen. - Timers: Scene::after, every, cancel and hasTimer. They advance with the scene's delta time, run after entity updates, fire at most once a frame, and are cancelled when their owner entity dies. Callbacks can add and cancel timers safely. - Tweens: a non-serialised Tween component for position, size, rotation, sprite colour and custom values, with Ease functions, delays, and begin and complete callbacks. Start values are read after the delay, so tweens chain. Colour tweens look the sprite up by id, so removing the sprite first is safe. - Entity::update only updates the components it had when the frame began. A component added during an update, like a tween chained from onComplete, used to run in the same frame and consume its time. - The demo gets P (pause), N (step) and F (fps) keys, and spawned boxes pop in with a size tween. Tests: new unit test test_time for timers, easing and tweens, and engine test test_time_engine for pause, step, time scale, the console commands, colour tweens (including a removed sprite, which ASan checks) and fullscreen. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_015cNAkNqoDWA5gFReD1AsqV
RohanFredriksson
changed the base branch from
claude/gameplay-api-batch1
to
master
October 16, 2026 02:13
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Batch 2 of
ROADMAP.md. This is stacked on #2 (batch 1), so it targets that branch and the diff shows only batch 2. Merge #2 first. GitHub then retargets this PR tomasterif the batch 1 branch is deleted on merge; otherwise change the base tomasterby hand.Changes
Pancake::timeScale,pause(bool)/pause(),step(n),getFpsandgetUnscaledDeltaTime.step()while paused.dtof 0, so a pause menu can still read input.Pancake::vsyncandfullscreen, applied by the main loop. Both can be set beforestart().pause,step [n]andtimescale [x].spawn <x> <y> [w h]creates a dynamic box.kill <id|name>andtp <id|name> <x> <y>.tpalso stops the body.fpstoggles an overlay with frame rate, pause state and time scale.vsyncandfullscreen.Scene::after,every,cancelandhasTimer.dt, run after entity updates, fire at most once a frame, and are cancelled when their owner entity dies.Tweencomponent (components/tween.hpp) for position, size, rotation, sprite colour and custom values (Tween::value).Easefunctions, plus delays and begin/complete callbacks.Entity::updateonly updates the components it had when the frame began.onCompleteused up the whole frame's time at once.Testing
tests/test_time.cppcovers one-shot and repeating timers, zerodt, adding and cancelling from callbacks, owner death, easing endpoints, and position, chained, rotation, size and value tweens.tests/test_time_engine.cppcovers:stepadvancing exactly one physics step;spawn,tpandkillby id and by name;fpsandvsync;🤖 Generated with Claude Code
https://claude.ai/code/session_015cNAkNqoDWA5gFReD1AsqV
Generated by Claude Code