完善小推车设置
This commit is contained in:
parent
9fa8fbb847
commit
ce62e9b35c
@ -22,7 +22,7 @@ class Car(pg.sprite.Sprite):
|
|||||||
def update(self, game_info):
|
def update(self, game_info):
|
||||||
self.current_time = game_info[c.CURRENT_TIME]
|
self.current_time = game_info[c.CURRENT_TIME]
|
||||||
if self.state == c.WALK:
|
if self.state == c.WALK:
|
||||||
self.rect.x += 6
|
self.rect.x += 5
|
||||||
if self.rect.x > c.SCREEN_WIDTH + 25:
|
if self.rect.x > c.SCREEN_WIDTH + 25:
|
||||||
self.dead = True
|
self.dead = True
|
||||||
|
|
||||||
|
|||||||
@ -1182,7 +1182,8 @@ class Level(tool.State):
|
|||||||
if (zombie and zombie.state != c.DIE and (not zombie.losthead)
|
if (zombie and zombie.state != c.DIE and (not zombie.losthead)
|
||||||
and (pg.sprite.collide_mask(zombie, self.cars[i]))):
|
and (pg.sprite.collide_mask(zombie, self.cars[i]))):
|
||||||
self.cars[i].setWalk()
|
self.cars[i].setWalk()
|
||||||
if pg.sprite.collide_mask(zombie, self.cars[i]):
|
if (pg.sprite.collide_mask(zombie, self.cars[i]) or
|
||||||
|
self.cars[i].rect.x <= zombie.rect.centerx <= self.cars[i].rect.right):
|
||||||
zombie.health = 0
|
zombie.health = 0
|
||||||
if self.cars[i].dead:
|
if self.cars[i].dead:
|
||||||
self.cars[i] = None
|
self.cars[i] = None
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user