space-game/public/levels/directory.json
Michael Mainguy 244a25fff5
All checks were successful
Build / build (push) Successful in 1m34s
Implement hybrid level storage system with JSON-based defaults and configurable orbit constraints
Major changes:
- Add LevelRegistry for managing default (JSON) and custom (localStorage) levels
- Default levels now load from /public/levels/*.json files
- Add 6 default level JSON files (rookie-training through final-challenge)
- Implement version-based automatic cache invalidation
- Add LevelVersionManager for tracking level updates
- Add LevelStatsManager for performance tracking (completion rate, best time, etc.)
- Add legacy migration tool for existing localStorage data
- Update level selector UI with stats display and version badges
- Add configurable orbit constraints per level (useOrbitConstraints flag)
- Hide copy button in level selector UI (TODO: re-enable later)
- Add extensive debug logging for velocity troubleshooting
- Add cloud sync infrastructure interfaces (future-ready)

Technical improvements:
- Hybrid storage: immutable defaults from JSON, editable custom levels in localStorage
- Automatic cache refresh when directory.json version changes
- Cache API for offline support
- Fresh start migration approach with export option
- Level loading now initializes before router starts

Physics configuration:
- Add useOrbitConstraints flag to LevelConfig
- Rookietraining.json uses constraints (velocities will create orbital motion)
- Debug logging added to verify velocity application

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-11 18:40:01 -06:00

121 lines
4.0 KiB
JSON

{
"version": "1.0.5",
"levels": [
{
"id": "rookie-training",
"name": "Rookie Training",
"description": "Simple level to get the hang of things",
"version": "1.0",
"levelPath": "rookie-training.json",
"difficulty": "recruit",
"estimatedTime": "3-5 minutes",
"missionBrief": [
"Destroy the asteroids",
"Return to base after they're destroyed to complete the mission",
"Return to base if you need more fuel, ammo, or hull repairs",
"Don't get too far from base, if you run out of fuel, you'll be stranded",
"Don't run into things, it damages your hull"
],
"unlockRequirements": [],
"tags": ["tutorial", "easy"],
"defaultLocked": false
},
{
"id": "rescue-mission",
"name": "Rescue Mission",
"description": "Rescue operation in moderate asteroid field",
"version": "1.0",
"levelPath": "rescue-mission.json",
"difficulty": "pilot",
"estimatedTime": "5-8 minutes",
"missionBrief": [
"More asteroids and increased difficulty",
"Manage your fuel and ammunition carefully",
"Complete the mission and return to base",
"Use your radar to track asteroids",
"Watch your shield strength"
],
"unlockRequirements": ["rookie-training"],
"tags": ["medium"],
"defaultLocked": true
},
{
"id": "deep-space-patrol",
"name": "Deep Space Patrol",
"description": "Extended patrol mission in dangerous territory",
"version": "1.0",
"levelPath": "deep-space-patrol.json",
"difficulty": "captain",
"estimatedTime": "8-12 minutes",
"missionBrief": [
"Large asteroid field requiring careful navigation",
"Fuel management is critical at this distance",
"Return to base for resupply as needed",
"Asteroids are faster and more dangerous",
"Plan your route carefully"
],
"unlockRequirements": ["rescue-mission"],
"tags": ["hard"],
"defaultLocked": true
},
{
"id": "enemy-territory",
"name": "Enemy Territory",
"description": "Hazardous mission in hostile space",
"version": "1.0",
"levelPath": "enemy-territory.json",
"difficulty": "commander",
"estimatedTime": "10-15 minutes",
"missionBrief": [
"Heavily defended asteroid field",
"Maximum asteroid count and speed",
"Expert fuel and ammunition management required",
"Multiple base trips may be necessary",
"Test your skills to the limit"
],
"unlockRequirements": ["deep-space-patrol"],
"tags": ["very-hard", "combat"],
"defaultLocked": true
},
{
"id": "the-gauntlet",
"name": "The Gauntlet",
"description": "Survive the ultimate asteroid gauntlet",
"version": "1.0",
"levelPath": "the-gauntlet.json",
"difficulty": "commander",
"estimatedTime": "12-18 minutes",
"missionBrief": [
"Dense asteroid field with extreme hazards",
"High-speed rocks from all directions",
"This is a test of endurance and skill",
"Only the best pilots succeed",
"May the stars guide you"
],
"unlockRequirements": ["enemy-territory"],
"tags": ["very-hard", "endurance"],
"defaultLocked": true
},
{
"id": "final-challenge",
"name": "Final Challenge",
"description": "The ultimate test for master pilots",
"version": "1.0",
"levelPath": "final-challenge.json",
"difficulty": "commander",
"estimatedTime": "15-20 minutes",
"missionBrief": [
"The pinnacle of difficulty",
"Everything you've learned will be tested",
"Maximum asteroid count and velocity",
"Precision flying and resource management essential",
"Complete this to prove your mastery",
"Good luck, Commander"
],
"unlockRequirements": ["the-gauntlet"],
"tags": ["extreme", "final-boss"],
"defaultLocked": true
}
]
}