9 Commits

Author SHA1 Message Date
Pierre Wessman
549ac400e0 Add minimum speed requirement for tackle execution
- 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>
2025-10-02 12:59:35 +02:00
Pierre Wessman
999003b012 Add player fall mechanic after successful tackles
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>
2025-10-02 11:14:53 +02:00
Pierre Wessman
c81e500e18 Implement player tackling system with collision detection
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>
2025-10-02 10:50:35 +02:00
Pierre Wessman
ff97b227c2 Add player enhancements and debug features
- 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>
2025-10-02 10:08:00 +02:00
Pierre Wessman
d17d5c594b centralised types 2025-10-02 08:29:43 +02:00
Pierre Wessman
30d7d95ccc review 2025-10-02 08:22:33 +02:00
Pierre Wessman
8ec240333c player turning speed 2025-10-02 08:06:08 +02:00
3d15dc716b player 2025-10-01 14:54:58 +00:00
d2fb60df8d init player 2025-10-01 14:51:24 +00:00