From 188be1a67832a9c2d00e3bc3b9e7db7dc2fe3a36 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:55:48 +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 | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/bullet.py b/bullet.py index f881020..0da35b8 100644 --- a/bullet.py +++ b/bullet.py @@ -48,4 +48,14 @@ class BossBullet(Sprite): self.rect.x = bossalien.x self.rect.y = bossalien.rect.bottom self.width = ai_settings.bossbullet_width + self.height = ai_settings.bossbullet_height + + # 存储用小数表示的子弹位置 + self.y = float(self.rect.y) + + self.y = bossalien.rect.bottom + self.x = bossalien.x + + self.color = ai_settings.bossbullet_color + self.speed_factor = ai_settings.bossbullet_speed_factor self.height = ai_settings.bossbullet_height \ No newline at end of file