From a452e56e743b405d864089d7b9b17c1dc6fbedbf Mon Sep 17 00:00:00 2001 From: Lukas Klingsbo Date: Sun, 2 Jul 2023 14:28:15 +0200 Subject: [PATCH] fix: Readme and possibility to get back to the game (#71) Minor fixes --- README.md | 19 +++++-------------- lib/end_game/view/end_game_page.dart | 15 +++++++++------ lib/game/components/ship.dart | 1 - lib/game/view/game_page.dart | 2 +- 4 files changed, 15 insertions(+), 22 deletions(-) diff --git a/README.md b/README.md index bef00b4..5d1af8f 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,7 @@ -# lightrunners +# Lightrunners -A new Flutter project. +Lightrunners is a local multiplayer game built for FlutterCon 2023. +It is a king of the hill type of game where you are supposed to stay within the spotlight for as +long as possible, and keep other ships out of the spotlight by shooting or bumping into them. -## Getting Started - -This project is a starting point for a Flutter application. - -A few resources to get you started if this is your first Flutter project: - -- [Lab: Write your first Flutter app](https://docs.flutter.dev/get-started/codelab) -- [Cookbook: Useful Flutter samples](https://docs.flutter.dev/cookbook) - -For help getting started with Flutter development, view the -[online documentation](https://docs.flutter.dev/), which offers tutorials, -samples, guidance on mobile development, and a full API reference. +Enjoy! \ No newline at end of file diff --git a/lib/end_game/view/end_game_page.dart b/lib/end_game/view/end_game_page.dart index 4b25a2e..2b098c7 100644 --- a/lib/end_game/view/end_game_page.dart +++ b/lib/end_game/view/end_game_page.dart @@ -99,12 +99,15 @@ class EndGamePage extends StatelessWidget { ], ), OpacityBlinker( - child: Text( - 'Press any button to continue', - style: TextStyle( - fontFamily: fontFamily, - fontSize: 32, - color: GamePalette.silver, + child: TextButton( + onPressed: () => Navigator.pop(context), + child: Text( + 'Press any button to continue', + style: TextStyle( + fontFamily: fontFamily, + fontSize: 32, + color: GamePalette.silver, + ), ), ), ), diff --git a/lib/game/components/ship.dart b/lib/game/components/ship.dart index 99ccffd..705835d 100644 --- a/lib/game/components/ship.dart +++ b/lib/game/components/ship.dart @@ -120,7 +120,6 @@ class Ship extends SpriteComponent Vector2(_random.nextBool() ? 1 : -1, _random.nextBool() ? 1 : -1), ); angle = _random.nextDouble() * tau; - debugMode = true; add(RectangleHitbox()); } diff --git a/lib/game/view/game_page.dart b/lib/game/view/game_page.dart index e3cd26e..f08f0fb 100644 --- a/lib/game/view/game_page.dart +++ b/lib/game/view/game_page.dart @@ -27,7 +27,7 @@ class _GamePageState extends State { _game = LightRunnersGame( players: widget.players, onEndGame: (scores) { - Navigator.of(context).push( + Navigator.of(context).pushReplacement( EndGamePage.route(scores), ); },