优化土豆雷音效

This commit is contained in:
星外之神 2022-05-05 23:23:55 +08:00
parent 9ea76dce22
commit d5080c194d

View File

@ -660,11 +660,11 @@ class PotatoMine(Plant):
def attacking(self): def attacking(self):
if self.bomb_timer == 0: if self.bomb_timer == 0:
self.bomb_timer = self.current_time self.bomb_timer = self.current_time
# 播放音效
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "potatomine.ogg")).play()
self.changeFrames(self.explode_frames) self.changeFrames(self.explode_frames)
elif (self.current_time - self.bomb_timer) > 500: elif (self.current_time - self.bomb_timer) > 500:
self.health = 0 self.health = 0
# 播放音效
pg.mixer.Sound(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "sound", "potatomine.ogg")).play()
class Squash(Plant): class Squash(Plant):