Start Here
This content is not available in your language yet.
Intro
p5.js is a JavaScript library which implements your own canvas for creating interactive projects - the web browser is your limit…
If you want to know more about this library, the official website is here. Have a look around and click on the examples on the left hand side to see what results you could end up with!
Starting Your Project
We will be showing you how to start a project which is hosted by this p5.js library.
1. Follow Setting Up
Firstly, follow the JavaScript ‘Setting Up’ page until you have a folder with a file named package.json
.
2. Create a new JS file
In the terminal (cat > filename
) or with the right-click of your mouse, create a new file named sketch.js
.
Inside this file, put this code:
3. Create new HTML file
Now, this code doesn’t work quite yet, because we need a way to see the code! The way to do this is to create another file, called index.html
HTML stands for Hyper-Text Markup Language, and is a way for browsers like Google to show your code!
Inside this file, copy and paste this code:
Continue Learning
You’re done with the basics of your project! I recommend moving onto the Paintbrush page.