Code Camp
Day 1
Introductions
Use pages here to introduce faculty and helpers
What is p5.js?
What is p5.js
It is a JavaScript library and online editor.
Where will I ever see JavaScript?
On almost every single web page out there.
Why not just do JavaScript?
It’s a little tough to get started in.
p5.js gives you a running start.
We’ll talk some about using JavaScript without p5.js a little bit tomorrow.
JavaScript in the Wild
Part of a typical web page:
HTML - Structure
(sometimes generated with php)
CSS - Style
JavaScript - Behavior
Server/client
So this is only web programming?
Make an Account
p5.js starts your sketch for you..
You can change this if you want.
Runs once
Loops
Saving and Running Programs
Must have an account to save.
Running
Saving
Auto-Refresh
Sharing
Review Video Zero
Review Video 1
0:00 Error messages
0:20 The Console
1:15 Case Sensitivity
2:09 Drawing a Rectangle: rect()
2:22 p5.js Reference
3:28 Rectangle Parameters
4:32 Drawing Coordinates
6:40 rectMode()
8:24 Color Settings
8:47 fill(), stroke(), & strokeWeight()
9:54 Tidy Code
10:25 Getting mouse locations: mouseX, mouseY
11:28 Draw order - Display one shape on top of another