diff --git a/resources/graphics/Items/Background/Background_5.jpg b/resources/graphics/Items/Background/Background_5.jpg new file mode 100644 index 0000000..98f9d7d Binary files /dev/null and b/resources/graphics/Items/Background/Background_5.jpg differ diff --git a/resources/graphics/Screen/Adventure_0.png b/resources/graphics/Screen/Adventure_0.png index 78c12fc..f8e602c 100644 Binary files a/resources/graphics/Screen/Adventure_0.png and b/resources/graphics/Screen/Adventure_0.png differ diff --git a/resources/graphics/Screen/Adventure_1.png b/resources/graphics/Screen/Adventure_1.png index f2825cb..4df6547 100644 Binary files a/resources/graphics/Screen/Adventure_1.png and b/resources/graphics/Screen/Adventure_1.png differ diff --git a/resources/graphics/Screen/exit.png b/resources/graphics/Screen/exit.png index 2a9e218..c0ec1d6 100644 Binary files a/resources/graphics/Screen/exit.png and b/resources/graphics/Screen/exit.png differ diff --git a/resources/graphics/Screen/littleGameButton.png b/resources/graphics/Screen/littleGameButton.png index affaec1..7a4972d 100644 Binary files a/resources/graphics/Screen/littleGameButton.png and b/resources/graphics/Screen/littleGameButton.png differ diff --git a/source/component/menubar.py b/source/component/menubar.py index 44585f8..8179e6a 100755 --- a/source/component/menubar.py +++ b/source/component/menubar.py @@ -132,7 +132,7 @@ class MenuBar(): def __init__(self, card_list, sun_value): self.loadFrame(c.MENUBAR_BACKGROUND) self.rect = self.image.get_rect() - self.rect.x = 10 + self.rect.x = 0 self.rect.y = 0 self.sun_value = sun_value diff --git a/source/state/level.py b/source/state/level.py index 9eb3aa4..f03b679 100644 --- a/source/state/level.py +++ b/source/state/level.py @@ -199,7 +199,7 @@ class Level(tool.State): self.shovel = tool.get_image_menu(tool.GFX[c.SHOVEL], *frame_rect, c.BLACK, 1.1) self.shovel_rect = self.shovel.get_rect() frame_rect = [0, 0, 77, 75] - self.shovel_positon = (550, 2) + self.shovel_positon = (608, 1) self.shovel_box = tool.get_image_menu(tool.GFX[c.SHOVEL_BOX], *frame_rect, c.BLACK, 1.1) self.shovel_box_rect = self.shovel_box.get_rect() self.shovel_rect.x = self.shovel_box_rect.x = self.shovel_positon[0] @@ -213,7 +213,7 @@ class Level(tool.State): frame_rect = [0, 0, 108, 31] self.little_menu = tool.get_image_menu(tool.GFX[c.LITTLE_MENU], *frame_rect, c.BLACK, 1.1) self.little_menu_rect = self.little_menu.get_rect() - self.little_menu_rect.x = 650 + self.little_menu_rect.x = 690 self.little_menu_rect.y = 0 frame_rect = [0, 0, 500, 500] diff --git a/source/state/mainmenu.py b/source/state/mainmenu.py index 8ac797d..43fb3c6 100644 --- a/source/state/mainmenu.py +++ b/source/state/mainmenu.py @@ -29,29 +29,29 @@ class Menu(tool.State): def setupOption(self): self.option_frames = [] frame_names = [c.OPTION_ADVENTURE + '_0', c.OPTION_ADVENTURE + '_1'] - frame_rect = [0, 0, 165, 77] + frame_rect = [0, 0, 330, 140] for name in frame_names: - self.option_frames.append(tool.get_image_menu(tool.GFX[name], *frame_rect, c.BLACK, 1.7)) + self.option_frames.append(tool.get_image_menu(tool.GFX[name], *frame_rect, c.BLACK, 1)) self.option_frame_index = 0 self.option_image = self.option_frames[self.option_frame_index] self.option_rect = self.option_image.get_rect() - self.option_rect.x = 435 - self.option_rect.y = 75 + self.option_rect.x = 400 + self.option_rect.y = 60 # 退出按钮 - frame_rect = [0, 0, 500, 500] + frame_rect = [0, 0, 47, 27] self.option_exit = tool.get_image_menu(tool.GFX[c.EXIT], *frame_rect, c.BLACK, 1.1) self.exit_rect = self.option_exit.get_rect() - self.exit_rect.x = 690 - self.exit_rect.y = 400 + self.exit_rect.x = 730 + self.exit_rect.y = 507 # 小游戏 - frame_rect = [0, 0, 317, 139] - self.option_littleGame = tool.get_image_menu(tool.GFX[c.LITTLEGAME_BUTTON], *frame_rect, c.BLACK, 0.9) + frame_rect = [0, 7, 317, 135] + self.option_littleGame = tool.get_image_menu(tool.GFX[c.LITTLEGAME_BUTTON], *frame_rect, c.BLACK, 1) self.option_littleGame_rect = self.option_littleGame.get_rect() - self.option_littleGame_rect.x = 425 - self.option_littleGame_rect.y = 200 + self.option_littleGame_rect.x = 397 + self.option_littleGame_rect.y = 175 self.option_start = 0 self.option_timer = 0 @@ -68,8 +68,9 @@ class Menu(tool.State): # 点击到按钮,修改转态的done属性 def checkExitClick(self, mouse_pos): x, y = mouse_pos - if(x >= self.exit_rect.x and x <= self.exit_rect.right and - y >= self.exit_rect.y and y <= self.exit_rect.bottom): + # 这里检查范围应当拟合花瓶下部整个区域 + if(x >= self.exit_rect.x - 20 and x <= self.exit_rect.right + 20 and + y >= self.exit_rect.y - 5 and y <= self.exit_rect.bottom + 10): self.done = True self.next = c.EXIT diff --git a/source/tool.py b/source/tool.py index f8777c2..dbd5e36 100755 --- a/source/tool.py +++ b/source/tool.py @@ -81,7 +81,7 @@ class Control(): elif event.type == pg.KEYDOWN: self.keys = pg.key.get_pressed() if event.key == pg.K_f: - SCREEN = pg.display.set_mode(c.SCREEN_SIZE, pg.FULLSCREEN) + SCREEN = pg.display.set_mode(c.SCREEN_SIZE, pg.HWSURFACE|pg.FULLSCREEN) elif event.key == pg.K_u: SCREEN = pg.display.set_mode(c.SCREEN_SIZE) elif event.type == pg.KEYUP: @@ -143,12 +143,12 @@ def load_image_frames(directory, image_name, colorkey, accept): tmp[index]= img frame_num += 1 - for i in range(frame_num): + for i in range(frame_num): # 这里注意编号必须连续,否则会出错 frame_list.append(tmp[i]) return frame_list # colorkeys 是设置图像中的某个颜色值为透明,这里用来消除白边 -def load_all_gfx(directory, colorkey=c.WHITE, accept=('.png', '.jpg', '.bmp', '.gif')): +def load_all_gfx(directory, colorkey=c.WHITE, accept=('.png', '.jpg', '.bmp', '.gif', 'webp')): graphics = {} for name1 in os.listdir(directory): # subfolders under the folder resources\graphics