修改分辨率

This commit is contained in:
chicrobot committed 2026-08-05 01:58:40 +08:00
1 parent 87d5696ddb
commit 7ecdc5dc5a
2 files changed
+10 -10

No files matched your search

+2 -2
View File
@@ -3,8 +3,8 @@ import os
class GameConfig: class GameConfig:
game_name = "Test Game" game_name = "Test Game"
window_x = 1920/2 window_x = 1920
window_y = 1080/2 window_y = 1080
bg_color = (0, 0, 0) bg_color = (0, 0, 0)
def data_path(): def data_path():
+8 -8
View File
@@ -29,7 +29,7 @@ class MainMenuScene(BaseScene):
# 设置字体 # 设置字体
font_file = os.path.join(data_path(),"Dymon-ShouXieTi.otf") font_file = os.path.join(data_path(),"Dymon-ShouXieTi.otf")
self.font = pygame.font.Font(font_file,16) self.font = pygame.font.Font(font_file,32)
self.text_rect_list = [] self.text_rect_list = []
self.__init_text_list() self.__init_text_list()
@@ -225,26 +225,26 @@ class MainMenuScene(BaseScene):
# 当状态在区间1时绘制雨滴线条 # 当状态在区间1时绘制雨滴线条
if rain["status"] <= self.rain_live_max - 3: if rain["status"] <= self.rain_live_max - 3:
# 设计高度 # 设计高度
rain_high = 10 * self.rain_live_max rain_high = 10 * self.rain_live_max * 2
# 起点位置 # 起点位置
# x坐标与最后落点x一致 # x坐标与最后落点x一致
x = rain["dest"][0] x = rain["dest"][0]
# y坐标为落点位置向上移动设计高度后,加上生命周期去掉尾帧后落下的位置 # y坐标为落点位置向上移动设计高度后,加上生命周期落下的位置
y = (rain["dest"][1] - rain_high) + (rain["status"] * (self.rain_live_max + 2)) y = (rain["dest"][1] - rain_high) + (rain["status"] * self.rain_live_max) * 2
y2 = y + 10 y2 = y + 20
line_start_point = (x, y) line_start_point = (x, y)
line_end_point = (x, y2) line_end_point = (x, y2)
pygame.draw.line(self.screen, Color.white, line_start_point, line_end_point, 1) pygame.draw.line(self.screen, Color.white, line_start_point, line_end_point, 1)
# 状态在区间2时绘制涟漪 # 状态在区间2时绘制涟漪
elif self.rain_live_max - 3 < rain["status"]: elif self.rain_live_max - 6 < rain["status"]:
point_width = rain["status"] - (self.rain_live_max - 3) point_width = (rain["status"] - (self.rain_live_max - 3)) * 2
pygame.draw.circle(self.screen, Color.white, rain["dest"], point_width, 1) pygame.draw.circle(self.screen, Color.white, rain["dest"], point_width, 1)
# # 椭圆 # # 椭圆
# rain_point_rect = [rain["dest"][0], rain["dest"][1], rain["status"], rain["status"]] # rain_point_rect = [rain["dest"][0], rain["dest"][1], rain["status"], rain["status"]]
# pygame.draw.ellipse(self.screen, Color.white, rain_point_rect, 1) # pygame.draw.ellipse(self.screen, Color.white, rain_point_rect, 1)
# 雨滴状态每d_status毫秒变化一次 # 雨滴状态每d_status毫秒变化一次
d_status = 30 d_status = 1000/30
if rain["timer"] > d_status: if rain["timer"] > d_status:
rain["status"] += 1 rain["status"] += 1
rain["timer"] -= d_status # 不设为0,避免累计时间误差 rain["timer"] -= d_status # 不设为0,避免累计时间误差