Skip to content

Commit ed1cb57

Browse files
Refactored Lessons 1 - 3, added templates for 4, and 5.
1 parent ef3e73f commit ed1cb57

File tree

29 files changed

+167252
-169
lines changed

29 files changed

+167252
-169
lines changed

Examples/p5.js

Lines changed: 83507 additions & 0 deletions
Large diffs are not rendered by default.

Examples/p5.min.js

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Lessons/01 Drawing.html

Lines changed: 0 additions & 26 deletions
This file was deleted.

Lessons/01 Drawing/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>p5.js example</title>
7+
<script src="../p5.min.js"></script>
8+
<script src="script.js"></script>
9+
</head>
10+
<body>
11+
</body>
12+
</html>

Lessons/01 Drawing/script.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
function setup() {
2+
createCanvas(1000, 500);
3+
}
4+
5+
function draw() {
6+
// Draw a circle
7+
ellipse(200, 200, 200, 200);
8+
9+
10+
// Draw a square
11+
// rect(200, 200, 200, 200);
12+
13+
14+
// Draw a line
15+
// line(0, 0, 300, 300);
16+
}

Lessons/02 Variables.html

Lines changed: 0 additions & 36 deletions
This file was deleted.

Lessons/02 Variables/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>p5.js example</title>
7+
<script src="../p5.min.js"></script>
8+
<script src="script.js"></script>
9+
</head>
10+
<body>
11+
</body>
12+
</html>

Lessons/02 Variables/script.js

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function setup() {
2+
createCanvas(1000, 500);
3+
}
4+
5+
function draw() {
6+
// x is a variable that holds the value 250
7+
let x = 250;
8+
let y = 200;
9+
let radius = 250;
10+
11+
ellipse(x, y, radius, radius);
12+
13+
14+
// Fill lets us add a color in the RGB format
15+
// fill(0, 255, 100);
16+
// ellipse(x, y, radius, radius);
17+
18+
19+
// We can also use variables for the values
20+
// let red = 0;
21+
// let green = 255;
22+
// let blue = 100;
23+
24+
// fill(red, blue, green);
25+
// ellipse(x, y, radius, radius);
26+
}

Lessons/03 Draw.html

Lines changed: 0 additions & 35 deletions
This file was deleted.

Lessons/03 Draw/index.html

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<!DOCTYPE html>
2+
<html lang="">
3+
<head>
4+
<meta charset="utf-8">
5+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
6+
<title>p5.js example</title>
7+
<script src="../p5.min.js"></script>
8+
<script src="script.js"></script>
9+
</head>
10+
<body>
11+
</body>
12+
</html>

0 commit comments

Comments
 (0)