Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
p5aholic committed Jun 17, 2017
1 parent b576777 commit 7f87abc
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Chapter13/sketch01/sketch01.pde
Expand Up @@ -14,14 +14,15 @@ color racketC; // 色

void setup() {
size(960, 540);
pixelDensity(displayDensity());
// ボール初期値を設定
for (int i = 0; i < numBalls; i++) {
radius[i] = (int)random(10, 20);
x[i] = random(radius[i], width-radius[i]);
y[i] = random(radius[i], height-radius[i]);
vx[i] = random(-5, 5);
vy[i] = random(-5, 5);
c[i] = color(random(255), random(255), random(255), random(255));
c[i] = color(random(255), random(255), random(255));
}
// ラケットの初期値を設定
racketX = width/2;
Expand Down Expand Up @@ -58,3 +59,9 @@ void draw() {
rectMode(CENTER);
rect(racketX, racketY, racketW, racketH);
}

void keyPressed() {
if (key == 's') {
saveFrame("sketch01.jpg");
}
}

0 comments on commit 7f87abc

Please sign in to comment.