Implemented ice friction physics for puck:
- Added PUCK_DRAG (200 px/s²) to simulate ice friction
- Reduced PUCK_BOUNCE from 1.0 to 0.6 for energy loss on collisions
- Puck now naturally decelerates when loose instead of bouncing forever
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Moved all player scene/physics setup from Player constructor to GameScene.addPlayer() to create a single source of truth for adding players. This prevents players from auto-rendering when instantiated and gives better control over when/how players are added to the scene.
Changes:
- Remove scene.add.existing() and physics setup from Player constructor
- Move physics body initialization to GameScene.addPlayer()
- Comment out second test player for single-player debugging
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add playerGroup for dynamic collision management between all players
- Add goalPostsGroup for centralized goal post collision handling
- Add addPlayer() and removePlayer() methods for runtime player management
- Reduce collision setup from 15+ lines to 2 group-based colliders
- Adjust threat detection radius from 8m to 4m for more realistic evasion
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Implements a clickable pause button centered at the bottom of the screen that allows freezing and resuming the match engine. When paused, physics stops and the game loop exits early. Button changes color and text to indicate state (PAUSE/RESUME).
- Add UI_BOTTOM_PADDING constant and increase canvas height to show UI below rink
- Add pause state tracking and toggle functionality in GameScene
- Pause button positioned at bottom center with visual feedback
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add physics colliders between all players and goal post structures
- Players now collide with left/right posts and back bars of both goals
- Prevents unrealistic behavior of skating through goal frames
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
When the puck hits a goal post, it now:
- Loses 30% of its speed (reduces to 70%)
- Bounces at a slightly randomized angle (±17 degrees variation)
This creates more realistic and unpredictable post bounces.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Players must be moving at least 2 m/s to execute a tackle
- Add TACKLE_MIN_SPEED constant (2 m/s) in constants.ts
- Add Player.getCurrentSpeed() method to expose current speed
- Check tackler speed in executeTackle() before attempting tackle
- Log speed in tackle debug output for tuning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add threat detection system that detects opponents within 3m radius
- Puck carrier automatically evades when opponent is in path to goal
- Evasion direction (left/right) persists while opponent in threat zone
- Fix behavior tree instantiation to reuse trees per player
- Add comprehensive debug visualization (magenta circle, threat indicators)
- Fix DefensiveBehavior type errors (carrierTeam -> possession)
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
When a player is successfully tackled, they now experience a realistic fall animation:
- Immediately decelerate to 0 velocity
- Stay down for 500ms (configurable via TACKLE_FALL_DURATION)
- Resume normal movement after recovery period
Changes:
- Added TACKLE_FALL_DURATION constant (500ms)
- Added fall state tracking to Player class (isFallen, fallRecoveryTime)
- Implemented fall() method to trigger the fall state
- Updated update() to handle fallen state and prevent movement during recovery
- Modified executeTackle() to call fall() instead of just reducing velocity
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
Added a realistic tackling system where players can physically contest for the puck:
- Player-player collisions trigger tackle calculations based on tackling vs balance attributes
- Tackle success uses skill-based formula with configurable modifier
- Successful tackles can steal puck or knock it loose (60% chance)
- Cooldown system prevents rapid successive tackles (1s between attempts)
- Tackled players experience significant momentum loss on successful tackles
Also improved player movement physics:
- Added smooth acceleration/deceleration with ease-out curves
- Players now gradually build up speed (10 m/s²) and brake quickly (20 m/s²)
- More realistic stopping behavior when reaching target positions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add defensive AI: players now chase puck carriers on opposing team
- Update DefensiveBehavior to check opponent possession and target puck position
- Increase player rotation speed from 3 to 10 rad/s for more responsive turning
- Update Claude settings permissions
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Add away team defender (LD) for testing behaviors
- Add direction indicator (white line) showing player facing direction
- Initialize player facing angle based on team (home faces right, away faces left)
- Implement speed-based turning physics (faster = wider turns, rotation drops to 30% at max speed)
- Add debug visualizations for player targets (line and X marker) when DEBUG is true
- Increase rotation speed constant from 1 to 3 rad/s for more responsive turning
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
- Separate base behavior nodes into BehaviorNodes.ts (fixes circular dependency)
- Organize behaviors by role (goalie) and context (offensive/defensive/transition)
- Add modular behavior subtrees:
- GoalieBehavior: Track puck position near net
- SkaterBehavior: Route to context-specific behaviors
- PuckCarrierBehavior: Shoot/carry logic (Phase 4)
- OffensiveSupportBehavior: Placeholder for Phase 5
- DefensiveBehavior: Placeholder for Phase 6
- TransitionBehavior: Chase loose puck
- Maintain backward compatibility with static evaluatePlayer()
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>