refactor: changed dino walls (#208)
* refactor: changed dino walls * fix: fixed walls shapes * refactor: load dino walls assets from cache * feat: added dino walls to sandbox * test: added dino wall assets to test * test: fixed golden test * fix: pubspec from main * refactor: refactored code and fixed shapes * refactor: create fixtures * test: golden test updated * refactor: dinowalls sandbox refactorpull/237/head
Before Width: | Height: | Size: 283 KiB After Width: | Height: | Size: 270 KiB |
Before Width: | Height: | Size: 61 KiB After Width: | Height: | Size: 56 KiB |
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 28 KiB |
@ -0,0 +1,31 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:flame/input.dart';
|
||||
import 'package:pinball_components/pinball_components.dart';
|
||||
import 'package:pinball_flame/pinball_flame.dart';
|
||||
import 'package:sandbox/stories/ball/basic_ball_game.dart';
|
||||
|
||||
class DinoWallGame extends BallGame {
|
||||
DinoWallGame() : super();
|
||||
|
||||
static const description = '''
|
||||
Shows how DinoWalls are rendered.
|
||||
|
||||
- Activate the "trace" parameter to overlay the body.
|
||||
- Tap anywhere on the screen to spawn a ball into the game.
|
||||
''';
|
||||
|
||||
@override
|
||||
Future<void> onLoad() async {
|
||||
await super.onLoad();
|
||||
|
||||
await images.loadAll([
|
||||
Assets.images.dino.dinoLandTop.keyName,
|
||||
Assets.images.dino.dinoLandBottom.keyName,
|
||||
]);
|
||||
|
||||
await addFromBlueprint(DinoWalls());
|
||||
camera.followVector2(Vector2.zero());
|
||||
await traceAllBodies();
|
||||
}
|
||||
}
|
@ -0,0 +1,11 @@
|
||||
import 'package:dashbook/dashbook.dart';
|
||||
import 'package:sandbox/common/common.dart';
|
||||
import 'package:sandbox/stories/dino_wall/dino_wall_game.dart';
|
||||
|
||||
void addDinoWallStories(Dashbook dashbook) {
|
||||
dashbook.storiesOf('DinoWall').addGame(
|
||||
title: 'Traced',
|
||||
description: DinoWallGame.description,
|
||||
gameBuilder: (_) => DinoWallGame(),
|
||||
);
|
||||
}
|
Before Width: | Height: | Size: 1.0 MiB After Width: | Height: | Size: 1.0 MiB |
Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 148 KiB |