Explorar el Código

v1.0.1: UI improvements and fixes

- Remove in-game instruction text for cleaner interface
- Format timer display as MM:SS instead of seconds only
- Fix menu overflow in landscape orientation with scrollable layout
- Update version to 1.0.1 across all files
Fszontagh hace 9 meses
padre
commit
45e7c08bc5
Se han modificado 4 ficheros con 70 adiciones y 23 borrados
  1. 11 16
      lib/game/zentap_game.dart
  2. 57 5
      lib/ui/main_menu.dart
  3. 1 1
      lib/ui/settings_screen.dart
  4. 1 1
      pubspec.yaml

+ 11 - 16
lib/game/zentap_game.dart

@@ -56,7 +56,7 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
     // Initialize timer display (only in regular mode)
     if (!isZenMode) {
       timerText = TextComponent(
-        text: 'Time: ${gameTime.toInt()}s',
+        text: 'Time: ${_formatTime(gameTime)}',
         textRenderer: TextPaint(
           style: const TextStyle(
             color: ZenColors.timerText,
@@ -102,19 +102,7 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
     );
     add(bubbleSpawner!);
     
-    // Add instruction text
-    final instructionText = TextComponent(
-      text: isZenMode ? 'Tap bubbles to relax' : 'Pop bubbles for points!',
-      textRenderer: TextPaint(
-        style: TextStyle(
-          color: ZenColors.secondaryText,
-          fontSize: 18,
-        ),
-      ),
-      position: Vector2(size.x / 2, size.y / 2 + 100),
-      anchor: Anchor.center,
-    );
-    add(instructionText);
+    // Instruction text removed for cleaner interface
     
     // Background music is now started in onLoad() after all initialization
   }
@@ -221,7 +209,14 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
   }
 
   void _updateTimer() {
-    timerText?.text = 'Time: ${gameTime.toInt()}s';
+    timerText?.text = 'Time: ${_formatTime(gameTime)}';
+  }
+
+  // Helper method to format time as MM:SS
+  String _formatTime(double seconds) {
+    final minutes = (seconds / 60).floor();
+    final remainingSeconds = (seconds % 60).floor();
+    return '${minutes.toString().padLeft(2, '0')}:${remainingSeconds.toString().padLeft(2, '0')}';
   }
 
   void _addTapEffect(Vector2 position) {
@@ -276,7 +271,7 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
         // Show timer in regular mode
         if (timerText == null) {
           timerText = TextComponent(
-            text: 'Time: ${gameTime.toInt()}s',
+            text: 'Time: ${_formatTime(gameTime)}',
             textRenderer: TextPaint(
               style: const TextStyle(
                 color: ZenColors.timerText,

+ 57 - 5
lib/ui/main_menu.dart

@@ -177,11 +177,13 @@ class _MainMenuState extends State<MainMenu> {
               
               // Menu buttons
               Expanded(
-                child: Column(
-                  mainAxisAlignment: MainAxisAlignment.center,
-                  children: [
-                    _buildMenuButtons(),
-                  ],
+                child: SingleChildScrollView(
+                  child: Column(
+                    mainAxisAlignment: MainAxisAlignment.center,
+                    children: [
+                      _buildResponsiveMenuButtons(),
+                    ],
+                  ),
                 ),
               ),
             ],
@@ -299,6 +301,56 @@ class _MainMenuState extends State<MainMenu> {
     );
   }
 
+  Widget _buildResponsiveMenuButtons() {
+    return OrientationBuilder(
+      builder: (context, orientation) {
+        final buttonSpacing = orientation == Orientation.portrait ? 20.0 : 12.0;
+        
+        return Column(
+          children: [
+            // Play Button
+            _buildMenuButton(
+              context,
+              'Play',
+              'Tap to earn Relaxation Points',
+              Icons.play_arrow,
+              () => _navigateToGame(context, false),
+            ),
+            SizedBox(height: buttonSpacing),
+            
+            // Zen Mode Button
+            _buildMenuButton(
+              context,
+              'Zen Mode',
+              'Pure relaxation, no score',
+              Icons.self_improvement,
+              () => _navigateToGame(context, true),
+            ),
+            SizedBox(height: buttonSpacing),
+            
+            // Stats Button
+            _buildMenuButton(
+              context,
+              'Statistics',
+              'View your progress and achievements',
+              Icons.analytics,
+              _openStats,
+            ),
+            SizedBox(height: buttonSpacing),
+            
+            // Exit Button
+            _buildExitButton(
+              context,
+              'Exit',
+              'Close the application',
+              Icons.exit_to_app,
+              _exitApp,
+            ),
+          ],
+        );
+      },
+    );
+  }
 
   Widget _buildMenuButton(
     BuildContext context,

+ 1 - 1
lib/ui/settings_screen.dart

@@ -135,7 +135,7 @@ class _SettingsScreenState extends State<SettingsScreen> {
                         child: Column(
                           children: [
                             Text(
-                              'ZenTap v1.0.0',
+                              'ZenTap v1.0.1',
                               style: TextStyle(
                                 color: ZenColors.mutedText,
                                 fontSize: 14,

+ 1 - 1
pubspec.yaml

@@ -16,7 +16,7 @@ publish_to: 'none' # Remove this line if you wish to publish to pub.dev
 # https://developer.apple.com/library/archive/documentation/General/Reference/InfoPlistKeyReference/Articles/CoreFoundationKeys.html
 # In Windows, build-name is used as the major, minor, and patch parts
 # of the product and file versions while build-number is used as the build suffix.
-version: 1.0.0+1
+version: 1.0.1+2
 
 environment:
   sdk: ^3.7.2