Commit c8d39547 by BellCodeEditor

save project

parent 6b2bfc0e
Showing with 8 additions and 0 deletions
...@@ -3,6 +3,8 @@ from pygame import locals ...@@ -3,6 +3,8 @@ from pygame import locals
import random import random
pygame.init() # 初始化 pygame.init() # 初始化
class Block
# 创建一个窗口 # 创建一个窗口
screen = pygame.display.set_mode((1000, 600)) screen = pygame.display.set_mode((1000, 600))
FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数) FPS = pygame.time.Clock() # pygame时钟,控制游戏速度(帧数)
...@@ -57,6 +59,7 @@ while True: ...@@ -57,6 +59,7 @@ while True:
jumpState = "runing" jumpState = "runing"
t =30 t =30
# 悟空造型 # 悟空造型
wukong = hero[index] wukong = hero[index]
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
...@@ -72,6 +75,11 @@ while True: ...@@ -72,6 +75,11 @@ while True:
rect.y = 500 - rect.height rect.y = 500 - rect.height
rect.x -= 8 rect.x -= 8
bg_x-=1 bg_x-=1
if bg_x <= -1000: if bg_x <= -1000:
bg_x = 0 bg_x = 0
......
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