add basic match3 logic

use proper logging everywhere
add gamepad and keyboard control on match3 gameplay
This commit is contained in:
2025-09-24 16:58:08 +04:00
parent e76297b3f3
commit bbf512b675
14 changed files with 466 additions and 63 deletions

View File

@@ -133,12 +133,23 @@ The game now uses a modular gameplay architecture where different game modes can
- Gem pool management (3-8 gem types)
- Debug UI integration
- Score reporting via `score_changed` signal
- **Gem Movement System**: Keyboard and gamepad input for tile selection and swapping
- State machine: WAITING → SELECTING → SWAPPING → PROCESSING
- Adjacent tile validation (horizontal/vertical neighbors only)
- Match validation (swaps must create matches or revert)
- Smooth tile position animations with Tween
- Cursor-based navigation with visual highlighting
2. **Tile System** (`scenes/game/gameplays/tile.gd` + `Tile.tscn`)
- Individual tile behavior
- Gem type management
- Visual representation
- Visual representation with scaling and color modulation
- Group membership for coordination
- **Visual Feedback System**: Multi-state display for game interaction
- Selection visual feedback (scale and color modulation)
- State management (normal, highlighted, selected)
- Signal-based communication with gameplay controller
- Smooth animations with Tween system
#### Clickomania Mode (`scenes/game/gameplays/clickomania_gameplay.tscn`)
- Planned implementation for clickomania-style gameplay
@@ -233,6 +244,9 @@ sprites:
- `project.godot` - Main Godot project settings
- Autoload definitions
- Input map configurations
- **Gem Movement Controls**:
- `select_gem`: Enter key, Gamepad A button
- `move_up/down/left/right`: Arrow keys, WASD, Gamepad D-pad
- Rendering settings
- Audio bus references
@@ -288,8 +302,18 @@ DebugManager.log_error("Failed to load audio resource")
# Logging with custom categories for better organization
DebugManager.log_debug("Grid regenerated with 64 tiles", "Match3")
DebugManager.log_info("Language changed to: en", "SettingsManager")
DebugManager.log_info("Language changed to: en", "Settings")
DebugManager.log_error("Invalid scene path provided", "GameManager")
# Standard categories in use:
# - GameManager: Scene transitions, gameplay mode management
# - Match3: Match-3 gameplay, grid operations, tile interactions
# - Settings: Settings management, language changes
# - Game: Main game scene, mode switching
# - MainMenu: Main menu interactions
# - PressAnyKey: Press any key screen
# - Clickomania: Clickomania gameplay mode
# - DebugMenu: Debug menu operations
```
### Log Format
@@ -322,6 +346,16 @@ if DebugManager._should_log(DebugManager.LogLevel.DEBUG):
### Current Implementation Status
- Modular gameplay system with dynamic loading architecture
- Match-3 system with 8x8 grid and configurable gem pools
- **Interactive Match-3 Gameplay**: Keyboard and gamepad gem movement system
- Keyboard: Arrow key navigation with Enter to select/confirm (WASD also supported)
- Gamepad: D-pad navigation with A button to select/confirm
- Visual feedback: Tile highlighting, selection indicators, smooth animations
- Game logic: Adjacent-only swaps, match validation, automatic revert on invalid moves
- State machine: WAITING → SELECTING → SWAPPING → PROCESSING states
- **Comprehensive Logging System**: All print()/push_error() statements migrated to DebugManager
- Structured logging with categories: GameManager, Match3, Settings, Game, MainMenu, etc.
- Multiple log levels: TRACE, DEBUG, INFO, WARN, ERROR, FATAL
- Debug mode integration with level filtering
- Global scoring system integrated across gameplay modes
- Debug UI system with F12 toggle functionality across all major scenes
- Scene transition system via GameManager with gameplay mode support