Creative Coding/Trajectory
From I/M/D Wiki
More actions
Do you know...
Class #01
Interface
- how to open P5
- how to save and share a P5 sketch
- how to upload it in Excalidraw
Functions (beginner)
- the difference between
setup()anddraw() - how to use shape functions
- how to use color functions
- how to use
map()andsin()
Variables (beginner)
- how to use an environment variable (e.g.
width,height,mouseX,mouseY,frameCount, etc) - how to declare a variable (e.g.
let x = 0) - how to change a variable using an operator (e.g.
x++,x = x - 2,x = mouseX, etc) - how to use variables as arguments of a function (e.g.
circle(mouseX, mouseY, s))
Dynamic Portrait
- how to use the previous concepts to make a dynamic portrait
Class #02
Functions (medium)
- how to use text functions
- how to load and display images
- how to load and display fonts
- how to use
random()
Variables (medium)
- how to run a modulo cycle (e.g.
x = (x + 1) % 400)
Conditions
- how to write an if statement
- how to write an if-else statement
- how to use booleans (
mouseIsPressed,mouseIsClicked) - how to create booleans (e.g.
let state = false) - how to use mouse coordinates as a condition (e.g.
if(mouseX > width/2){...})
Interactive poem
- how to combine conditions and text functions to create an interactive poem
Class #03
Variables (Advanced)
- how to create lists (e.g.
let list = ["cat", "dog", "potato"]) - how to use a variable from a list (e.g.
text(list[0], width/2, height/2)) - how to load json dictionaries
- how to create your own json dictionary
- how to use an index variable (e.g.
list[i])
Functions (Advanced)
- how to use
mouseClicked(),keyPressed()andkeyReleased() - how to declare a new function (e.g.
function myFunction() {...}) - how to use
createButton()andbutton.mousePressed(callback)
Loops
- how to make a for loop (e.g.
for (x = 0; x < width; x+= 50) {...}) - how to use a for loop with a list (e.g.
for (element of list) {...})
One-button Game
- how to combine these to create a digital experience constrained to one button only