constants.py: GAME_OVER_TEXT and GAME_OVER_POSITION removed; HIGH_SCORE_LABEL and SEGMENT_PARKING_POSITION added.
Scoreboard: high_score attribute (0 until MIL-004), text Score: <score> High Score: <high_score>, reset() replaces game_over().
Snake.reset(): old segments sent to (1000, 1000), list emptied, snake created again, head and the direction of travel renewed.
main.py: end_game_if_over is replaced by reset_if_collision; the loop never ends by itself, exitonclick is gone, closing the window still ends quietly.
ruff check and ruff format --check: clean; mypy strict: clean; doxygen: 0 warnings
python -m snake_game: smoke run, still running after 4 seconds
Hitting the wall and the tail by hand in the real window is S01's check of Go/No-Go criterion 10; the behaviour is covered by the tests above.
Delivers MIL-003 (RC-006, code review RC-011; autonomous mode, not independent).
Closes #16
Closes #17
Closes #18
Closes #19
Closes #20
Closes #21
Closes #22
## Changes from MIL-002
- `constants.py`: `GAME_OVER_TEXT` and `GAME_OVER_POSITION` removed; `HIGH_SCORE_LABEL` and `SEGMENT_PARKING_POSITION` added.
- `Scoreboard`: `high_score` attribute (0 until MIL-004), text `Score: <score> High Score: <high_score>`, `reset()` replaces `game_over()`.
- `Snake.reset()`: old segments sent to (1000, 1000), list emptied, snake created again, `head` and the direction of travel renewed.
- `main.py`: `end_game_if_over` is replaced by `reset_if_collision`; the loop never ends by itself, `exitonclick` is gone, closing the window still ends quietly.
- Tests: game-over tests replaced by reset tests; 138 -> 149 tests.
## Checks run locally (fresh .venv)
- pytest: 149 passed, no window opened
- ruff check and ruff format --check: clean; mypy strict: clean; doxygen: 0 warnings
- `python -m snake_game`: smoke run, still running after 4 seconds
Hitting the wall and the tail by hand in the real window is S01's check of Go/No-Go criterion 10; the behaviour is covered by the tests above.
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Delivers MIL-003 (RC-006, code review RC-011; autonomous mode, not independent).
Closes #16
Closes #17
Closes #18
Closes #19
Closes #20
Closes #21
Closes #22
Changes from MIL-002
constants.py:GAME_OVER_TEXTandGAME_OVER_POSITIONremoved;HIGH_SCORE_LABELandSEGMENT_PARKING_POSITIONadded.Scoreboard:high_scoreattribute (0 until MIL-004), textScore: <score> High Score: <high_score>,reset()replacesgame_over().Snake.reset(): old segments sent to (1000, 1000), list emptied, snake created again,headand the direction of travel renewed.main.py:end_game_if_overis replaced byreset_if_collision; the loop never ends by itself,exitonclickis gone, closing the window still ends quietly.Checks run locally (fresh .venv)
python -m snake_game: smoke run, still running after 4 secondsHitting the wall and the tail by hand in the real window is S01's check of Go/No-Go criterion 10; the behaviour is covered by the tests above.