Examples /
p5.js Examples
p5.js Examples
Calling Functions
Circles
Use circles to create an interesting pattern.
Arcs
Draw a circular pattern using the arc function.
Using Variables
Creating Variables
Random Skull
Use the random() function to draw a random skull.
Creating Functions
drawHouse
Create a function that draws a house.
drawTown
Create a function that draws a town.
drawCity
Use functions to draw a random city.
If Statements
Animation
Grouchy Face
Make your computer mad when you click the mouse.
For Loops
Menorah
Code your own virtual menorah!
Code Rocket
Make a rocket from the whitespace in your code.
Arrays
Using Objects
Creating Classes
Bonsai Tree
Use recursion to create a digital bonsai tree.
Loopers
Draw lines that loop around the screen.
Planets
Show planets orbiting a sun
Images
Genuary 19
Increase the randomness of an image along the Y-axis.
Libraries
Other Resources
- p5 spooky sketches is a printout I made for CC Fest in 2019. It contains a bunch of halloween-themed examples of drawing and image manipulation.