diff --git a/resources/graphics/Plants/WallNut/RedWallNutBowling/RedWallNutBowling_0.png b/resources/graphics/Plants/WallNut/RedWallNutBowling/RedWallNutBowling_0.png index f9f5a27..387aa37 100644 Binary files a/resources/graphics/Plants/WallNut/RedWallNutBowling/RedWallNutBowling_0.png and b/resources/graphics/Plants/WallNut/RedWallNutBowling/RedWallNutBowling_0.png differ diff --git a/resources/graphics/Plants/WallNut/RedWallNutBowlingExplode/RedWallNutBowlingExplode_0.png b/resources/graphics/Plants/WallNut/RedWallNutBowlingExplode/RedWallNutBowlingExplode_0.png deleted file mode 100644 index 0286674..0000000 Binary files a/resources/graphics/Plants/WallNut/RedWallNutBowlingExplode/RedWallNutBowlingExplode_0.png and /dev/null differ diff --git a/source/component/plant.py b/source/component/plant.py index b4094e3..218d1a4 100755 --- a/source/component/plant.py +++ b/source/component/plant.py @@ -548,7 +548,7 @@ class CherryBomb(Plant): self.explode_x_range = c.GRID_X_SIZE * 1.5 def setBoom(self): - frame = tool.GFX[c.CHERRY_BOOM_IMAGE] + frame = tool.GFX[c.BOOM_IMAGE] rect = frame.get_rect() width, height = rect.w, rect.h @@ -1232,16 +1232,12 @@ class RedWallNutBowling(Plant): def loadImages(self, name, scale): self.idle_frames = [] - self.explode_frames = [] + self.loadFrames(self.idle_frames, name, 1) - idle_name = name - explode_name = name + 'Explode' - - frame_list = [self.idle_frames, self.explode_frames] - name_list = [idle_name, explode_name] - - for i, name in enumerate(name_list): - self.loadFrames(frame_list[i], name, 1, c.WHITE) + frame = tool.GFX[c.BOOM_IMAGE] + rect = frame.get_rect() + image = tool.get_image(frame, 0, 0, rect.w, rect.h) + self.explode_frames = (image, ) self.frames = self.idle_frames diff --git a/source/constants.py b/source/constants.py index 2cf36e0..2b6323f 100755 --- a/source/constants.py +++ b/source/constants.py @@ -244,6 +244,7 @@ NON_PLANT_OBJECTS = { # 植物相关信息 PLANT_IMAGE_RECT = 'plant_image_rect' +BOOM_IMAGE = 'Boom' # 植物卡片信息汇总(包括植物名称, 卡片名称, 阳光, 冷却时间) PLANT_CARD_INFO = (# 元组 (植物名称, 卡片名称, 阳光, 冷却时间) @@ -420,7 +421,7 @@ PLANT_COLOR_KEY_WHITE = { JALAPENO, SCAREDYSHROOM, SUNSHROOM, ICESHROOM, HYPNOSHROOM, SQUASH, - WALLNUTBOWLING, REDWALLNUTBOWLING, + WALLNUTBOWLING, } # 直接水生植物 diff --git a/source/state/level.py b/source/state/level.py index 4fb2685..2ce38e0 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -1506,7 +1506,16 @@ class Level(tool.State): # 画僵尸头 surface.blit(self.level_progress_zombie_head_image, self.level_progress_zombie_head_image_rect) - def showCurrentVolumeImage(self, surface): + def showAllContentOfMenu(self, surface): + # 绘制不可变内容 + surface.blit(self.big_menu, self.big_menu_rect) + surface.blit(self.return_button, self.return_button_rect) + surface.blit(self.restart_button, self.restart_button_rect) + surface.blit(self.mainMenu_button, self.mainMenu_button_rect) + surface.blit(self.sound_volume_minus_button, self.sound_volume_minus_button_rect) + surface.blit(self.sound_volume_plus_button, self.sound_volume_plus_button_rect) + + # 显示当前音量 # 由于音量可变,因此这一内容不能在一开始就结束加载,而应当不断刷新不断显示 font = pg.font.Font(c.FONT_PATH, 30) volume_tips = font.render(f"音量:{round(self.game_info[c.SOUND_VOLUME]*100):3}%", True, c.LIGHTGRAY) @@ -1523,11 +1532,7 @@ class Level(tool.State): # 画小菜单 surface.blit(self.little_menu, self.little_menu_rect) if self.showLittleMenu: - surface.blit(self.big_menu, self.big_menu_rect) - surface.blit(self.return_button, self.return_button_rect) - surface.blit(self.restart_button, self.restart_button_rect) - surface.blit(self.mainMenu_button, self.mainMenu_button_rect) - self.showCurrentVolumeImage() + self.showAllContentOfMenu(surface) # 以后可能需要插入一个预备的状态(预览显示僵尸、返回战场) elif self.state == c.PLAY: if self.hasShovel: @@ -1556,13 +1561,7 @@ class Level(tool.State): self.drawMouseShowPlus(surface) if self.showLittleMenu: - surface.blit(self.big_menu, self.big_menu_rect) - surface.blit(self.return_button, self.return_button_rect) - surface.blit(self.restart_button, self.restart_button_rect) - surface.blit(self.mainMenu_button, self.mainMenu_button_rect) - surface.blit(self.sound_volume_minus_button, self.sound_volume_minus_button_rect) - surface.blit(self.sound_volume_plus_button, self.sound_volume_plus_button_rect) - self.showCurrentVolumeImage(surface) + self.showAllContentOfMenu(surface) if self.map_data[c.SPAWN_ZOMBIES] == c.SPAWN_ZOMBIES_AUTO: self.showLevelProgress(surface)