修复樱桃炸弹爆炸闪退bug,修复撑杆跳触发土豆雷的bug

This commit is contained in:
星外之神 2022-05-20 11:43:12 +08:00
parent 0ad4597eef
commit cb23817b0d

View File

@ -576,8 +576,8 @@ class CherryBomb(Plant):
return
self.animate_timer = self.current_time
self.image = self.frames[self.frame_index]
self.mask = pg.mask.from_surface(self.image)
self.image = self.frames[self.frame_index]
self.mask = pg.mask.from_surface(self.image)
if (self.current_time - self.highlightTime < 100):
self.image.set_alpha(150)
@ -735,7 +735,7 @@ class PotatoMine(Plant):
self.is_init = False
def canAttack(self, zombie):
if (self.name == c.POLE_VAULTING_ZOMBIE and (not self.jumped)):
if (zombie.name == c.POLE_VAULTING_ZOMBIE and (not zombie.jumped)):
return False
# 这里碰撞应当比碰撞一般更容易就设置成圆形或矩形模式不宜采用mask
elif (pg.sprite.collide_circle_ratio(0.7)(zombie, self) and