質問編集履歴
4
説明の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
|
1
|
+
dirとspeedの引数をball = Ball(ball_color, ball_rect, 320, 10)と合わせたいのですがどうすればいいでしょう
|
2
2
|
```
|
3
3
|
import sys
|
4
4
|
import pygame
|
3
説明の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,11 +12,11 @@
|
|
12
12
|
FPSCLOCK = pygame.time.Clock()
|
13
13
|
|
14
14
|
class Block:
|
15
|
-
def __init__(self, color, rect
|
15
|
+
def __init__(self, color, rect):
|
16
16
|
self.color = color
|
17
17
|
self.rect = rect
|
18
|
-
|
18
|
+
|
19
|
-
|
19
|
+
|
20
20
|
def draw(self):
|
21
21
|
pygame.draw.rect(SURFACE, self.color, self.rect)
|
22
22
|
class Ball:
|
@@ -24,7 +24,7 @@
|
|
24
24
|
self.color = color
|
25
25
|
self.rect = rect
|
26
26
|
self.dir = 320
|
27
|
-
|
27
|
+
|
28
28
|
def draw(self):
|
29
29
|
pygame.draw.ellipse(SURFACE, self.color, self.rect)
|
30
30
|
|
2
説明の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -12,10 +12,11 @@
|
|
12
12
|
FPSCLOCK = pygame.time.Clock()
|
13
13
|
|
14
14
|
class Block:
|
15
|
-
def __init__(self, color, rect):
|
15
|
+
def __init__(self, color, rect,dir=320,speed=10):
|
16
16
|
self.color = color
|
17
17
|
self.rect = rect
|
18
|
-
|
18
|
+
self.dir = dir
|
19
|
+
self.speed = speed
|
19
20
|
def draw(self):
|
20
21
|
pygame.draw.rect(SURFACE, self.color, self.rect)
|
21
22
|
class Ball:
|
1
説明の追加
title
CHANGED
File without changes
|
body
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
Ballの引数を5つにしなければならないのでしょうか?やり方を教えてください。
|
1
2
|
```
|
2
3
|
import sys
|
3
4
|
import pygame
|