diff --git a/assets/images/up/green/idle/Idle_1.png b/assets/images/up/green/idle/Idle_1.png index d1383b1..3407b30 100644 Binary files a/assets/images/up/green/idle/Idle_1.png and b/assets/images/up/green/idle/Idle_1.png differ diff --git a/assets/images/up/green/idle/Idle_10.png b/assets/images/up/green/idle/Idle_10.png index ca3465c..ea618d3 100644 Binary files a/assets/images/up/green/idle/Idle_10.png and b/assets/images/up/green/idle/Idle_10.png differ diff --git a/assets/images/up/green/idle/Idle_2.png b/assets/images/up/green/idle/Idle_2.png index b5c749c..17f1677 100644 Binary files a/assets/images/up/green/idle/Idle_2.png and b/assets/images/up/green/idle/Idle_2.png differ diff --git a/assets/images/up/green/idle/Idle_3.png b/assets/images/up/green/idle/Idle_3.png index 6f21e1d..d1e5944 100644 Binary files a/assets/images/up/green/idle/Idle_3.png and b/assets/images/up/green/idle/Idle_3.png differ diff --git a/assets/images/up/green/idle/Idle_4.png b/assets/images/up/green/idle/Idle_4.png index f526408..f2c62ad 100644 Binary files a/assets/images/up/green/idle/Idle_4.png and b/assets/images/up/green/idle/Idle_4.png differ diff --git a/assets/images/up/green/idle/Idle_5.png b/assets/images/up/green/idle/Idle_5.png index 6102c3f..1f86c0b 100644 Binary files a/assets/images/up/green/idle/Idle_5.png and b/assets/images/up/green/idle/Idle_5.png differ diff --git a/assets/images/up/green/idle/Idle_6.png b/assets/images/up/green/idle/Idle_6.png index 4d09565..8ad13a0 100644 Binary files a/assets/images/up/green/idle/Idle_6.png and b/assets/images/up/green/idle/Idle_6.png differ diff --git a/assets/images/up/green/idle/Idle_7.png b/assets/images/up/green/idle/Idle_7.png index 5cbd39f..65f8b86 100644 Binary files a/assets/images/up/green/idle/Idle_7.png and b/assets/images/up/green/idle/Idle_7.png differ diff --git a/assets/images/up/green/idle/Idle_8.png b/assets/images/up/green/idle/Idle_8.png index 8c455af..66499de 100644 Binary files a/assets/images/up/green/idle/Idle_8.png and b/assets/images/up/green/idle/Idle_8.png differ diff --git a/assets/images/up/green/idle/Idle_9.png b/assets/images/up/green/idle/Idle_9.png index 268bc4e..41759d8 100644 Binary files a/assets/images/up/green/idle/Idle_9.png and b/assets/images/up/green/idle/Idle_9.png differ diff --git a/assets/images/up/green/walk/Walk_1.png b/assets/images/up/green/walk/Walk_1.png index f637e6f..f80f52f 100644 Binary files a/assets/images/up/green/walk/Walk_1.png and b/assets/images/up/green/walk/Walk_1.png differ diff --git a/assets/images/up/green/walk/Walk_10.png b/assets/images/up/green/walk/Walk_10.png index 9b56864..5444de1 100644 Binary files a/assets/images/up/green/walk/Walk_10.png and b/assets/images/up/green/walk/Walk_10.png differ diff --git a/assets/images/up/green/walk/Walk_2.png b/assets/images/up/green/walk/Walk_2.png index 152e365..2d465e8 100644 Binary files a/assets/images/up/green/walk/Walk_2.png and b/assets/images/up/green/walk/Walk_2.png differ diff --git a/assets/images/up/green/walk/Walk_3.png b/assets/images/up/green/walk/Walk_3.png index af41b3b..0e0de54 100644 Binary files a/assets/images/up/green/walk/Walk_3.png and b/assets/images/up/green/walk/Walk_3.png differ diff --git a/assets/images/up/green/walk/Walk_4.png b/assets/images/up/green/walk/Walk_4.png index c4e4fe3..8d91bc0 100644 Binary files a/assets/images/up/green/walk/Walk_4.png and b/assets/images/up/green/walk/Walk_4.png differ diff --git a/assets/images/up/green/walk/Walk_5.png b/assets/images/up/green/walk/Walk_5.png index 7c5b9d4..4b46d84 100644 Binary files a/assets/images/up/green/walk/Walk_5.png and b/assets/images/up/green/walk/Walk_5.png differ diff --git a/assets/images/up/green/walk/Walk_6.png b/assets/images/up/green/walk/Walk_6.png index 66faa9c..f4ee86a 100644 Binary files a/assets/images/up/green/walk/Walk_6.png and b/assets/images/up/green/walk/Walk_6.png differ diff --git a/assets/images/up/green/walk/Walk_7.png b/assets/images/up/green/walk/Walk_7.png index 2e0630b..805d50a 100644 Binary files a/assets/images/up/green/walk/Walk_7.png and b/assets/images/up/green/walk/Walk_7.png differ diff --git a/assets/images/up/green/walk/Walk_8.png b/assets/images/up/green/walk/Walk_8.png index 94d279e..c16c547 100644 Binary files a/assets/images/up/green/walk/Walk_8.png and b/assets/images/up/green/walk/Walk_8.png differ diff --git a/assets/images/up/green/walk/Walk_9.png b/assets/images/up/green/walk/Walk_9.png index c83b867..ff4d79e 100644 Binary files a/assets/images/up/green/walk/Walk_9.png and b/assets/images/up/green/walk/Walk_9.png differ diff --git a/lib/pages/mini-games/up/down.dart b/lib/pages/mini-games/up/down.dart index 00cd748..1821cb2 100644 --- a/lib/pages/mini-games/up/down.dart +++ b/lib/pages/mini-games/up/down.dart @@ -22,13 +22,9 @@ import 'package:solana/anchor.dart' as solana_anchor; import 'package:solana/encoder.dart' as solana_encoder; import 'package:solana_common/utils/buffer.dart' as solana_buffer; -final screenSize = Vector2(720, 1280); - -// Scaled viewport size -final worldSize = Vector2(7.2, 12.8); - class DownGame extends Forge2DGame with TapDetector { final void Function(String) endGameCallback; + // setup the game camera to match the device size DownGame(this.endGameCallback) : super(zoom: 100, gravity: Vector2(0, 15)); @@ -138,10 +134,15 @@ class DownGame extends Forge2DGame with TapDetector { @override Future onLoad() async { + final screenSize = Vector2(size.x, size.y); + + // Scaled viewport size + final worldSize = Vector2(7.2, 12.8); + await super.onLoad(); final camera = - CameraComponent.withFixedResolution(width: 720, height: 1280); + CameraComponent.withFixedResolution(width: size.x, height: size.y); final background = _Background(size: screenSize); camera.viewport.add(background); if (dino.isLoaded) { @@ -286,6 +287,7 @@ class _GameWidgetDownState extends State { ), body: Container( height: MediaQuery.of(context).size.height, + width: MediaQuery.of(context).size.width, decoration: const BoxDecoration( image: DecorationImage( image: AssetImage("assets/images/up/maps/01/up_map_1.jpeg"), @@ -313,7 +315,7 @@ class _GameWidgetDownState extends State { builder: (BuildContext context) => AlertDialog( title: const Text('Welcome to Down'), content: const Text( - "The aim of this minigame is avoid all boxes that come from up, while you avoid more boxes you will have great score, good luck and ... \n\n¡Watch out with the boxes! \n\nREMEMBER: you could save your score on the blockchain but you'll need at least 0.5 SOL in your wallet balance"), + "The goal for this minigame is to avoid the boxes coming from above. The more boxes you avoid, the greater your score!\n\nWatch out for the boxes! \n\nREMEMBER: You can save your score on the blockchain but you'll need at least 0.5 SOL in your wallet balance"), actions: [ TextButton( onPressed: () { @@ -342,9 +344,9 @@ class _GameWidgetDownState extends State { barrierDismissible: false, context: context, builder: (BuildContext context) => AlertDialog( - title: const Text('Ups ... game ended :('), + title: const Text('Oops ... game over :('), content: Text( - "Thanks for play! Congrats you score was: $score \n\nDo you want to save and share it in Ranking? Remember this has a cost so you must have at least 0.5 SOL in your wallet balance."), + "Thanks for playing! Congrats you score was: $score \n\nDo you want to save and share it in Ranking? Remember this has a cost so you must have at least 0.5 SOL in your wallet balance."), actions: [ TextButton( onPressed: () { @@ -356,7 +358,7 @@ class _GameWidgetDownState extends State { TextButton( onPressed: () { Navigator.pop(context); - saveScore(int.parse(score)); + showConfirmSendMessage(int.parse(score)); }, child: const Text("Send my score"), ), @@ -365,6 +367,34 @@ class _GameWidgetDownState extends State { ); } + showConfirmSendMessage(int score) { + showDialog( + barrierDismissible: false, + context: context, + builder: (BuildContext context) => AlertDialog( + title: const Text('Rewrite your score'), + content: const Text( + "Are you sure rewrite your last score with this new one?\n\nCAUTION: You can't reverse this transaction and you'll lost your before score."), + actions: [ + TextButton( + onPressed: () { + Navigator.pop(context); + showWelcome(); + }, + child: const Text('Play again'), + ), + TextButton( + onPressed: () { + Navigator.pop(context); + saveScore(score); + }, + child: const Text("Confirm"), + ), + ], + ), + ); + } + showrResultMessage(String transaction) { showDialog( barrierDismissible: false, diff --git a/lib/pages/mini-games/up/objects/dino.dart b/lib/pages/mini-games/up/objects/dino.dart index c02444e..2fe02c7 100644 --- a/lib/pages/mini-games/up/objects/dino.dart +++ b/lib/pages/mini-games/up/objects/dino.dart @@ -10,7 +10,7 @@ enum DinoState { } class Dino extends BodyComponent with KeyboardHandler { - final _size = Vector2(1.70, 2.4); + final _size = Vector2(1.2, 2.4); // componentPosition is the position of the dino in the screen final _componentPosition = Vector2(0, 0); DinoState state = DinoState.idle; diff --git a/lib/pages/ranking/ranking.dart b/lib/pages/ranking/ranking.dart index ee10f06..1f4660e 100644 --- a/lib/pages/ranking/ranking.dart +++ b/lib/pages/ranking/ranking.dart @@ -103,7 +103,7 @@ class _RankingScreenState extends State { ), ), title: Text( - '${item.dinoPubkey.substring(0, 5)}...${item.dinoPubkey.substring(item.dinoPubkey.length - 5, item.dinoPubkey.length)}', + '${item.playerPubkey.substring(0, 5)}...${item.playerPubkey.substring(item.playerPubkey.length - 5, item.playerPubkey.length)}', style: const TextStyle( fontWeight: FontWeight.bold, color: Colors.black)), diff --git a/pubspec.yaml b/pubspec.yaml index 611603b..33c60ab 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: dinogrow description: 2D blockchain game about growing dinosaurs. -version: 1.0.0+3 +version: 1.0.1+4 environment: sdk: ">=3.0.2 <4.0.0"