Files
023-turtle-crossing/docs/milestones/mil-004-cars.md
T
2026-10-13 13:50:47 +08:00

72 lines
2.6 KiB
Markdown

# MIL-004 Cars
## Metadata
| Key | Value |
| --- | --- |
| ID | MIL-004 |
| CrossReference | [BC-001], [PP-001] |
| Language | en |
| Domain | it |
## Version History
| Date | Status | Author | Reviewer | Change | Commit |
| --- | --- | --- | --- | --- | --- |
| 2026-10-13 | Accepted | Jens Tirsvad Nielsen | AI as stand-in for S01 | Initial version | [93d8321] |
---
## Purpose
Decide that cars are generated, drawn as cars and moved correctly.
## Deliverable
A CarManager with create_cars and move_cars, and a registered car shape that shows a body, cabin and two wheels inside a 40 x 20 px footprint.
## Go / No-Go Criteria
| # | Criterion (objectively checkable) | Go | No-Go |
| --- | --- | --- | --- |
| 1 | Cars are generated at random y values, never in the top or bottom 50 px | Test over many samples | A car appears in the safe zone |
| 2 | A new car is created on one in six loop runs | Test of the spawn rule | Wrong rate |
| 3 | Cars move right to left by the current speed | Test of position change | Wrong direction |
| 4 | Each car is drawn as a car, not a colour block, using the standard library only | Visual check and shape registration in code | A plain rectangle is shown or an image file is needed |
## Dependencies
| Depends on | Reason |
| --- | --- |
| MIL-003 | The previous step of the assignment must be accepted first |
## Traceability
| Business Case objective / KPI / user story | Reference |
| --- | --- |
| Objectives 1, 2 (step 2, bullet 2) | [BC-001] |
## Ownership
| Role | Stakeholder ID (SA) |
| --- | --- |
| Owner | S01 |
| Approving reviewer | S01 |
## Target Date
2026-10-19 - within the two-week plan of [PP-001].
## Tasks
| # | Task | Summary | Needs its own Use Case/User Story? | Reference |
| --- | --- | --- | --- | --- |
| 1 | Design the car shape | Draw a car silhouette as a compound turtle Shape: lower body, cabin with window, two wheels, 40 x 20 px, pointing left. Register it once with register_shape. The colour comes from COLORS. | No | |
| 2 | Implement create_cars | Random colour and random y inside the safe-zone limits, one car in six loop runs, each car using the registered shape. | No | |
| 3 | Implement move_cars | Move every car left by the current speed and drop cars that left the screen. | No | |
| 4 | Test CarManager | Pytest tests for spawn rule, safe zone and movement, with the display parts separated from the logic. | No | |
---
[BC-001]: ../business-case.md
[PP-001]: ../project-plan.md
[93d8321]: https://git.tirsystem.com/Tirsvad-Udemy-100-days-of-code/023-turtle-crossing/commit/93d83217622a6c555dca728fe10c83c35f8ac7e2