Commit 887074b7 by BellCodeEditor

save project

parent 95b66d29
Showing with 3 additions and 3 deletions
import pygame import pygame
from pygame import locals from pygame import locals
from pygame.time import Clock as TIME
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
pygame.display.set_caption("悟空酷跑 * v8.03.67683 *") pygame.display.set_caption("悟空酷跑 * v8.03.67683 *")
TIME = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
# 载入图片 # 载入图片
background = pygame.image.load('bg.png') # 背景 background = pygame.image.load('bg.png') # 背景
road_img = pygame.image.load('road.png') # 路 road_img = pygame.image.load('road.png') # 路
...@@ -50,4 +50,4 @@ while True: ...@@ -50,4 +50,4 @@ while True:
screen.blit(hero, (150, y)) screen.blit(hero, (150, y))
# 刷新画面 # 刷新画面
pygame.display.update() pygame.display.update()
TIME.tick(60) TIME().tick(60)
\ No newline at end of file \ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment