chore: add animatronic to spaceship sandbox

pull/298/head
Allison Ryan 3 years ago
parent 97e4189717
commit 9dce9949cd

@ -157,7 +157,10 @@ class _LightBeamSpriteComponent extends SpriteComponent
class AndroidSpaceshipEntrance extends BodyComponent class AndroidSpaceshipEntrance extends BodyComponent
with ParentIsA<AndroidSpaceship>, Layered { with ParentIsA<AndroidSpaceship>, Layered {
AndroidSpaceshipEntrance({Iterable<Component>? children}) AndroidSpaceshipEntrance({Iterable<Component>? children})
: super(children: children) { : super(
children: children,
renderBody: false,
) {
layer = Layer.spaceship; layer = Layer.spaceship;
} }

@ -17,7 +17,7 @@ class AndroidSpaceshipGame extends BallGame {
); );
static const description = ''' static const description = '''
Shows how the AndroidSpaceship is rendered. Shows how the AndroidSpaceship and AndroidAnimatronic are rendered.
- Activate the "trace" parameter to overlay the body. - Activate the "trace" parameter to overlay the body.
- Tap anywhere on the screen to spawn a Ball into the game. - Tap anywhere on the screen to spawn a Ball into the game.
@ -28,8 +28,11 @@ class AndroidSpaceshipGame extends BallGame {
await super.onLoad(); await super.onLoad();
camera.followVector2(Vector2.zero()); camera.followVector2(Vector2.zero());
await add( await addAll(
AndroidSpaceship(position: Vector2.zero()), [
AndroidSpaceship(position: Vector2.zero()),
AndroidAnimatronic(),
],
); );
await traceAllBodies(); await traceAllBodies();

Loading…
Cancel
Save