From 5028f86b031b4b4def4acd0cad0d97234ea069a1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=98=9F=E5=A4=96=E4=B9=8B=E7=A5=9E?= Date: Mon, 2 May 2022 19:39:01 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8B=9F=E5=90=88=E5=83=B5=E5=B0=B8=E5=87=BA?= =?UTF-8?q?=E7=94=9F=E7=82=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- source/constants.py | 2 +- source/state/level.py | 17 +++++++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/source/constants.py b/source/constants.py index 74a9f2c..cdd7bc1 100755 --- a/source/constants.py +++ b/source/constants.py @@ -302,7 +302,7 @@ ATTACK_INTERVAL = 500 ZOMBIE_WALK_INTERVAL = 60 # 僵尸步行间隔 # 僵尸生成位置 -ZOMBIE_START_X = SCREEN_WIDTH + 50 +ZOMBIE_START_X = SCREEN_WIDTH + 20 # 场宽度不一样,用于拟合 # 状态类型 IDLE = 'idle' diff --git a/source/state/level.py b/source/state/level.py index 0a1e5dd..de14100 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -637,20 +637,25 @@ class Level(tool.State): else: map_y = randint(0, 4) - # 新增的僵尸也需要在这里声明 + # 旗帜波出生点右移 + if self.waveNum % 10: + hugeWaveMove = 40 + else: + hugeWaveMove = 0 x, y = self.map.getMapGridPos(0, map_y) + # 新增的僵尸也需要在这里声明 if name == c.NORMAL_ZOMBIE: - self.zombie_groups[map_y].add(zombie.NormalZombie(c.ZOMBIE_START_X, y, self.head_group)) + self.zombie_groups[map_y].add(zombie.NormalZombie(c.ZOMBIE_START_X + randint(-10, 20) + hugeWaveMove, y, self.head_group)) elif name == c.CONEHEAD_ZOMBIE: - self.zombie_groups[map_y].add(zombie.ConeHeadZombie(c.ZOMBIE_START_X, y, self.head_group)) + self.zombie_groups[map_y].add(zombie.ConeHeadZombie(c.ZOMBIE_START_X + randint(-10, 20) + hugeWaveMove, y, self.head_group)) elif name == c.BUCKETHEAD_ZOMBIE: - self.zombie_groups[map_y].add(zombie.BucketHeadZombie(c.ZOMBIE_START_X, y, self.head_group)) + self.zombie_groups[map_y].add(zombie.BucketHeadZombie(c.ZOMBIE_START_X + randint(-10, 20) + hugeWaveMove, y, self.head_group)) elif name == c.FLAG_ZOMBIE: self.zombie_groups[map_y].add(zombie.FlagZombie(c.ZOMBIE_START_X, y, self.head_group)) elif name == c.NEWSPAPER_ZOMBIE: - self.zombie_groups[map_y].add(zombie.NewspaperZombie(c.ZOMBIE_START_X, y, self.head_group)) + self.zombie_groups[map_y].add(zombie.NewspaperZombie(c.ZOMBIE_START_X + randint(-10, 20) + hugeWaveMove, y, self.head_group)) elif name == c.FOOTBALL_ZOMBIE: - self.zombie_groups[map_y].add(zombie.FootballZombie(c.ZOMBIE_START_X, y, self.head_group)) + self.zombie_groups[map_y].add(zombie.FootballZombie(c.ZOMBIE_START_X + randint(-10, 20) + hugeWaveMove, y, self.head_group)) # 能否种植物的判断: # 先判断位置是否合法 isValid(map_x, map_y)