diff --git a/lib/.DS_Store b/lib/.DS_Store index da3115c..2ee2897 100644 Binary files a/lib/.DS_Store and b/lib/.DS_Store differ diff --git a/lib/ui/game/game_screen.dart b/lib/ui/game/game_screen.dart index 991cc87..8b93296 100644 --- a/lib/ui/game/game_screen.dart +++ b/lib/ui/game/game_screen.dart @@ -291,7 +291,7 @@ class _GameScreenState extends State with TickerProviderStateMixin { String? bgImage; if (themeType == AppThemeType.wood) bgImage = 'assets/images/wood_bg.jpg'; - if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; + if (themeType == AppThemeType.doodle) bgImage = 'assets/images/doodle_bg.jpg'; // Questo รจ lo sfondo carta if (themeType == AppThemeType.cyberpunk) bgImage = 'assets/images/cyber_bg.jpg'; if (themeType == AppThemeType.music) bgImage = 'assets/images/music_bg.jpg'; @@ -342,7 +342,6 @@ class _GameScreenState extends State with TickerProviderStateMixin { child: Stack( children: [ // --- IL VERO SFONDO SFOCATO SAGOMATO --- - // Ritaglia il filtro di sfocatura esattamente sulla forma dell'arena if (themeType == AppThemeType.music) Positioned.fill( child: ClipPath( @@ -350,7 +349,7 @@ class _GameScreenState extends State with TickerProviderStateMixin { child: BackdropFilter( filter: ImageFilter.blur(sigmaX: 8.0, sigmaY: 8.0), child: Container( - color: Colors.white.withOpacity(0.08), // La patina chiara + color: Colors.white.withOpacity(0.08), ), ), ), @@ -430,56 +429,77 @@ class _GameScreenState extends State with TickerProviderStateMixin { canPop: true, onPopInvoked: (didPop) { gameController.disconnectOnlineGame(); }, child: Scaffold( - backgroundColor: bgImage != null ? Colors.transparent : theme.background, - body: Container( - decoration: bgImage != null ? BoxDecoration(image: DecorationImage(image: AssetImage(bgImage), fit: BoxFit.cover, colorFilter: themeType == AppThemeType.doodle ? ColorFilter.mode(Colors.white.withOpacity(0.7), BlendMode.lighten) : null)) : null, - child: CustomPaint( - painter: themeType == AppThemeType.doodle ? FullScreenGridPainter(Colors.black.withOpacity(0.06)) : null, - child: Stack( - children: [ - if (bgImage != null && (themeType == AppThemeType.cyberpunk || themeType == AppThemeType.music)) - Positioned.fill( - child: Container( - decoration: BoxDecoration( - gradient: LinearGradient( - begin: Alignment.topCenter, end: Alignment.bottomCenter, - colors: [Colors.black.withOpacity(0.3), Colors.black.withOpacity(0.8)] - ) + backgroundColor: Colors.transparent, // Assicuriamo che la scaffold base sia trasparente + body: Stack( + children: [ + // 1. Sfondo base a tinta unita (In caso non ci sia l'immagine) + Container(color: themeType == AppThemeType.doodle ? Colors.white : theme.background), + + // 2. Immagine di Sfondo per tutti i temi che la supportano + if (bgImage != null) + Positioned.fill( + child: Image.asset( + bgImage, + fit: BoxFit.cover, + alignment: Alignment.center, + ), + ), + + // 3. Griglia a righe incrociate per il doodle (Sopra l'immagine di carta) + if (themeType == AppThemeType.doodle) + Positioned.fill( + child: CustomPaint( + painter: FullScreenGridPainter(Colors.blue.withOpacity(0.15)), + ), + ), + + // 4. Patina scura (Cyberpunk e Music) per far risaltare il neon + if (bgImage != null && (themeType == AppThemeType.cyberpunk || themeType == AppThemeType.music)) + Positioned.fill( + child: Container( + decoration: BoxDecoration( + gradient: LinearGradient( + begin: Alignment.topCenter, end: Alignment.bottomCenter, + colors: [Colors.black.withOpacity(0.4), Colors.black.withOpacity(0.8)] + ) + ), + ), + ), + + // 5. Effetto "Furia" o Timeout + if (gameController.isTimeMode && !gameController.isCPUThinking && !gameController.isGameOver && gameController.timeLeft > 0 && gameController.timeLeft <= 5 && !gameController.isSetupPhase) + Positioned.fill(child: BlitzBackgroundEffect(timeLeft: gameController.timeLeft, color: theme.playerRed, themeType: themeType)), + + // 6. Testo degli Eventi + if (gameController.effectText.isNotEmpty) + Positioned.fill(child: SpecialEventBackgroundEffect(text: gameController.effectText, color: gameController.effectColor, themeType: themeType)), + + // 7. Il Gioco Vero e Proprio + Positioned.fill(child: gameContent), + + // 8. Schermata Passaggio Dispositivo + if (gameController.isSetupPhase && !_hideJokerMessage) + Positioned.fill( + child: Container( + color: themeType == AppThemeType.cyberpunk || themeType == AppThemeType.arcade || themeType == AppThemeType.music + ? Colors.black.withOpacity(0.98) + : theme.background.withOpacity(0.98), + child: Center( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 30.0), + child: GestureDetector( + onTap: () { setState(() { _hideJokerMessage = true; }); }, + child: Material(color: Colors.transparent, child: _buildThemedJokerMessage(theme, themeType, gameController)), ), ), ), + ), + ), - if (gameController.isTimeMode && !gameController.isCPUThinking && !gameController.isGameOver && gameController.timeLeft > 0 && gameController.timeLeft <= 5 && !gameController.isSetupPhase) - Positioned.fill(child: BlitzBackgroundEffect(timeLeft: gameController.timeLeft, color: theme.playerRed, themeType: themeType)), - - if (gameController.effectText.isNotEmpty) - Positioned.fill(child: SpecialEventBackgroundEffect(text: gameController.effectText, color: gameController.effectColor, themeType: themeType)), - - Positioned.fill(child: gameContent), - - if (gameController.isSetupPhase && !_hideJokerMessage) - Positioned.fill( - child: Container( - color: themeType == AppThemeType.cyberpunk || themeType == AppThemeType.arcade || themeType == AppThemeType.music - ? Colors.black.withOpacity(0.98) - : theme.background.withOpacity(0.98), - child: Center( - child: Padding( - padding: const EdgeInsets.symmetric(horizontal: 30.0), - child: GestureDetector( - onTap: () { setState(() { _hideJokerMessage = true; }); }, - child: Material(color: Colors.transparent, child: _buildThemedJokerMessage(theme, themeType, gameController)), - ), - ), - ), - ), - ), - - if (gameController.isGameOver && gameController.board.scoreRed != gameController.board.scoreBlue) - Positioned.fill(child: IgnorePointer(child: WinnerVFXOverlay(winnerColor: gameController.board.scoreRed > gameController.board.scoreBlue ? theme.playerRed : theme.playerBlue, themeType: themeType))), - ], - ), - ), + // 9. Effetti di Vittoria + if (gameController.isGameOver && gameController.board.scoreRed != gameController.board.scoreBlue) + Positioned.fill(child: IgnorePointer(child: WinnerVFXOverlay(winnerColor: gameController.board.scoreRed > gameController.board.scoreBlue ? theme.playerRed : theme.playerBlue, themeType: themeType))), + ], ), ), ); @@ -530,7 +550,6 @@ class _ArenaClipper extends CustomClipper { Path path = Path(); for (var box in board.boxes) { - // Ignora i buchi in modo che non vengano sfocati! if (box.type != BoxType.invisible) { path.addRect(Rect.fromLTWH( box.x * spacing + offset,