Task: MIL-003#1 Task: MIL-003#2 Task: MIL-003#3 Task: MIL-003#4 Task: MIL-003#5 Task: MIL-003#6
1017 B
1017 B
English · Dansk · Bahasa Malaysia
Step 3: Shooting
What we built
The Bullet class and the Game class. Space fires a bullet from the ship; it flies up and is hidden again when it leaves the top of the screen. Only one bullet flies at a time. Game now owns the objects, binds the keys and runs the frame loop.
What we gained
- Using a flag (
active) to allow one shot at a time - Showing and hiding a turtle instead of creating new ones
- Introducing a
Gameclass to own the objects and the loop - Testing movement with simple numbers: one step is
BULLET_STEPpixels
Try it
Press Space.
Where the code is
src/bullet.py, src/game.py
Previous: Spaceship · Next: Alien fleet · Overview
