Implement stuck snake mechanics, persistent colors, and length display
Major gameplay changes: - Snakes no longer die from collisions - When blocked, snakes get "stuck" - head stays in place, tail shrinks by 1 per tick - Snakes auto-unstick when obstacle clears (other snakes move/shrink away) - Minimum snake length is 1 (head-only) - Game runs continuously without rounds or game-over state Color system: - Each player gets a persistent color for their entire connection - Colors assigned on join, rotate through available colors - Color follows player even after disconnect/reconnect - Works for both desktop and web clients Display improvements: - Show snake length instead of score - Length accurately reflects current snake size - Updates in real-time as snakes grow/shrink Server fixes: - Fixed HTTP server initialization issues - Changed default host to 0.0.0.0 for network multiplayer - Improved file serving with proper routing Testing: - Updated all collision tests for stuck mechanics - Added tests for stuck/unstick behavior - Added tests for color persistence - All 12 tests passing 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"""Game constants shared between client and server."""
|
||||
|
||||
# Network settings
|
||||
DEFAULT_HOST = "localhost"
|
||||
DEFAULT_HOST = "0.0.0.0" # Listen on all interfaces for multiplayer
|
||||
DEFAULT_PORT = 8888
|
||||
DEFAULT_WS_PORT = 8889
|
||||
DEFAULT_HTTP_PORT = 8000
|
||||
|
||||
Reference in New Issue
Block a user