绘制矩形并使用上下左右wasd控制并限制活动区域 #2

Merged
chicrobot merged 4 commits from fature-zhiyuan into develop 2026-07-27 22:39:37 +08:00
2 changed files with 7 additions and 0 deletions
Showing only changes of commit 876645f4b0 - Show all commits

No files matched your search

Binary file not shown.
+7
View File
@@ -11,6 +11,9 @@ import pygame
# 初始化pygame
pygame.init()
# 初始化音乐
pygame.mixer.init()
# 设置窗口大小
size = (800, 600)
screen = pygame.display.set_mode(size)
@@ -18,6 +21,10 @@ screen = pygame.display.set_mode(size)
# 窗口名称
pygame.display.set_caption("New_game")
# 播放并循环音乐
pygame.mixer_music.load(r'D:\python_project\Game_project\file\vespidaze-upbeat-rpg-battle-460971.mp3')
pygame.mixer_music.play(-1)
# 状态值
dirty_x = 400
dirty_y = 300