This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//paste all your code | |
// make sure you don't forget the top or the bottom of your code. if you do that, it won't work. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This sketch draws a row of pink donuts. | |
//donut object | |
var donut = { | |
x:70, | |
y:200, | |
diameter:100, | |
hole:40 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This sketch draws a pink donut that moves across the screen. | |
//donut object | |
var donut = { | |
x:70, | |
y:200, | |
diameter:100, | |
hole:40 | |
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//This sketch draws a pink donut that moves across the screen. | |
//donut object | |
var donut = { | |
x:70, | |
y:200, | |
diameter:100, | |
hole:40, | |
drawDonut: function(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var person = { | |
x: 100, | |
y: 100, | |
drawPerson: function(){ | |
fill(200); | |
stroke(200); | |
ellipse(this.x,this.y,50,50); | |
line(this.x,this.y,this.x,this.y+200); | |
}, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//uses p5.speech.js | |
var myVoice; | |
var sayThis = "Oh hello. I am a computer talking to you."; | |
function setup(){ | |
createCanvas(400, 400); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var button; | |
function setup() { | |
createCanvas(400, 400); | |
background(0); | |
button = createButton('click me'); | |
button.position(19, 19); | |
//object.mousePressed(function() { yourFunction(yourInputs);}); | |
button.mousePressed(function() {makeCircle(random(0,400),random(0,400));}); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//make room for a person, person1, in this sketch. | |
let person1; | |
function setup() { | |
createCanvas(400, 400); | |
person1 = new Person(); //create person1 from the Person class | |
} | |
function draw(){ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create an empty array called people | |
let people = []; | |
function setup() { | |
createCanvas(400, 400); | |
} | |
function draw(){ |