From 8fba77d1c0931e0da99d7964dac8ec347e69ec4f Mon Sep 17 00:00:00 2001 From: chicrobot Date: Sun, 26 Jul 2026 01:34:29 +0800 Subject: [PATCH] =?UTF-8?q?=E5=9F=BA=E7=A1=80=E7=AA=97=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- start.py | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 start.py diff --git a/start.py b/start.py new file mode 100644 index 0000000..b618385 --- /dev/null +++ b/start.py @@ -0,0 +1,38 @@ +import pygame + +# 初始化 +pygame.init() + +# 设置窗口大小 +window_size = (1920/2, 1080/2) +screen = pygame.display.set_mode(window_size) + +# 设置标题 +pygame.display.set_caption("Test Name") + +rect = [10,20,30,40] +black = (0,0,0) +white = (255,255,255) + +def update(): + pass + +def main(): + # 运行循环 + running = True + while running: + # 事件处理 + for event in pygame.event.get(): + # 检查是否关闭 + if event.type == pygame.QUIT: + running = False + + screen.fill(black) + + pygame.draw.rect(screen, white, rect) + + # 更新显示 + pygame.display.update() + +if __name__ == "__main__": + main() \ No newline at end of file