Merge branch 'main' into refactor/sparky-computer

pull/365/head
Allison Ryan 3 years ago committed by GitHub
commit 6a08fd1f5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -11,6 +11,6 @@ jobs:
uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1 uses: VeryGoodOpenSource/very_good_workflows/.github/workflows/flutter_package.yml@v1
with: with:
flutter_channel: stable flutter_channel: stable
flutter_version: 2.10.0 flutter_version: 2.10.5
coverage_excludes: "lib/gen/*.dart" coverage_excludes: "lib/gen/*.dart"
test_optimization: false test_optimization: false

@ -39,6 +39,7 @@ class App extends StatelessWidget {
providers: [ providers: [
BlocProvider(create: (_) => CharacterThemeCubit()), BlocProvider(create: (_) => CharacterThemeCubit()),
BlocProvider(create: (_) => StartGameBloc()), BlocProvider(create: (_) => StartGameBloc()),
BlocProvider(create: (_) => GameBloc()),
], ],
child: MaterialApp( child: MaterialApp(
title: 'I/O Pinball', title: 'I/O Pinball',

@ -23,15 +23,9 @@ class PinballGamePage extends StatelessWidget {
final bool isDebugMode; final bool isDebugMode;
static Route route({ static Route route({bool isDebugMode = kDebugMode}) {
bool isDebugMode = kDebugMode,
}) {
return MaterialPageRoute<void>( return MaterialPageRoute<void>(
builder: (context) { builder: (_) => PinballGamePage(isDebugMode: isDebugMode),
return PinballGamePage(
isDebugMode: isDebugMode,
);
},
); );
} }
@ -41,11 +35,6 @@ class PinballGamePage extends StatelessWidget {
context.read<CharacterThemeCubit>().state.characterTheme; context.read<CharacterThemeCubit>().state.characterTheme;
final player = context.read<PinballPlayer>(); final player = context.read<PinballPlayer>();
final leaderboardRepository = context.read<LeaderboardRepository>(); final leaderboardRepository = context.read<LeaderboardRepository>();
return BlocProvider(
create: (_) => GameBloc(),
child: Builder(
builder: (context) {
final gameBloc = context.read<GameBloc>(); final gameBloc = context.read<GameBloc>();
final game = isDebugMode final game = isDebugMode
? DebugPinballGame( ? DebugPinballGame(
@ -74,9 +63,6 @@ class PinballGamePage extends StatelessWidget {
create: (_) => AssetsManagerCubit(loadables)..load(), create: (_) => AssetsManagerCubit(loadables)..load(),
child: PinballGameView(game: game), child: PinballGameView(game: game),
); );
},
),
);
} }
} }

@ -61,13 +61,13 @@ class ChromeDino extends BodyComponent
List<FixtureDef> _createFixtureDefs() { List<FixtureDef> _createFixtureDefs() {
const mouthAngle = -(halfSweepingAngle + 0.28); const mouthAngle = -(halfSweepingAngle + 0.28);
final size = Vector2(5.5, 6); final size = Vector2(6, 6);
final topEdge = PolygonShape() final topEdge = PolygonShape()
..setAsBox( ..setAsBox(
size.x / 2, size.x / 2,
0.1, 0.1,
initialPosition + Vector2(-4.2, -1.4), initialPosition + Vector2(-4, -1.4),
mouthAngle, mouthAngle,
); );
final topEdgeFixtureDef = FixtureDef(topEdge, density: 100); final topEdgeFixtureDef = FixtureDef(topEdge, density: 100);
@ -76,7 +76,7 @@ class ChromeDino extends BodyComponent
..setAsBox( ..setAsBox(
0.1, 0.1,
size.y / 2, size.y / 2,
initialPosition + Vector2(-1.3, 0.5), initialPosition + Vector2(-1, 0.5),
-halfSweepingAngle, -halfSweepingAngle,
); );
final backEdgeFixtureDef = FixtureDef(backEdge, density: 100); final backEdgeFixtureDef = FixtureDef(backEdge, density: 100);
@ -85,7 +85,7 @@ class ChromeDino extends BodyComponent
..setAsBox( ..setAsBox(
size.x / 2, size.x / 2,
0.1, 0.1,
initialPosition + Vector2(-3.5, 4.7), initialPosition + Vector2(-3.3, 4.7),
mouthAngle, mouthAngle,
); );
final bottomEdgeFixtureDef = FixtureDef( final bottomEdgeFixtureDef = FixtureDef(
@ -110,7 +110,7 @@ class ChromeDino extends BodyComponent
..setAsBox( ..setAsBox(
0.2, 0.2,
0.2, 0.2,
initialPosition + Vector2(-3.5, 1.5), initialPosition + Vector2(-3, 1.5),
0, 0,
); );
final insideSensorFixtureDef = FixtureDef( final insideSensorFixtureDef = FixtureDef(

Binary file not shown.

Before

Width:  |  Height:  |  Size: 154 KiB

After

Width:  |  Height:  |  Size: 154 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 126 KiB

After

Width:  |  Height:  |  Size: 126 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 97 KiB

After

Width:  |  Height:  |  Size: 95 KiB

@ -821,4 +821,4 @@ packages:
version: "3.1.0" version: "3.1.0"
sdks: sdks:
dart: ">=2.16.0 <3.0.0" dart: ">=2.16.0 <3.0.0"
flutter: ">=2.10.0" flutter: ">=2.10.5"

@ -5,6 +5,7 @@ publish_to: none
environment: environment:
sdk: ">=2.16.0 <3.0.0" sdk: ">=2.16.0 <3.0.0"
flutter: 2.10.5
dependencies: dependencies:
authentication_repository: authentication_repository:

@ -84,6 +84,7 @@ void main() {
await tester.pumpApp( await tester.pumpApp(
PinballGamePage(), PinballGamePage(),
characterThemeCubit: characterThemeCubit, characterThemeCubit: characterThemeCubit,
gameBloc: gameBloc,
); );
expect(find.byType(PinballGameView), findsOneWidget); expect(find.byType(PinballGameView), findsOneWidget);
@ -172,6 +173,7 @@ void main() {
), ),
), ),
characterThemeCubit: characterThemeCubit, characterThemeCubit: characterThemeCubit,
gameBloc: gameBloc,
); );
await tester.tap(find.text('Tap me')); await tester.tap(find.text('Tap me'));

Loading…
Cancel
Save