docs: Fix examples for v1.9.0 (#2757)

Fixed up some examples that needed fixing before releasing v1.9.0
This commit is contained in:
Lukas Klingsbo
2023-09-21 21:24:40 +02:00
committed by GitHub
parent f5d0cb3856
commit 152fbb61db
14 changed files with 101 additions and 92 deletions

View File

@ -204,23 +204,24 @@ class Player extends SpriteComponent
required super.position,
required super.size,
required super.priority,
}) {
Sprite.load(
'retro_tiles.png',
srcSize: Vector2.all(tileSize),
srcPosition: Vector2(tileSize * 3, tileSize),
).then((value) {
sprite = value;
});
});
add(hitbox);
}
final hitbox = RectangleHitbox();
bool canMoveLeft = true;
bool canMoveRight = true;
bool canMoveTop = true;
bool canMoveBottom = true;
final hitbox = RectangleHitbox();
@override
Future<void> onLoad() async {
sprite = await Sprite.load(
'retro_tiles.png',
srcSize: Vector2.all(tileSize),
srcPosition: Vector2(tileSize * 3, tileSize),
);
add(hitbox);
}
@override
void onCollisionStart(