Playable result only — the source code stays hidden.
Mission 0: See What You’re Building
Play Galaxy Rescue first. The game starts immediately. Use Left/Right Arrow to steer, catch cyan rescue pods, avoid orange meteors, rescue 8 pods to win, and press R after a win or loss to play again.
This is a capstone, but we will still build it in small steps. Visual pieces will not appear from nowhere: you will make one pod and one meteor before turning them into moving groups.
Concepts you will deliberately reuse
- strings, comparisons,
ifandelse if - AND
&&, OR||, parentheses and braces - arrays, indexes,
.lengthandforloops - objects and property updates
- functions, parameters, function calls and
return +=and-=countersrandom()anddist()- template literals
- held-key movement and one-time key events
What you’ll build, mission by mission
- 1Game state
Use a string and condition to control when game code updates.
- 2Ship controls
Reuse held-arrow movement and constraints.
- 3Draw a rescue pod
Build the two-circle pod yourself with an object and drawing function.
- 4Pod squad
Scale one pod into an array drawn by a loop.
- 5Move the pods
Update each object's y-position using its own speed property.
- 6Recycle the pods
Reset off-screen objects to random positions with a helper.
- 7Collision helper
Return a reusable Boolean from `dist()`.
- 8Rescue a pod
Use the collision result to update a counter and reset one pod.
- 9Live HUD
Display current progress and lives with a template literal.
- 10Build a meteor
Create the hazard's visual design before it becomes dangerous.
- 11Meteor squad
Transfer the array-loop-helper pattern to meteors.
- 12Meteor damage
Reuse collision logic to lose one life per hit.
- 13Win or lose
Use if/else-if to choose one end state.
- 14Finish Galaxy Rescue
Use grouped AND/OR logic to add a correct one-time restart.