更新 'bullet.py'
This commit is contained in:
parent
ac50935e91
commit
ccdef31cbe
|
@ -12,12 +12,13 @@ class Bullet(Sprite):
|
|||
self.color = self.settings.bullet_color
|
||||
|
||||
# 在(0,0)处创建一个表示子弹的矩形,再设置正确的位置
|
||||
self.rect = pygame.Rect(0,0,self.settings.buttle_width,
|
||||
self.rect = pygame.Rect(0, 0, self.settings.bullet_width,
|
||||
self.settings.bullet_height)
|
||||
self.rect.midtop = ai_game.ship.rect.midtop
|
||||
|
||||
# 储存用小数表示的子弹位置
|
||||
self.y = float(self.rect.y)
|
||||
|
||||
def update(self):
|
||||
"""向上移动子弹"""
|
||||
# 更新表示子弹位置的小数值
|
||||
|
|
Loading…
Reference in New Issue