修复僵尸贴图显示异常的bug

This commit is contained in:
星外之神 2022-04-28 13:31:59 +08:00
parent 32e57c4136
commit 3792870cf3
3 changed files with 8 additions and 9 deletions

View File

@ -99,6 +99,8 @@ nuitka --mingw --standalone --onefile --show-progress --show-memory --output-dir
* 目前的设想与原版不同,在完成两轮冒险模式(初始冒险模式 + 戴夫选关的冒险模式)后可以自主选关~~(当然现在只是画饼)~~ * 目前的设想与原版不同,在完成两轮冒险模式(初始冒险模式 + 戴夫选关的冒险模式)后可以自主选关~~(当然现在只是画饼)~~
* 更改僵尸生成方式 * 更改僵尸生成方式
* 使僵尸生成更随机化由JSON记录改为随机数生成 * 使僵尸生成更随机化由JSON记录改为随机数生成
* 使用原版设定每面旗帜出10波僵尸9个小波1个大波
* 采用手机版设定无尽模式没有红眼计数和变速设定每波红眼权重为1000平均分布
* 增加僵尸死亡后有概率掉落奖励的机制 * 增加僵尸死亡后有概率掉落奖励的机制
* 增加更多植物、僵尸类型与游戏功能、模式,尽量符合原版基本设计 * 增加更多植物、僵尸类型与游戏功能、模式,尽量符合原版基本设计
* 细分伤害种类 * 细分伤害种类

View File

@ -53,7 +53,6 @@ class Zombie(pg.sprite.Sprite):
if name in tool.ZOMBIE_RECT: if name in tool.ZOMBIE_RECT:
data = tool.ZOMBIE_RECT[name] data = tool.ZOMBIE_RECT[name]
x, width = data['x'], data['width'] x, width = data['x'], data['width']
width -= x
else: else:
x = 0 x = 0
for frame in frame_list: for frame in frame_list:

View File

@ -357,6 +357,7 @@ class Level(tool.State):
pg.mixer.music.play(-1, 0) pg.mixer.music.play(-1, 0)
return return
# 旧僵尸生成方式
if self.zombie_start_time == 0: if self.zombie_start_time == 0:
self.zombie_start_time = self.current_time self.zombie_start_time = self.current_time
elif len(self.zombie_list) > 0: elif len(self.zombie_list) > 0:
@ -474,19 +475,16 @@ class Level(tool.State):
zombieList += newZombie zombieList += newZombie
volume -= self.createZombieInfo[newZombie][0] volume -= self.createZombieInfo[newZombie][0]
if volume < 0: if volume < 0:
volume = 0 # 避免手动指定的最后一个僵尸被while循环的else删除
print('警告:第{}波中手动设置的僵尸级别总数超过上限!'.format(wave)) print('警告:第{}波中手动设置的僵尸级别总数超过上限!'.format(wave))
while (volume >= 0) and (len(zombieList) <= 50): while (volume > 0) and (len(zombieList) < 50):
newZombie = choices(useableZombies, weights) # 注意这个的输出是列表 newZombie = choices(useableZombies, weights) # 注意这个的输出是列表
if self.createZombieInfo[newZombie][0] <= volume:
zombieList += newZombie zombieList += newZombie
volume -= self.createZombieInfo[newZombie][0] volume -= self.createZombieInfo[newZombie][0]
else:
zombieList.pop()
waves.append(zombieList) waves.append(zombieList)
return waves # 输出为分波列出的本关所有波的僵尸 self.waves = waves
def createZombie(self, name, map_y=None): def createZombie(self, name, map_y=None):