Bonus challenges
Finished the base game? These challenges are on you, so there's no step-by-step code here, just the goal, a few hints, and the docs and tools you'll need for each one.
Finish 1 bonus:
Finish both: the sticker sheet and $10 total for candy!
Bonus 1: Custom art & sound
Goal: Give your effects your own art, add your own sound effects, or both.
Hints
- Draw sprites or effects in a pixel art tool, export them as PNGs, and upload them to your sketch.
- Record or generate your own sound effects, then play one when something happens, like catching a ghost.
- Browsers block sound until the player clicks, so start audio after the first click.
- In the p5.js web editor, upload files from the sketch file list: click the arrow on the left, then + and Upload file.
Bonus 2: Two more levels
Goal: Add two extra levels, each harder than the last.
Hints
- Keep a level variable, and move to the next level when the player reaches a target score.
- Store each level's settings (time, ghost speed, how many ghosts, how often they jump) in an array of objects, so a new level is one more entry.
- Show the level number on screen, and a short "Level 2!" message between levels.
- Harder can mean faster, smaller, more of them, less time, or something new to avoid.
p5.js reference
JavaScript basics
Everything else
p5.js reference Every function, with live examples.p5.js examples Small finished sketches to learn from.p5.js tutorials Longer step-by-step lessons.The Coding Train Video lessons on p5.js.
Stuck? Ask in the Hack Club Slack.