Select/hover tetramino with Area3D signal
This commit is contained in:
@@ -1,19 +1,22 @@
|
||||
# Tetromino Selector System
|
||||
|
||||
## Overview
|
||||
Adds interactive tetromino selection and repositioning during gameplay. Players can select already-placed tetrominoes, move them, rotate them, and place them in new positions.
|
||||
Adds interactive tetromino selection and repositioning during gameplay. Players can select already-
|
||||
placed tetrominoes, move them, rotate them, and place them in new positions.
|
||||
|
||||
## Components
|
||||
|
||||
### 1. TetrominoSelector (scripts/tetromino_selector.gd)
|
||||
|
||||
Main controller for tetromino selection logic.
|
||||
|
||||
**Features:**
|
||||
- Raycast-based tetromino detection on left-click
|
||||
- Ghost mode visualization (semi-transparent)
|
||||
- Raycast-based tetromino detection on left-click from camera to world
|
||||
- Real-time position tracking with mouse movement
|
||||
- Rotation with spacebar (45° increments)
|
||||
|
||||
- Ghost mode visualization (semi-transparent)
|
||||
- Placement validation using board manager
|
||||
- Rotation with spacebar (45° increments)
|
||||
- Cancellation with right-click or ESC key
|
||||
|
||||
**Signals:**
|
||||
@@ -78,12 +81,12 @@ Added collision detection for raycast selection.
|
||||
- Player left-clicks to place
|
||||
- Selector validates placement using BoardManager3D._can_place_tetromino()
|
||||
- If valid:
|
||||
- Updates board manager occupied cells
|
||||
- Tetromino exits ghost mode
|
||||
- Signals emit `selection_placed`
|
||||
- Updates board manager occupied cells
|
||||
- Tetromino exits ghost mode
|
||||
- Signals emit `selection_placed`
|
||||
- If invalid:
|
||||
- Tetromino snaps back to original position
|
||||
- Reverts to original rotation
|
||||
- Tetromino snaps back to original position
|
||||
- Reverts to original rotation
|
||||
|
||||
5. **Cancellation**
|
||||
- Player right-clicks or presses ESC
|
||||
|
||||
Reference in New Issue
Block a user