feat: updated final rocket asset

pull/255/head
RuiAlonso 3 years ago
parent 45cd89face
commit 24386fb882

Binary file not shown.

Before

Width:  |  Height:  |  Size: 26 KiB

After

Width:  |  Height:  |  Size: 37 KiB

@ -252,8 +252,10 @@ class $AssetsImagesSpaceshipGen {
class $AssetsImagesSparkyGen {
const $AssetsImagesSparkyGen();
/// File path: assets/images/sparky/animatronic.png
AssetGenImage get animatronic =>
const AssetGenImage('assets/images/sparky/animatronic.png');
$AssetsImagesSparkyBumperGen get bumper =>
const $AssetsImagesSparkyBumperGen();
$AssetsImagesSparkyComputerGen get computer =>

@ -9,16 +9,21 @@ class RocketSpriteComponent extends SpriteComponent with HasGameRef {
// TODO(ruimiguel): change this priority to be over launcher ramp and bottom
// wall.
/// {@macro rocket_sprite_component}
RocketSpriteComponent() : super(priority: RenderPriority.rocket);
RocketSpriteComponent()
: super(
priority: RenderPriority.rocket,
anchor: Anchor.center,
);
@override
Future<void> onLoad() async {
await super.onLoad();
final sprite = await gameRef.loadSprite(
Assets.images.plunger.rocket.keyName,
final sprite = Sprite(
gameRef.images.fromCache(
Assets.images.plunger.rocket.keyName,
),
);
this.sprite = sprite;
size = sprite.originalSize / 10;
anchor = Anchor.center;
}
}

Binary file not shown.

Before

Width:  |  Height:  |  Size: 57 KiB

After

Width:  |  Height:  |  Size: 82 KiB

@ -8,14 +8,23 @@ import 'package:pinball_components/pinball_components.dart';
import '../../helpers/helpers.dart';
void main() {
group('RocketSpriteComponent', () {
final tester = FlameTester(TestGame.new);
TestWidgetsFlutterBinding.ensureInitialized();
final assets = [
Assets.images.plunger.rocket.keyName,
];
final flameTester = FlameTester(() => TestGame(assets));
tester.testGameWidget(
group('RocketSpriteComponent', () {
flameTester.testGameWidget(
'renders correctly',
setUp: (game, tester) async {
game.camera.followVector2(Vector2.zero());
await game.images.loadAll(assets);
await game.ensureAdd(RocketSpriteComponent());
game.camera.followVector2(Vector2.zero());
game.camera.zoom = 8;
await tester.pump();
},
verify: (game, tester) async {
await expectLater(

Loading…
Cancel
Save