forked from zhiyuan/Project1
尝试调整结构,添加各项类组
This commit is contained in:
1 parent
f76bbc6442
commit
b581f4def2
3 files changed
+43
-3
No files matched your search
@@ -0,0 +1,13 @@
|
|||||||
|
# -*-coding:utf-8 -*- #
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# ProjectName: Game_project
|
||||||
|
# FileName: colorconf.py
|
||||||
|
# Author: Zhi_yuan
|
||||||
|
# Datetime: 2026/8/7 下午9:21
|
||||||
|
# Description:
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
class Color:
|
||||||
|
def __init__(self):
|
||||||
|
self.white = (255, 255, 255)
|
||||||
|
self.red = (255, 0, 0)
|
||||||
|
self.blue = (0, 0, 255)
|
||||||
@@ -0,0 +1,25 @@
|
|||||||
|
# -*-coding:utf-8 -*- #
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
# ProjectName: Game_project
|
||||||
|
# FileName: pageconf.py
|
||||||
|
# Author: Zhi_yuan
|
||||||
|
# Datetime: 2026/8/7 下午9:34
|
||||||
|
# Description:
|
||||||
|
# ---------------------------------------------------------------------------
|
||||||
|
import pygame
|
||||||
|
|
||||||
|
|
||||||
|
class Page:
|
||||||
|
def __init__(self):
|
||||||
|
# pygame初始化
|
||||||
|
pygame.init()
|
||||||
|
# 音乐模块初始化
|
||||||
|
pygame.mixer.init()
|
||||||
|
# 大小设置
|
||||||
|
size = (800, 600)
|
||||||
|
screen = pygame.display.set_mode(size)
|
||||||
|
pygame.display.set_caption("New_game")
|
||||||
|
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
Page()
|
||||||
+5
-3
@@ -7,6 +7,7 @@
|
|||||||
# Description:
|
# Description:
|
||||||
# ---------------------------------------------------------------------------
|
# ---------------------------------------------------------------------------
|
||||||
import pygame
|
import pygame
|
||||||
|
from common.colorconf import Color
|
||||||
|
|
||||||
# 初始化pygame
|
# 初始化pygame
|
||||||
pygame.init()
|
pygame.init()
|
||||||
@@ -35,9 +36,10 @@ up_status = False
|
|||||||
down_status = False
|
down_status = False
|
||||||
|
|
||||||
# 颜色
|
# 颜色
|
||||||
WHITE = (255, 255, 255)
|
color = Color()
|
||||||
RED = (255, 0, 0)
|
WHITE = color.white
|
||||||
BLUE = (0, 0, 255)
|
RED = color.red
|
||||||
|
BLUE = color.blue
|
||||||
# 游戏循环
|
# 游戏循环
|
||||||
running = True
|
running = True
|
||||||
while running:
|
while running:
|
||||||
|
|||||||
Reference in new issue
Block a user