From 63a276dc8f7d3a964ed971077e21d301fc33b7d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=A2=81=E8=8A=B3?= <3231711930@qq.com> Date: Fri, 18 Jun 2021 07:26:37 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AD=90=E5=BC=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- bullet.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bullet.py b/bullet.py index 1302f47..195965d 100644 --- a/bullet.py +++ b/bullet.py @@ -27,4 +27,8 @@ class Bullet(Sprite): # 更新表示子弹位置的小数值 self.y -= self.speed_factor # 更新表示子弹的rect的位置 - self.rect.y = self.y \ No newline at end of file + self.rect.y = self.y + + def draw_bullet(self): + """在屏幕上绘制子弹""" + pygame.draw.rect(self.screen, self.color, self.rect) \ No newline at end of file