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