Skip to content

Commit 323b53d

Browse files
Jim Lystgitbook-bot
authored andcommitted
GitBook: [master] one page modified
1 parent 3829550 commit 323b53d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

docs/advanced/code-mod-examples/animation-spinning-block.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -71,15 +71,15 @@ function ballInBox() {
7171
//balloons rising to the top
7272
function balloons() {
7373
background("gray");
74-
var sFrame = floor(frameCount/100)*100; //starting frame for looping
75-
for (var i=0; i<10; i++ ) { //let's do 10 balloons
76-
randomSeed(1000*i + 2); //ensures a repeatable random #
77-
var y = int(random(height) - (frameCount - sFrame));
78-
randomSeed(3000*i + 1); //ensures another repeatable random #
74+
var sFrame = floor(frameCount / (4*height))*4*height; //starting frame for looping
75+
for (var i = 0; i < 30; i++) { //let's do 30 balloons
76+
randomSeed(10510 * i + 2); //ensures a repeatable random #
77+
var y = int(random(height*4) - (frameCount - sFrame)/2);
78+
randomSeed(30260 * i + 1); //ensures another repeatable random #
7979
var x = int(random(width));
8080
fill("red");
81-
line(x,y,x,y+30);//balloon string
82-
ellipse(x,y,10,15);//balloon
81+
line(x, y, x, y + 30);//balloon string
82+
ellipse(x, y, 10, 15);//balloon
8383
}
8484
}
8585
```

0 commit comments

Comments
 (0)