Skip to content

Commit

Permalink
adding inclass
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauren McCarthy committed Sep 29, 2015
1 parent 6f215b2 commit 878c7f0
Show file tree
Hide file tree
Showing 31 changed files with 214,669 additions and 22 deletions.
46 changes: 24 additions & 22 deletions 03_interaction/mousePressed_vs_mouseIsPressed/sketch.js
Expand Up @@ -2,19 +2,19 @@
// the state of it gets checked every time draw is called
// so the ellipse keeps growing as you hold down the mouse

var d = 10;
// var d = 10;

function setup() {
createCanvas(600, 400);
}
// function setup() {
// createCanvas(600, 400);
// }

function draw() {
background(200);
if (mouseIsPressed) {
d++;
}
ellipse(width/2, height/2, d, d);
}
// function draw() {
// background(200);
// if (mouseIsPressed) {
// d++;
// }
// ellipse(width/2, height/2, d, d);
// }

// compare to below!
// mousePressed is a function that gets called
Expand All @@ -23,17 +23,19 @@ function draw() {
// again to keep increasing the size.


// var d = 10;
var d = "hello";

function setup() {
createCanvas(600, 400);
}

function draw() {
background(200);
text(d, 50, 50);
print("ab" > "ae");
print("ab" < "ae");
}


// function setup() {
// createCanvas(600, 400);
// }

// function draw() {
// background(200);
// ellipse(width/2, height/2, d, d);
// }

// function mousePressed() {
// d++;
// }
17 changes: 17 additions & 0 deletions 04_functions/lauren_inclass/modularity/index.html
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>modularity</title>
<script src="libraries/p5.js" type="text/javascript"></script>

<script src="libraries/p5.dom.js" type="text/javascript"></script>
<script src="libraries/p5.sound.js" type="text/javascript"></script>

<script src="sketch.js" type="text/javascript"></script>

<style> body {padding: 0; margin: 0;} canvas {vertical-align: top;} </style>
</head>
<body>
</body>
</html>

0 comments on commit 878c7f0

Please sign in to comment.