feat: updated dino walls and bottom wall (#203)

* feat: updated dino walls with coloured assets and fixed shapes and tests

* refactor: priorities for top wall

* refactor: added bottom wall coloured asset and fixed position and priority with dino bottom wall

* chore: added TODO comments for priority future refactors

* test: golden tests for dino and bottom walls

* refactor: bottom boundary render body

* fix: moved up boundary bottom to avoid line separation between dino bottom wall
pull/211/head
Rui Miguel Alonso 3 years ago committed by GitHub
parent 2d076cceca
commit e4ab7c35d1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 283 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

After

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 16 KiB

After

Width:  |  Height:  |  Size: 34 KiB

@ -57,6 +57,8 @@ class $AssetsImagesBackboardGen {
/// File path: assets/images/backboard/backboard_scores.png /// File path: assets/images/backboard/backboard_scores.png
AssetGenImage get backboardScores => AssetGenImage get backboardScores =>
const AssetGenImage('assets/images/backboard/backboard_scores.png'); const AssetGenImage('assets/images/backboard/backboard_scores.png');
/// File path: assets/images/backboard/display.png
AssetGenImage get display => AssetGenImage get display =>
const AssetGenImage('assets/images/backboard/display.png'); const AssetGenImage('assets/images/backboard/display.png');
} }
@ -309,8 +311,11 @@ class $AssetsImagesSparkyBumperGen {
class $AssetsImagesSparkyComputerGen { class $AssetsImagesSparkyComputerGen {
const $AssetsImagesSparkyComputerGen(); const $AssetsImagesSparkyComputerGen();
/// File path: assets/images/sparky/computer/base.png
AssetGenImage get base => AssetGenImage get base =>
const AssetGenImage('assets/images/sparky/computer/base.png'); const AssetGenImage('assets/images/sparky/computer/base.png');
/// File path: assets/images/sparky/computer/top.png
AssetGenImage get top => AssetGenImage get top =>
const AssetGenImage('assets/images/sparky/computer/top.png'); const AssetGenImage('assets/images/sparky/computer/top.png');
} }
@ -354,8 +359,11 @@ class $AssetsImagesDashBumperMainGen {
class $AssetsImagesSparkyBumperAGen { class $AssetsImagesSparkyBumperAGen {
const $AssetsImagesSparkyBumperAGen(); const $AssetsImagesSparkyBumperAGen();
/// File path: assets/images/sparky/bumper/a/active.png
AssetGenImage get active => AssetGenImage get active =>
const AssetGenImage('assets/images/sparky/bumper/a/active.png'); const AssetGenImage('assets/images/sparky/bumper/a/active.png');
/// File path: assets/images/sparky/bumper/a/inactive.png
AssetGenImage get inactive => AssetGenImage get inactive =>
const AssetGenImage('assets/images/sparky/bumper/a/inactive.png'); const AssetGenImage('assets/images/sparky/bumper/a/inactive.png');
} }
@ -363,8 +371,11 @@ class $AssetsImagesSparkyBumperAGen {
class $AssetsImagesSparkyBumperBGen { class $AssetsImagesSparkyBumperBGen {
const $AssetsImagesSparkyBumperBGen(); const $AssetsImagesSparkyBumperBGen();
/// File path: assets/images/sparky/bumper/b/active.png
AssetGenImage get active => AssetGenImage get active =>
const AssetGenImage('assets/images/sparky/bumper/b/active.png'); const AssetGenImage('assets/images/sparky/bumper/b/active.png');
/// File path: assets/images/sparky/bumper/b/inactive.png
AssetGenImage get inactive => AssetGenImage get inactive =>
const AssetGenImage('assets/images/sparky/bumper/b/inactive.png'); const AssetGenImage('assets/images/sparky/bumper/b/inactive.png');
} }
@ -372,8 +383,11 @@ class $AssetsImagesSparkyBumperBGen {
class $AssetsImagesSparkyBumperCGen { class $AssetsImagesSparkyBumperCGen {
const $AssetsImagesSparkyBumperCGen(); const $AssetsImagesSparkyBumperCGen();
/// File path: assets/images/sparky/bumper/c/active.png
AssetGenImage get active => AssetGenImage get active =>
const AssetGenImage('assets/images/sparky/bumper/c/active.png'); const AssetGenImage('assets/images/sparky/bumper/c/active.png');
/// File path: assets/images/sparky/bumper/c/inactive.png
AssetGenImage get inactive => AssetGenImage get inactive =>
const AssetGenImage('assets/images/sparky/bumper/c/inactive.png'); const AssetGenImage('assets/images/sparky/bumper/c/inactive.png');
} }

@ -26,7 +26,8 @@ class _BottomBoundary extends BodyComponent with InitialPosition {
/// {@macro bottom_boundary} /// {@macro bottom_boundary}
_BottomBoundary() _BottomBoundary()
: super( : super(
priority: 1, // TODO(ruimiguel): set final priority when RenderPriority PR merged.
priority: Ball.boardPriority + 2,
children: [_BottomBoundarySpriteComponent()], children: [_BottomBoundarySpriteComponent()],
) { ) {
renderBody = false; renderBody = false;
@ -78,7 +79,7 @@ class _BottomBoundarySpriteComponent extends SpriteComponent with HasGameRef {
this.sprite = sprite; this.sprite = sprite;
size = sprite.originalSize / 10; size = sprite.originalSize / 10;
anchor = Anchor.center; anchor = Anchor.center;
position = Vector2(-5.4, 55.8); position = Vector2(-5.4, 55.6);
} }
} }

@ -31,7 +31,8 @@ class _DinoTopWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall} ///{@macro dino_top_wall}
_DinoTopWall() _DinoTopWall()
: super( : super(
priority: 1, // TODO(ruimiguel): set final priority when RenderPriority PR merged.
priority: Ball.boardPriority + 1,
children: [_DinoTopWallSpriteComponent()], children: [_DinoTopWallSpriteComponent()],
) { ) {
renderBody = false; renderBody = false;
@ -42,7 +43,7 @@ class _DinoTopWall extends BodyComponent with InitialPosition {
final topStraightShape = EdgeShape() final topStraightShape = EdgeShape()
..set( ..set(
Vector2(28.4, -35.1), Vector2(28.65, -35.1),
Vector2(29.5, -35.1), Vector2(29.5, -35.1),
); );
final topStraightFixtureDef = FixtureDef(topStraightShape); final topStraightFixtureDef = FixtureDef(topStraightShape);
@ -69,8 +70,8 @@ class _DinoTopWall extends BodyComponent with InitialPosition {
final bottomCurveShape = BezierCurveShape( final bottomCurveShape = BezierCurveShape(
controlPoints: [ controlPoints: [
middleCurveShape.vertices.last, middleCurveShape.vertices.last,
Vector2(21.15, -16), Vector2(21.5, -15.8),
Vector2(25.6, -15.2), Vector2(25.8, -14.8),
], ],
); );
fixturesDef.add(FixtureDef(bottomCurveShape)); fixturesDef.add(FixtureDef(bottomCurveShape));
@ -126,6 +127,8 @@ class _DinoBottomWall extends BodyComponent with InitialPosition {
///{@macro dino_top_wall} ///{@macro dino_top_wall}
_DinoBottomWall() _DinoBottomWall()
: super( : super(
// TODO(ruimiguel): set final priority when RenderPriority PR merged.
priority: Ball.boardPriority + 1,
children: [_DinoBottomWallSpriteComponent()], children: [_DinoBottomWallSpriteComponent()],
) { ) {
renderBody = false; renderBody = false;
@ -136,7 +139,7 @@ class _DinoBottomWall extends BodyComponent with InitialPosition {
const restitution = 1.0; const restitution = 1.0;
final topStraightControlPoints = [ final topStraightControlPoints = [
Vector2(32.4, -8.3), Vector2(32.4, -8.8),
Vector2(25, -7.7), Vector2(25, -7.7),
]; ];
final topStraightShape = EdgeShape() final topStraightShape = EdgeShape()
@ -220,6 +223,6 @@ class _DinoBottomWallSpriteComponent extends SpriteComponent with HasGameRef {
); );
this.sprite = sprite; this.sprite = sprite;
size = sprite.originalSize / 10; size = sprite.originalSize / 10;
position = Vector2(23.8, -9.5); position = Vector2(23.6, -9.5);
} }
} }

Binary file not shown.

Before

Width:  |  Height:  |  Size: 153 KiB

After

Width:  |  Height:  |  Size: 466 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 38 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 44 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 63 KiB

After

Width:  |  Height:  |  Size: 166 KiB

Loading…
Cancel
Save