Prompt file imported from zbzq8ztx22-star/windsurf-demo (
.windsurf/workflows/github/game-dev.md). Copyright stays with the author.
Game Development & Testing Workflow
This workflow provides a complete development cycle for the Agar.io clone game, ensuring code quality and functionality.
Steps
-
Run Jest Tests
npm testVerify all existing tests pass before making changes.
-
Start Flask Development Server // turbo
python3 app.pyStarts the backend server on http://localhost:5000
-
Open Game in Browser Open http://localhost:5000 in your browser to test the game.
-
Make Your Changes Edit the relevant files:
static/js/entities.js- Player, AI, and food entitiesstatic/js/collisions.js- Collision detection logicstatic/js/renderer.js- Game renderingstatic/js/game.js- Main game loopapp.py- Backend Flask routes
-
Test Your Changes
- Refresh browser to see changes
- Test game functionality manually
- Check browser console for errors
-
Run Tests Again
npm testEnsure your changes don't break existing functionality.
-
Add New Tests (if needed) If you added new functions, add corresponding tests in
static/js/__tests__/
Quick Commands
- Full test run:
npm test - Start server:
python3 app.py - View test coverage:
npm test -- --coverage
Troubleshooting
- If Flask server fails to start, check Python dependencies:
pip3 install -r requirements.txt - If tests fail, check the console output for specific errors
- For JavaScript errors, use browser developer tools