Commit 88a2e2e3 by BellCodeEditor

save project

parent e41cc333
Showing with 13 additions and 7 deletions
...@@ -3,7 +3,7 @@ from pygame import locals ...@@ -3,7 +3,7 @@ from pygame import locals
y=400 y=400
s="running" s="running"
t=30
pygame.init() # 初始化 pygame.init() # 初始化
# 创建一个窗口 # 创建一个窗口
...@@ -32,17 +32,23 @@ while True: ...@@ -32,17 +32,23 @@ while True:
if event.type==locals.KEYDOWN: if event.type==locals.KEYDOWN:
if event.key==locals.K_SPACE: if event.key==locals.K_SPACE:
print("1111") print("1111")
s="up" if s=="running":
s='up'
if s=="up": if s=="up":
if y>150: if t>0:
y-=5 y-=t
t-=2
else: else:
s="down" s='down'
if s=="down": if s=="down":
if y<400: if t<=30:
y+=5 y+=t
t+=2
else: else:
s="running" s="running"
t=30
if s=="running":
wukong=hero[index] wukong=hero[index]
index+=1 index+=1
if index==5: if index==5:
......
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