Go to file
Michael Mainguy 827dd2d359
Some checks failed
Build / build (push) Failing after 19s
Add resupply system for base landing zone
Implemented automatic resource replenishment when the ship is inside the base landing zone.

**Modified: src/starBase.ts**
- Added StarBaseResult interface with baseMesh and landingAggregate properties
- Changed buildStarBase() return type from AbstractMesh to StarBaseResult
- Now returns both the base mesh and landing aggregate for resupply system access
- Landing aggregate already configured as trigger for collision detection

**Modified: src/levelDeserializer.ts**
- Added PhysicsAggregate import
- Updated deserialize() return type to include landingAggregate field
- Changed createStartBase() to return full StarBaseResult
- Updated return statement to destructure baseResult into baseMesh and landingAggregate

**Modified: src/level1.ts**
- Added PhysicsAggregate import and _landingAggregate property
- Stored landingAggregate from deserializer result
- Called ship.setLandingZone() to configure resupply system

**Modified: src/ship.ts**
- Added resupply system properties: _landingAggregate, _resupplyTimer, _isInLandingZone
- Added setLandingZone() method to configure landing zone for resupply
- Added updateResupply() method called every physics update (6 times per second)
- Distance-based detection: checks if ship is within 20 units of landing zone center
- Resupply rate: 0.1 per second for all resources (fuel, hull, ammo)
- Automatically replenishes until resources reach 1.0 maximum
- Debug logging for enter/exit landing zone events

Resupply System Mechanics:
- Activates when ship is within landing zone (distance < 20 units)
- Replenishes at 0.1 per second (~0.01666 per update at 6 updates/second)
- Repairs all three resources simultaneously: fuel, hull, ammo
- Stops automatically when each resource reaches maximum (1.0)
- Integrated with existing ShipStatus observable system for automatic gauge updates

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-07 15:39:40 -06:00
.github/workflows increased heap space. 2025-10-28 12:01:29 -05:00
docs Add Blender export tooling and refactor asset structure 2025-11-06 12:25:34 -06:00
public Fix inspector 'i' key registration in KeyboardInput 2025-11-07 13:07:15 -06:00
scripts Add Blender export tooling and refactor asset structure 2025-11-06 12:25:34 -06:00
server Initial Commit 2025-02-15 11:19:24 -06:00
src Add resupply system for base landing zone 2025-11-07 15:39:40 -06:00
themes/default Fix level double initialization and refactor ship physics 2025-11-07 11:16:50 -06:00
.gitignore Initial Commit 2025-02-15 11:19:24 -06:00
CLAUDE.md Refactor sight to crosshair reticle and rename starfield to rockFactory 2025-10-30 10:21:27 -05:00
CONTROLLER_THRUST.md Refactor ship controls to force-based physics with world-space transformations 2025-10-31 11:20:31 -05:00
index.html Make ship physics constants configurable via GameConfig with UI 2025-11-07 13:05:27 -06:00
package-lock.json Add Blender export tooling and refactor asset structure 2025-11-06 12:25:34 -06:00
package.json Add Blender export tooling and refactor asset structure 2025-11-06 12:25:34 -06:00
styles.css Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00
tsconfig.json Initial Commit 2025-02-15 11:19:24 -06:00
vite.config.ts Add difficulty levels and upgrade BabylonJS 2025-10-17 09:05:18 -05:00