Phase 7: Scroll wheel zoom + camera polish

- Mouse wheel up/down zooms camera in/out
- Zoom clamped between 0.3x and 3x to prevent getting lost
- Updated PLAN.md: marked phases 5-6 as done, added phase 7-8

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Samuel Bouchet 2026-04-10 23:25:09 +02:00
parent 8918140114
commit 84ab0a1d0f
2 changed files with 31 additions and 14 deletions

34
PLAN.md
View file

@ -28,22 +28,28 @@
- Production interval removed: all productions fire every turn
- GDD updated with Pion, 6 levels
## Phase 5: Network levels and Dame (Queen)
## Phase 5: Dame, network levels, juice pass (DONE)
**Goal**: Open-ended logistics puzzles with interconnected supply networks.
- Dame (Queen): 8 directions, range 2, status 7 (highest)
- Levels 7-8: La Dame Blanche (10x10), Le Grand Reseau (12x10)
- Procedural SFX, particles, polished animations, fade transitions
- UI bugfixes: stop reset, piece selection visuals, back-to-menu button
- Trajectory preview on piece click
- Multiple productions feeding multiple demands through shared infrastructure.
- Dame piece: combines Rook + Bishop movement (range 2, all 8 directions).
- Powerful but expensive — forces cost/benefit tradeoffs.
- Larger boards (12x12+) with complex wall configurations.
- Potential for player-designed levels (level editor data format).
## Phase 6: Godot integration (DONE)
## Phase 6: Godot integration
- Board renderer, piece placement, step/play/pause controls
- Event visualization with simultaneous animations per phase
- Victory/defeat screens with animated metrics
- Production flash, cargo slide trails, destruction particles, confetti
**Goal**: Playable visual prototype.
## Phase 7: Zoom, scroll wheel, and camera polish
- Board renderer: grid, walls, buildings, pieces.
- Drag-and-drop piece placement during Edit phase.
- Step/play/pause simulation controls.
- Event visualization: cargo movement, transfers, delivery animations.
- Victory/defeat screens with Metrics display.
- Mouse scroll wheel to zoom in/out on board
- Zoom limits (min/max) to prevent getting lost
- Double-click to center on a piece
## Phase 8: Level editor (future)
- Player-designed levels via JSON export
- In-game editing of board size, walls, productions, demands, stock

View file

@ -71,6 +71,10 @@ public partial class Main : Node2D
{
if (mb.ButtonIndex == MouseButton.Middle)
_panning = mb.Pressed;
else if (mb.Pressed && mb.ButtonIndex == MouseButton.WheelUp)
ZoomCamera(1.1f);
else if (mb.Pressed && mb.ButtonIndex == MouseButton.WheelDown)
ZoomCamera(0.9f);
}
else if (@event is InputEventMouseMotion motion && _panning)
{
@ -78,6 +82,13 @@ public partial class Main : Node2D
}
}
private void ZoomCamera(float factor)
{
var newZoom = _camera.Zoom * factor;
newZoom = newZoom.Clamp(new Vector2(0.3f, 0.3f), new Vector2(3f, 3f));
_camera.Zoom = newZoom;
}
private void FadeIn(float duration)
{
_fadeOverlay.Color = new Color(0, 0, 0, 1);