Learning Objectives
- Create player movement and shooting
- Add alien waves, collision, score, and lives
- Reach a complete playable loop
Section 1
Add Player Movement and Shooting
Use this prompt for either track:
Add the first playable controls. The player ship should move left and right, stay inside the screen, and shoot upward when I press Space. Add a short cooldown so holding Space does not create unlimited bullets. Keep the code readable and tell me how to test it.
Run the game immediately. Do not continue until movement and shooting feel responsive.
Exercises
- 1Move the ship left and right.
- 2Fire bullets with Space.
- 3Ask Codex to adjust speed or cooldown if the controls feel wrong.
Section 2
Add Alien Waves
Now add enemies:
Add alien enemies that spawn in rows near the top of the screen and drift side to side while slowly descending. Bullets should destroy aliens. Add simple collision detection, a score counter, and a new wave when all aliens are destroyed.
This should turn the project from a demo into a real game loop.
Exercises
- 1Destroy at least one alien.
- 2Clear a full wave.
- 3Verify the score increases.
Section 3
Add Lives and Game Over
Add win and loss pressure:
Add player lives, alien collision with the player, and a game over state. If an alien reaches the bottom or hits the player, the player loses a life and the wave resets. When lives reach zero, show a Game Over screen with final score and a clear restart key.
A complete workshop game needs a beginning, middle, failure state, and restart.
Exercises
- 1Lose a life on purpose.
- 2Reach Game Over.
- 3Restart without closing the app.
Section 4
Ask for a Code Check
Before polish, ask Codex to review what it wrote:
Review the game code for beginner-friendly structure. Do not add new features. Find any obvious bugs, duplicated logic, or confusing names, then make small cleanup changes only if they reduce risk.
This teaches a critical habit: AI can generate, but it should also inspect.