Files
DevKage 1ed2c5a297 feat: Add stepEngine to Game (#2516)
This PR adds a new method to Game which allows advancing the game loop by a certain amount of time while the engine is paused. By default it assumes one frame to be ~16 ms, but it can be controlled while calling stepEngine

The idea is to allow easy frame by frame inspection of the game. It can even be added to FlameStudio as part of the start/pause buttons on the toolbar.

https://user-images.githubusercontent.com/33748002/233453501-b9f90d49-1834-4f0f-9536-77629cfcadbc.mp4
2023-04-23 21:28:37 +02:00

36 lines
1.2 KiB
Dart

import 'package:dashbook/dashbook.dart';
import 'package:examples/commons/commons.dart';
import 'package:examples/stories/system/overlays_example.dart';
import 'package:examples/stories/system/pause_resume_example.dart';
import 'package:examples/stories/system/step_engine_example.dart';
import 'package:examples/stories/system/without_flamegame_example.dart';
import 'package:flame/game.dart';
void addSystemStories(Dashbook dashbook) {
dashbook.storiesOf('System')
..add(
'Pause/resume engine',
(_) => GameWidget(game: PauseResumeExample()),
codeLink: baseLink('system/pause_resume_example.dart'),
info: PauseResumeExample.description,
)
..add(
'Overlay',
overlayBuilder,
codeLink: baseLink('system/overlays_example.dart'),
info: OverlaysExample.description,
)
..add(
'Without FlameGame',
(_) => GameWidget(game: NoFlameGameExample()),
codeLink: baseLink('system/without_flamegame_example.dart'),
info: NoFlameGameExample.description,
)
..add(
'Step Game',
(_) => GameWidget(game: StepEngineExample()),
codeLink: baseLink('system/step_engine_game.dart'),
info: StepEngineExample.description,
);
}