diff --git a/README.md b/README.md index bd70f68..c11638e 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ * 支持分波生成僵尸 * 支持“关卡进程”进度条显示 * 夜晚模式支持墓碑以及从墓碑生成僵尸 - * 含有泳池的模式也支持在最后一波时从泳池中自动冒出僵尸 +* 含有泳池的模式支持在最后一波时从泳池中自动冒出僵尸 * 支持保存进度 * Windows下默认进度文件的保存路径为`~\AppData\Roaming\wszqkzqk.dev\pypvz\userdata.json` * 其他操作系统为`~/.config/wszqkzqk.dev/pypvz/userdata.json` diff --git a/resources/graphics/Screen/sunflowerGolden.png b/resources/graphics/Screen/sunflowerGolden.png new file mode 100644 index 0000000..1d3cf83 Binary files /dev/null and b/resources/graphics/Screen/sunflowerGolden.png differ diff --git a/resources/graphics/Screen/sunflowerSilver.png b/resources/graphics/Screen/sunflowerSilver.png new file mode 100644 index 0000000..7cc6328 Binary files /dev/null and b/resources/graphics/Screen/sunflowerSilver.png differ diff --git a/source/constants.py b/source/constants.py index e34e690..081db46 100755 --- a/source/constants.py +++ b/source/constants.py @@ -66,6 +66,9 @@ RESTART_BUTTON = 'restartButton' MAINMENU_BUTTON = 'mainMenuButton' LITTLEGAME_BUTTON = 'littleGameButton' OPTION_BUTTON = 'optionButton' +# 金银向日葵奖杯 +SILVER_SUNFLOWER = 'sunflowerSilver' +GOLDEN_SUNFLOWER = 'sunflowerGolden' # 小铲子 SHOVEL = 'shovel' SHOVEL_BOX = 'shovelBox' diff --git a/source/state/mainmenu.py b/source/state/mainmenu.py index ceb41f5..f11150e 100644 --- a/source/state/mainmenu.py +++ b/source/state/mainmenu.py @@ -15,6 +15,7 @@ class Menu(tool.State): self.setupBackground() self.setupOptions() self.setupOptionMenu() + self.setupSunflowerTrophy() pg.mixer.music.stop() pg.mixer.music.load(os.path.join(os.path.dirname(os.path.dirname(os.path.dirname(__file__))) ,"resources", "music", "intro.opus")) pg.mixer.music.play(-1, 0) @@ -196,6 +197,18 @@ class Menu(tool.State): self.return_button_rect.y = 440 # 音量+、音量- + + def setupSunflowerTrophy(self): + # 设置金银向日葵图片信息 + frame_rect = (0, 0, 157, 269) + if self.game_info[c.LEVEL_COMPLETIONS]: + if self.game_info[c.LITTLEGAME_COMPLETIONS]: + self.sunflower_trophy = tool.get_image_menu(tool.GFX[c.GOLDEN_SUNFLOWER], *frame_rect, c.BLACK) + else: + self.sunflower_trophy = tool.get_image_menu(tool.GFX[c.SILVER_SUNFLOWER], *frame_rect, c.BLACK) + self.sunflower_trophy_rect = self.sunflower_trophy.get_rect() + self.sunflower_trophy_rect.x = 0 + self.sunflower_trophy_rect.y = 300 def checkOptionButtonClick(self, mouse_pos): x, y = mouse_pos @@ -220,6 +233,8 @@ class Menu(tool.State): surface.blit(self.exit_image, self.exit_rect) surface.blit(self.option_button_image, self.option_button_rect) surface.blit(self.littleGame_image, self.littleGame_rect) + if self.game_info[c.LEVEL_COMPLETIONS]: + surface.blit(self.sunflower_trophy, self.sunflower_trophy_rect) # 点到冒险模式后播放动画 if self.adventure_clicked: diff --git a/source/tool.py b/source/tool.py index 5476cf8..79fe5f1 100755 --- a/source/tool.py +++ b/source/tool.py @@ -66,6 +66,8 @@ class Control(): self.game_info = c.INIT_USERDATA.copy() # 内部全是不可变对象,浅拷贝即可 # 存档内不包含即时游戏时间信息,需要新建 self.game_info[c.CURRENT_TIME] = 0 + + # 50为目前的基础帧率,乘以倍率即是游戏帧率 self.fps = 50 * self.game_info[c.GAME_RATE]