Skip to content

Commit

Permalink
docs: Make game docs runnable (#2729)
Browse files Browse the repository at this point in the history
Just fixes some docs in game.md to remove syntax errors and make it runnable.
  • Loading branch information
spydon committed Sep 11, 2023
1 parent 9fb3bf8 commit 6f188f9
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions doc/flame/game.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ A simple `FlameGame` implementation that adds two components, one in `onLoad` an
the constructor can look like this:

```dart
import 'package:flame/components.dart';
import 'package:flame/game.dart';
import 'package:flutter/widgets.dart';
/// A component that renders the crate sprite, with a 16 x 16 size.
class MyCrate extends SpriteComponent {
MyCrate() : super(size: Vector2.all(16));
Expand All @@ -32,8 +36,8 @@ class MyGame extends FlameGame {
}
}
main() {
final myGame = MyGame(children: [MyCrate]);
void main() {
final myGame = MyGame();
runApp(
GameWidget(
game: myGame,
Expand Down

0 comments on commit 6f188f9

Please sign in to comment.