Start paused, step one frame and break from a behavior

Finding out what a game does in its first frames, or right at one
spot of a flow, needed a quick hand on the pause button. Now the
editor can start a play paused, step it frame by frame and let a
behavior pause it.

- The pause button can be pressed in edit mode. Then Play starts
  paused, and every further Play does too until it is released. A
  reload of the page clears it.
- A third button, Next frame, right of Pause, or Ctrl+Shift+Enter.
  It works only while paused and runs exactly one frame of 1/60 s,
  whatever the frame took on screen. Hierarchy and inspector follow.
- The Break node pauses the play like the button, at the end of the
  frame it ran in. The status line names the behavior's object. It
  is the editor's pause, not Pause game.
- Break reaches the editor through a service only the editor hands
  to a play. In play.html and Run in editor the node does nothing.
- Restart game keeps the running play's state. Start paused only
  counts when Play is pressed.
- Wiki Concepts, Behaviors, Keyboard: the buttons, the node and the
  shortcut.

Not tried: sound, free-running videos and a running recording while
stepping. Sound and videos stay held during the pause.

Tests:
- tsc, eslint and Prettier are clean.
- Unit pause, node-catalog, tooltip: 465 green. svg-icons now
  expects the step icon too.
- e2e 18 and 46 on stein2 (melektaus-atx was off): ALL PASSED,
  63 checks, 7 new in 18j. A step moves the box by 1.667 px at
  100 px/s, Break stops the play with "Break in Breaker".
- Counter-checks: a session that ignores the step turns 18j red. A
  Break that does not report its object turns the unit test red.
- Gate on stein2: tsc, eslint and Prettier clean, 305 files,
  4722 tests, 6 more than before. One was red at first, the icon
  list of the top bar did not know step yet. Fixed in
  svg-icons.test.ts and run again.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
adminandClaude Opus 5.5 committed 2026-10-13 06:02:35 +02:00
1 parent 64d0d472e5
commit 7a952cb20d
23 files changed
+378 -55

No files matched your search

+2 -1
View File
@@ -108,10 +108,11 @@ describe('icon files', () => {
'play',
'record',
'redo',
'step',
'stop',
'undo',
]);
expect(new Set(Object.values(TOOLBAR_ICON_SVG)).size).toBe(8);
expect(new Set(Object.values(TOOLBAR_ICON_SVG)).size).toBe(9);
});
it('has one picture per switch behind the eye', () => {
+11 -1
View File
@@ -335,7 +335,7 @@ describe('the marks of a list row', () => {
});
describe('what the buttons without a caption say', () => {
const idle = { undo: null, redo: null, editing: true, paused: false };
const idle = { undo: null, redo: null, editing: true, paused: false, startPaused: false };
it('writes a shortcut behind the name, and nothing where there is none', () => {
expect(withShortcut('Undo', 'Ctrl+Z')).toBe('Undo (Ctrl+Z)');
@@ -355,6 +355,16 @@ describe('what the buttons without a caption say', () => {
expect(toolbarTip('play', { ...idle, editing: false })).toBe('Stop (Esc)');
expect(toolbarTip('pause', { ...idle, editing: false })).toBe('Pause (Ctrl+Enter)');
expect(toolbarTip('pause', { ...idle, editing: false, paused: true })).toBe('Resume (Ctrl+Enter)');
expect(toolbarTip('step', { ...idle, editing: false, paused: true })).toBe(
'Next frame (Ctrl+Shift+Enter)',
);
});
it('before Play, pause says whether Play will start paused', () => {
expect(toolbarTip('pause', idle)).toBe('Start paused');
expect(toolbarTip('pause', { ...idle, startPaused: true })).toBe(
'Play starts paused – click to start running',
);
});
it('takes the names from the command stack, the last step first', () => {