Recreating LEGO Loco (1998) in C++ with raylib.
- Implement coordinate conversion (screen <-> world)
- Render grid with proper depth sorting
- Camera panning with mouse drag
- Camera zoom in/out
- Define tile data structure (type, connections)
- Add tile orientation and connection metadata
- Load and render placeholder tile sprites
- Implement tile placement on grid
- Tile removal/replacement
- Road tile auto-connection logic
- Train track manual placement with rotation
- World data structure (2D array of tiles)
- Save world to file
- Load world from file
- Main menu screen (New Game, Load Game, Quit)
- Transition from main menu to gameplay
- In-game state management (building vs playing)
The Toy Box is a floating panel with a 3-wide x 5-high button grid:
Row 1 - Placement
- Tiles button (opens sub-menu: tracks, road pieces)
- Buildings button (opens sub-menu: houses, stations, shops)
- Nature button (opens sub-menu: trees, vegetation, props)
Row 2 - Removal
- Eraser (remove single object on click)
- Bomb (destroy all - clear entire world)
- Undo (revert last action)
Row 3 - File
- Load/Save button (save and load world files)
- Background selector (change world background)
- Bulldozer mode toggle (auto-remove when placing on top)
Row 4 - Settings
- Windowed/Fullscreen toggle
- Help screen
- Audio on/off toggle
Row 5 - Close
- Close Toy Box button (single wide button spanning full width)
- Hover highlights on tiles
- Placement ghost preview
- Selection indicators
- Error messages for invalid actions
- Building data structure (size, type, properties)
- Multi-tile building footprints
- Placement validation (no overlap)
- Building removal
- Houses (minifigure spawn points)
- Train station (passenger boarding)
- Train depot (train spawn/storage)
- Decorative buildings
- Trees and vegetation
- Fences and props
- Straight track with manual rotation
- Curved track (3x3) with manual rotation
- Track switches/junctions
- Track validation (connections must align)
- PathGraph for path tiles
- Extend PathGraph to track tiles
- Calculate path along connected tracks
- Handle junctions and switches
- Detect loops and dead ends
- Train entity with position on track
- Smooth movement along track path
- Train speed control (accelerate/brake)
- Train stops at end of track
- Locomotive sprite
- Cargo/passenger carriage sprites
- Multiple carriages following locomotive
- Select train by clicking
- Control panel UI for selected train
- Reverse train direction
- Multiple trains on separate track sections
- Minifigure sprite with animations (idle, walk)
- Spawn from houses
- Random wandering AI
- Pathfinding on walkable areas
- Pick up minifigure with mouse
- Drop minifigure at new location
- Minifigure walks to nearest station
- Board train at station
- Minifigures wait at stations
- Board train when it stops
- Exit at destination station
- Track passenger count per train
- Simulation tick rate
- Pause/speed controls
- Background music?
- Train sounds (moving, whistle)
- UI click sounds
- Ambient sounds
- Particle effects (loc-steam, destruction animation)
- Undo/redo for building
- Keyboard shortcuts?
- Settings menu (volume, resolution)
- That weird zoom-glass function
- Multiplayer (LAN)
- Postcard system
- More building types
- Train customization
- Minifigure moods and needs
- Seasons and weather
- Easter eggs from original game