FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

Merge pull request #1722 from ybakos/p5_web_45_examples_Handbook278 · pif/processing@485fdae · GitHub

Repository navigation

Commit 485fdae

Browse files
committed
Merge pull request processing#1722 from ybakos/p5_web_45_examples_Handbook278
Examples patch (6 of 9)
2 parents 664a869 + ce47971 commit 485fdae

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

  • java/examples/Books/Processing Handbook/Illustrations/page_278

‎java/examples/Books/Processing Handbook/Illustrations/page_278/page_278.pde‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,10 @@ void setup() {
99
//size(200, 200);
1010
smooth();
1111
noStroke();
12-
ellipseMode(CENTER_RADIUS);
12+
ellipseMode(RADIUS);
1313
randomSeed(0);
1414
for(int i=0; i<sps.length; i++) {
15-
sps[i] = new Spot();
15+
sps[i] = new Spot();
1616
}
1717
}
1818

@@ -21,12 +21,12 @@ void draw() {
2121
rect(0, 0, width, height);
2222
fill(0);
2323
for(int i=0; i<sps.length; i++) {
24-
sps[i].updateDisplay();
24+
sps[i].updateDisplay();
2525
}
2626
}
2727

2828
void mousePressed() {
29-
save("page_278.tif");
29+
save("page_278.tif");
3030
}
3131

3232

@@ -46,18 +46,18 @@ class Spot {
4646
if (r < .25) {
4747
directionX = 1;
4848
directionY = 1;
49-
}
49+
}
5050
else if (r < .5) {
5151
directionX = -1;
52-
directionY = 1;
53-
}
52+
directionY = 1;
53+
}
5454
else if (r < .75) {
5555
directionX = 1;
56-
directionY = -1;
57-
}
56+
directionY = -1;
57+
}
5858
else {
5959
directionX = -1;
60-
directionY = -1;
60+
directionY = -1;
6161
}
6262
}
6363

0 commit comments

Comments
 (0)

Back | FazBrowse Home | New Git URL