Commit 31769d7a by BellCodeEditor

save project

parent 1acbb3b4
Showing with 9 additions and 3 deletions
...@@ -47,7 +47,7 @@ hero = [load('hero1.png'), ...@@ -47,7 +47,7 @@ hero = [load('hero1.png'),
load('hero5.png')] load('hero5.png')]
index = 0 index = 0
y = 400 y = 400
jumpState = "runing" jumpState = "walking"
t = 30 t = 30
bg_x = 0 bg_x = 0
road_x = 0 road_x = 0
...@@ -64,9 +64,15 @@ while True: ...@@ -64,9 +64,15 @@ while True:
# 接收到退出事件后退出程序 # 接收到退出事件后退出程序
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if jumpState == "runing": if jumpState == "walking" or jumpState == "runing":
if event.key: if event.key == locals.K_SPACE:
jumpState = "up" jumpState = "up"
if jumpState == "walking":
if event.key == locals.K_PLUS:
jumpState == "runing"
if jumpState == "runing":
if e
# 悟空造型 # 悟空造型
wukong = Player(hero[index]) wukong = Player(hero[index])
if jumpState == "runing": # 跑步状态下 if jumpState == "runing": # 跑步状态下
......
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