拟合僵尸出生点
This commit is contained in:
parent
4e4a33f066
commit
5028f86b03
@ -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'
|
||||
|
||||
@ -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)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user