pull/60/head
Erick Zanardo 4 years ago
parent 5a72159f85
commit e0cb2bb005

Before

Width:  |  Height:  |  Size: 6.3 KiB

After

Width:  |  Height:  |  Size: 6.3 KiB

@ -12,15 +12,15 @@ import 'package:pinball/game/game.dart';
const _spaceShipBits = 0x0002; const _spaceShipBits = 0x0002;
const _spaceShipSize = 20.0; const _spaceShipSize = 20.0;
/// {@template spaceship_sauce} /// {@template spaceship_saucer}
/// A [BodyComponent] for the base, or the sauce of the spaceship /// A [BodyComponent] for the base, or the saucer of the spaceship
/// {@endtemplate} /// {@endtemplate}
class SpaceshipSauce extends BodyComponent with InitialPosition { class SpaceshipSaucer extends BodyComponent with InitialPosition {
/// {@macro spaceship_sauce} /// {@macro spaceship_saucer}
SpaceshipSauce() : super(priority: 2); SpaceshipSaucer() : super(priority: 2);
/// Path for the base sprite /// Path for the base sprite
static const sauceSpritePath = 'components/spaceship/sauce.png'; static const saucerSpritePath = 'components/spaceship/saucer.png';
/// Path for the upper wall sprite /// Path for the upper wall sprite
static const upperWallPath = 'components/spaceship/upper.png'; static const upperWallPath = 'components/spaceship/upper.png';
@ -29,7 +29,7 @@ class SpaceshipSauce extends BodyComponent with InitialPosition {
Future<void> onLoad() async { Future<void> onLoad() async {
await super.onLoad(); await super.onLoad();
final sprites = await Future.wait([ final sprites = await Future.wait([
gameRef.loadSprite(sauceSpritePath), gameRef.loadSprite(saucerSpritePath),
gameRef.loadSprite(upperWallPath), gameRef.loadSprite(upperWallPath),
]); ]);
@ -227,7 +227,7 @@ class SpaceshipHole extends BodyComponent with InitialPosition {
/// {@template spaceship_wall} /// {@template spaceship_wall}
/// A [BodyComponent] that provides the collision for the wall /// A [BodyComponent] that provides the collision for the wall
/// surrounding the spaceship, with a small opening to allow the /// surrounding the spaceship, with a small opening to allow the
/// [Ball] to get inside the spaceship sauce. /// [Ball] to get inside the spaceship saucer.
/// It also contains the [SpriteComponent] for the lower wall /// It also contains the [SpriteComponent] for the lower wall
/// {@endtemplate} /// {@endtemplate}
class SpaceshipWall extends BodyComponent with InitialPosition { class SpaceshipWall extends BodyComponent with InitialPosition {

@ -10,7 +10,7 @@ extension PinballGameAssetsX on PinballGame {
images.load(SpaceshipBridge.spritePath), images.load(SpaceshipBridge.spritePath),
images.load(SpaceshipBridgeTop.spritePath), images.load(SpaceshipBridgeTop.spritePath),
images.load(SpaceshipWall.lowerWallPath), images.load(SpaceshipWall.lowerWallPath),
images.load(SpaceshipSauce.upperWallPath), images.load(SpaceshipSaucer.upperWallPath),
]); ]);
} }
} }

@ -81,7 +81,7 @@ class PinballGame extends Forge2DGame
Future<void> _addSpaceship() async { Future<void> _addSpaceship() async {
final position = Vector2(20, -24); final position = Vector2(20, -24);
unawaited(add(SpaceshipSauce()..initialPosition = position)); unawaited(add(SpaceshipSaucer()..initialPosition = position));
unawaited(add(SpaceshipEntrance()..initialPosition = position)); unawaited(add(SpaceshipEntrance()..initialPosition = position));
unawaited(add(SpaceshipBridge()..initialPosition = position)); unawaited(add(SpaceshipBridge()..initialPosition = position));
unawaited( unawaited(

Loading…
Cancel
Save