- Create centralized logger module (src/core/logger.ts)
- Replace all debugLog() calls with log.debug()
- Replace console.log() with log.info()
- Replace console.warn() with log.warn()
- Replace console.error() with log.error()
- Delete deprecated src/core/debug.ts
- Configure log levels: debug for dev, warn for production
- Add localStorage override for production debugging
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add ESLint with typescript-eslint for unused code detection
- Fix 33 unused variable/import warnings across codebase
- Remove player_name from leaderboard insert (normalized design)
- Add ensureUserProfile() to upsert user display_name to users table
- Update leaderboard queries to join with users(display_name)
- Add getDisplayName() helper for leaderboard entries
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Remove all local level storage concepts and load levels exclusively from
Supabase cloud. Simplifies LevelRegistry from 380+ lines to ~50 lines.
Uses CloudLevelEntry directly throughout the codebase instead of wrapper
types like LevelDirectoryEntry.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create GameResultsService for storing game results in localStorage
- Create gameResultsStore Svelte store for reactive data access
- Add Leaderboard component showing top 20 scores
- Add leaderboard route and navigation link
- Record game results on victory/death/stranded (not manual exits)
- Fix header visibility when exiting game
- Fix camera error by stopping render loop after cleanup
- Clear canvas after cleanup to prevent last frame showing
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit resolves several physics-related issues that were causing
unexpected behavior in ship and asteroid movement:
**Physics Sleep System**
- Fixed abrupt stops by preventing Havok from putting bodies to sleep
- Added PhysicsActivationControl.ALWAYS_ACTIVE for ship and asteroids
- Made ship sleep behavior configurable via shipPhysics.alwaysActive
- Sleep was causing sudden velocity zeroing at low speeds
**Center of Mass Issues**
- Discovered mesh-based physics calculated offset CoM: (0, -0.38, 0.37)
- Override ship center of mass to (0, 0, 0) to prevent thrust torque
- Applying force at offset CoM was creating unwanted pitch rotation
- Added debug logging to track mass properties
**Input Deadzone Improvements**
- Implemented smooth deadzone scaling (0.1-0.15 range)
- Replaced hard threshold cliff with linear interpolation
- Prevents abrupt control cutoff during gentle inputs
- Added VR mode check to disable keyboard fallback in VR
**Configuration System**
- Added DEFAULT_SHIP_PHYSICS constant as single source of truth
- Added tunable parameters: linearDamping, angularDamping, alwaysActive
- Added fuel consumption rates: linearFuelConsumptionRate, angularFuelConsumptionRate
- Tuned for 1 minute linear thrust, 2 minutes angular thrust at 60Hz
- All physics parameters now persist to localStorage
**Other Fixes**
- Changed orbit center to STATIC motion type (was ANIMATED)
- Fixed linear force application point (removed offset)
- Added ship initial velocity support from level config
- Changed physics update from every 10 frames to every physics tick
- Increased linear input threshold from 0.1 to 0.15
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Add linear-clamped scoring system that rewards speed, accuracy, fuel
efficiency, and hull integrity. Scores are always positive with a 0.5x
multiplier floor for refueling/repairs.
Scoring Components:
- Create scoreCalculator module with configurable scoring logic
- Time multiplier: Exponential decay from par time (0.1x to 3.0x)
- Accuracy multiplier: Linear 1.0x to 2.0x based on hit percentage
- Fuel efficiency: Linear with 0.5x floor (handles refueling >100%)
- Hull integrity: Linear with 0.5x floor (handles deaths/repairs >100%)
- Star rating system: 0-3 stars per category (12 stars max)
Integration:
- Add calculateFinalScore() to GameStats
- Support parTime in level config metadata
- Auto-calculate par time from difficulty level in Level1
- Recruit: 300s, Pilot: 180s, Captain: 120s, Commander: 90s, Test: 60s
- Display comprehensive score breakdown on status screen
Status Screen Updates:
- Increase mesh size from 1.5x1.0m to 1.5x2.25m (portrait orientation)
- Increase texture from 1024x768 to 1024x1536 (fit all content)
- Add score display section with:
- Final score in gold with thousand separators
- Score multiplier breakdown for each category
- Unicode star ratings (★★★) per category
- Total stars earned (X/12)
Formula:
finalScore = 10,000 × time × accuracy × fuel × hull
All multipliers ≥ 0.5, ensuring scores are never negative even with
multiple refuels/deaths. System rewards balanced excellence across all
performance metrics.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Create InputControlManager singleton for centralized ship controls and pointer selection management
- Last-wins behavior for state changes
- Mutually exclusive ship controls and VR pointer selection
- Observable events for state changes with requester tracking
- Enables debugging and prevents conflicts between UI components
- Refactor Ship class to use InputControlManager
- Remove disableControls() and enableControls() methods
- Register input systems with InputControlManager on initialization
- Simplify control state management throughout ship lifecycle
- Update StatusScreen to use InputControlManager
- Remove manual pointer selection enable/disable methods
- Delegate control management to InputControlManager
- Automatic laser pointer enabling when screen shows
- Update Level1 mission brief to use InputControlManager
- Consistent control management for mission brief display
- Proper pointer selection during mission brief interaction
- Fix controller input trigger blocking bug
- Triggers now properly blocked when controls disabled
- Prevents shooting when status screen or mission brief is visible
- Only X-button (status screen toggle) allowed when disabled
- Add START MISSION button to mission brief
- Replace "Pull trigger to start" text with clickable button
- Green styled button matching StatusScreen design
- Works with VR laser pointer interaction
- Trigger pull still works as fallback
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>