update : gameover

This commit is contained in:
2025-12-04 17:22:55 +09:00
parent 37a634643e
commit 0dccab9eec
2 changed files with 74 additions and 0 deletions
+45
View File
@@ -13,6 +13,7 @@ import '../widgets/battle/character_status_card.dart';
import '../widgets/battle/battle_log_overlay.dart';
import '../widgets/battle/floating_battle_texts.dart';
import '../widgets/battle/stage_ui.dart';
import 'main_menu_screen.dart';
class BattleScreen extends StatefulWidget {
const BattleScreen({super.key});
@@ -527,6 +528,50 @@ class _BattleScreenState extends State<BattleScreen> {
..._floatingDamageTexts.map((e) => e.widget),
..._floatingEffects.map((e) => e.widget),
..._floatingFeedbackTexts.map((e) => e.widget),
// Game Over Overlay
if (battleProvider.player.isDead)
Container(
color: Colors.black87,
child: Center(
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
const Text(
"DEFEAT",
style: TextStyle(
color: Colors.red,
fontSize: 48,
fontWeight: FontWeight.bold,
letterSpacing: 4.0,
),
),
const SizedBox(height: 32),
ElevatedButton(
style: ElevatedButton.styleFrom(
backgroundColor: Colors.grey[800],
padding: const EdgeInsets.symmetric(
horizontal: 32,
vertical: 16,
),
),
onPressed: () {
Navigator.of(context).pushAndRemoveUntil(
MaterialPageRoute(
builder: (context) => const MainMenuScreen(),
),
(route) => false,
);
},
child: const Text(
"Return to Main Menu",
style: TextStyle(color: Colors.white, fontSize: 18),
),
),
],
),
),
),
],
);
},