回答編集履歴
3
1200
test
CHANGED
@@ -20,7 +20,7 @@
|
|
20
20
|
int score;
|
21
21
|
|
22
22
|
void setup() {
|
23
|
-
size(1200, 100
|
23
|
+
size(1200, 1200);
|
24
24
|
smooth();
|
25
25
|
noStroke();
|
26
26
|
|
@@ -39,7 +39,7 @@
|
|
39
39
|
|
40
40
|
// 2点(mouseX, mouseY)と(x, y)の距離が円の半径以内なら...
|
41
41
|
if (dist(mouseX, mouseY, x, y) <= 40) {
|
42
|
-
|
42
|
+
//if (mouseX>x-50 && mouseX<x+50 && mouseY>y-50 && mouseY<y+50) {
|
43
43
|
|
44
44
|
score += 10;
|
45
45
|
kasoku += 0.01;
|
2
game over
test
CHANGED
@@ -20,16 +20,16 @@
|
|
20
20
|
int score;
|
21
21
|
|
22
22
|
void setup() {
|
23
|
-
size(1200, 1
|
23
|
+
size(1200, 1000);
|
24
24
|
smooth();
|
25
25
|
noStroke();
|
26
|
-
|
26
|
+
|
27
27
|
reset();
|
28
28
|
}
|
29
29
|
|
30
30
|
void draw() {
|
31
31
|
background(0);
|
32
|
-
|
32
|
+
|
33
33
|
speed += GRAVITY / 60 + kasoku;
|
34
34
|
y += speed;
|
35
35
|
|
@@ -39,8 +39,8 @@
|
|
39
39
|
|
40
40
|
// 2点(mouseX, mouseY)と(x, y)の距離が円の半径以内なら...
|
41
41
|
if (dist(mouseX, mouseY, x, y) <= 40) {
|
42
|
-
//if (mouseX>x-50 && mouseX<x+50 && mouseY>y-50 && mouseY<y+50) {
|
42
|
+
//if (mouseX>x-50 && mouseX<x+50 && mouseY>y-50 && mouseY<y+50) {
|
43
|
-
|
43
|
+
|
44
44
|
score += 10;
|
45
45
|
kasoku += 0.01;
|
46
46
|
reset();
|
@@ -49,7 +49,7 @@
|
|
49
49
|
goodx = mouseX;
|
50
50
|
goody = mouseY;
|
51
51
|
}
|
52
|
-
|
52
|
+
|
53
53
|
if (0 < bingo) {
|
54
54
|
textSize(24);
|
55
55
|
fill(255);
|
@@ -57,6 +57,18 @@
|
|
57
57
|
bingo--;
|
58
58
|
//score += 0;
|
59
59
|
}
|
60
|
+
|
61
|
+
if (height + 40 < y) {
|
62
|
+
textAlign(CENTER, CENTER); // 中央表示
|
63
|
+
text("game over", 0, 0, width, height);
|
64
|
+
textAlign(LEFT, BASELINE); // 元に戻す
|
65
|
+
}
|
66
|
+
}
|
67
|
+
|
68
|
+
void mouseClicked() {
|
69
|
+
score = 0;
|
70
|
+
kasoku = 0;
|
71
|
+
reset();
|
60
72
|
}
|
61
73
|
|
62
74
|
void reset() {
|
1
スペース
test
CHANGED
@@ -37,7 +37,7 @@
|
|
37
37
|
ellipse(x, y, 80, 80);
|
38
38
|
scoreDisp();
|
39
39
|
|
40
|
-
// 2点(mouseX, mouseY)と(x, y)の距離が円の半径以内なら...
|
40
|
+
// 2点(mouseX, mouseY)と(x, y)の距離が円の半径以内なら...
|
41
41
|
if (dist(mouseX, mouseY, x, y) <= 40) {
|
42
42
|
//if (mouseX>x-50 && mouseX<x+50 && mouseY>y-50 && mouseY<y+50) {
|
43
43
|
|