From f057771c60846f78fbf4abf96e42d3563cbf1859 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Sun, 17 Apr 2022 21:23:06 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8E=89=E5=A4=B4=E5=83=B5=E5=B0=B8=E5=81=87?= =?UTF-8?q?=E6=94=BB=E5=87=BB=E4=B8=8D=E5=86=8D=E8=A7=A6=E5=8F=91=E6=A4=8D?= =?UTF-8?q?=E7=89=A9=E9=AB=98=E4=BA=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/component/zombie.py | 2 +- source/state/level.py | 7 +++---- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/source/component/zombie.py b/source/component/zombie.py index 671d5b6..6b5b494 100755 --- a/source/component/zombie.py +++ b/source/component/zombie.py @@ -108,7 +108,7 @@ class Zombie(pg.sprite.Sprite): self.helmetType2 = False if self.name == c.NEWSPAPER_ZOMBIE: self.speed = 2.5 - if (self.current_time - self.attack_timer) > (c.ATTACK_INTERVAL * self.getAttackTimeRatio()): + if ((self.current_time - self.attack_timer) > (c.ATTACK_INTERVAL * self.getAttackTimeRatio())) and not self.lostHead: if self.prey.health > 0: if self.prey_is_plant: self.prey.setDamage(self.damage, self) diff --git a/source/state/level.py b/source/state/level.py index 58a0660..8ab4d95 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -23,13 +23,12 @@ class Level(tool.State): # 默认显然不用显示菜单 self.showLittleMenu = False + # 导入地图参数 self.loadMap() - self.setupBackground() - self.initState() - - # 可以给map加一个地图类型参数 self.map = map.Map(self.map_data[c.BACKGROUND_TYPE]) self.map_y_len = self.map.height + self.setupBackground() + self.initState() def loadMap(self): if c.LITTLEGAME_BUTTON in self.game_info and self.game_info[c.LITTLEGAME_BUTTON]: