refactor: applied PR suggestions

pull/282/head
alestiago 3 years ago
parent 9f998b4aa1
commit 80b7b3c92a

@ -13,7 +13,7 @@ class DinoDesert extends Component {
DinoDesert() DinoDesert()
: super( : super(
children: [ children: [
// ChromeDino()..initialPosition = Vector2(12.3, -6.9), ChromeDino()..initialPosition = Vector2(12.3, -6.9),
DinoWalls(), DinoWalls(),
Slingshots(), Slingshots(),
], ],

@ -3,7 +3,8 @@ import 'package:pinball/game/components/components.dart';
import 'package:pinball_components/pinball_components.dart' hide Assets; import 'package:pinball_components/pinball_components.dart' hide Assets;
/// {@template launcher} /// {@template launcher}
/// Section where the ball is launched from. /// Channel on the right side of the board containing the [LaunchRamp],
/// [Plunger], and [RocketSpriteComponent].
/// {@endtemplate} /// {@endtemplate}
class Launcher extends Component { class Launcher extends Component {
/// {@macro launcher} /// {@macro launcher}

@ -52,10 +52,7 @@ class PinballGame extends Forge2DGame
]; ];
final decals = [ final decals = [
GoogleWord( GoogleWord(
position: Vector2( position: Vector2(-4.1, 1.8),
BoardDimensions.bounds.center.dx - 4.1,
BoardDimensions.bounds.center.dy + 1.8,
),
), ),
Multipliers(), Multipliers(),
]; ];

@ -4,7 +4,7 @@ import 'package:pinball_components/pinball_components.dart';
import 'package:pinball_flame/pinball_flame.dart'; import 'package:pinball_flame/pinball_flame.dart';
/// {@template boundaries} /// {@template boundaries}
/// Pinball machine boundaring walls. /// Pinball machine walls.
/// {@endtemplate} /// {@endtemplate}
class Boundaries extends Component { class Boundaries extends Component {
/// {@macro boundaries} /// {@macro boundaries}

@ -6,11 +6,11 @@ import 'package:pinball_components/gen/assets.gen.dart';
import 'package:pinball_components/pinball_components.dart' hide Assets; import 'package:pinball_components/pinball_components.dart' hide Assets;
import 'package:pinball_flame/pinball_flame.dart'; import 'package:pinball_flame/pinball_flame.dart';
/// {@template dinowalls} /// {@template dino_walls}
/// Walls near the [ChromeDino]. /// Walls near the [ChromeDino].
/// {@endtemplate} /// {@endtemplate}
class DinoWalls extends Component { class DinoWalls extends Component {
/// {@macro dinowalls} /// {@macro dino_walls}
DinoWalls() DinoWalls()
: super( : super(
children: [ children: [

@ -8,7 +8,7 @@ import 'package:pinball_components/pinball_components.dart' hide Assets;
import 'package:pinball_flame/pinball_flame.dart'; import 'package:pinball_flame/pinball_flame.dart';
/// {@template spaceship_ramp} /// {@template spaceship_ramp}
/// Raamp leading into the [AndroidSpaceship]. /// Ramp leading into the [AndroidSpaceship].
/// {@endtemplate} /// {@endtemplate}
class SpaceshipRamp extends Component { class SpaceshipRamp extends Component {
/// {@macro spaceship_ramp} /// {@macro spaceship_ramp}

@ -42,15 +42,12 @@ void main() {
}); });
flameTester.testGameWidget( flameTester.testGameWidget(
'red circle rendes behind blue circle', 'red circle renders behind blue circle',
setUp: (game, tester) async { setUp: (game, tester) async {
final redSquare = _TestCircleComponent(Colors.red)..zIndex = 0;
final blueSquare = _TestCircleComponent(Colors.blue)..zIndex = 1;
final canvas = ZCanvasComponent( final canvas = ZCanvasComponent(
children: [ children: [
blueSquare, _TestCircleComponent(Colors.blue)..zIndex = 1,
redSquare, _TestCircleComponent(Colors.red)..zIndex = 0,
], ],
); );
await game.ensureAdd(canvas); await game.ensureAdd(canvas);
@ -66,15 +63,12 @@ void main() {
); );
flameTester.testGameWidget( flameTester.testGameWidget(
'blue circle rendes behind red circle', 'blue circle renders behind red circle',
setUp: (game, tester) async { setUp: (game, tester) async {
final redSquare = _TestCircleComponent(Colors.red)..zIndex = 1;
final blueSquare = _TestCircleComponent(Colors.blue)..zIndex = 0;
final canvas = ZCanvasComponent( final canvas = ZCanvasComponent(
children: [ children: [
blueSquare, _TestCircleComponent(Colors.blue)..zIndex = 0,
redSquare, _TestCircleComponent(Colors.red)..zIndex = 1
], ],
); );
await game.ensureAdd(canvas); await game.ensureAdd(canvas);

Loading…
Cancel
Save