LEVEL 3 ๐Ÿš€

Make it real

Functions, lists, and your first proper game. By the end of this level your code lives on GitHub โ€” the same place professional engineers keep theirs.

3A

Function Factory

A function is a recipe you write once and use forever. We wrote flower() once โ€” now we can plant a whole garden in three lines.

Code โ€” copy me into the p5.js editor

        
      
Demo โ€” what yours should do
๐ŸŽฏ Challenges: plant 10 flowers ยท make a giant one ยท give flower() a colour ingredient too ยท write your own function: robot(x, y, size)
3B

Fireworks

An array is a list. Ours holds hundreds of sparks, each with its own position and speed โ€” and one loop moves them all. Click to launch!

Code โ€” copy me into the p5.js editor

        
      
Demo โ€” click on it!
๐ŸŽฏ Challenges: more sparks per burst ยท change the trail length (the 60 in background) ยท zero gravity fireworks ยท make each burst a single random colour
3C

Pong โ€” The Real Deal

Everything you've learned in one game: variables, if-statements, coordinates, collision. It works โ€” but it's your job to make it better.

Code โ€” copy me into the p5.js editor

        
      
Demo โ€” move your mouse to play
๐ŸŽฏ Boss challenges: show a high score ยท add a second paddle on the right (2-player!) ยท make the ball flash when it hits ยท game over screen after 3 misses

Git โ€” save points for code ๐Ÿ’พ

Git is like save points in a game. Commit = save your progress. GitHub = your saves, online, with your name on them. This is the exact workflow professionals use every single day.

git init # start tracking this folder (once per project)
git status # "what's changed since my last save?"
git add . # "get everything ready to save"
git commit -m "added scoring" # SAVE, with a note
git push # upload your saves to GitHub

๐Ÿ’ก Commit messages say what you did: "added fireworks", "fixed the paddle bug". Future-you reading the history should know exactly what happened. And yes โ€” your GitHub profile is basically a trophy cabinet.