|
@@ -56,7 +56,7 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
|
|
|
// Initialize timer display (only in regular mode)
|
|
// Initialize timer display (only in regular mode)
|
|
|
if (!isZenMode) {
|
|
if (!isZenMode) {
|
|
|
timerText = TextComponent(
|
|
timerText = TextComponent(
|
|
|
- text: 'Time: ${gameTime.toInt()}s',
|
|
|
|
|
|
|
+ text: 'Time: ${_formatTime(gameTime)}',
|
|
|
textRenderer: TextPaint(
|
|
textRenderer: TextPaint(
|
|
|
style: const TextStyle(
|
|
style: const TextStyle(
|
|
|
color: ZenColors.timerText,
|
|
color: ZenColors.timerText,
|
|
@@ -102,19 +102,7 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
|
|
|
);
|
|
);
|
|
|
add(bubbleSpawner!);
|
|
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
|
|
// Background music is now started in onLoad() after all initialization
|
|
|
}
|
|
}
|
|
@@ -221,7 +209,14 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
void _updateTimer() {
|
|
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) {
|
|
void _addTapEffect(Vector2 position) {
|
|
@@ -276,7 +271,7 @@ class ZenTapGame extends FlameGame with HasCollisionDetection {
|
|
|
// Show timer in regular mode
|
|
// Show timer in regular mode
|
|
|
if (timerText == null) {
|
|
if (timerText == null) {
|
|
|
timerText = TextComponent(
|
|
timerText = TextComponent(
|
|
|
- text: 'Time: ${gameTime.toInt()}s',
|
|
|
|
|
|
|
+ text: 'Time: ${_formatTime(gameTime)}',
|
|
|
textRenderer: TextPaint(
|
|
textRenderer: TextPaint(
|
|
|
style: const TextStyle(
|
|
style: const TextStyle(
|
|
|
color: ZenColors.timerText,
|
|
color: ZenColors.timerText,
|