Commit 88a2e2e3 by BellCodeEditor

save project

parent e41cc333
Showing with 16 additions and 10 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,19 +32,25 @@ while True: ...@@ -32,19 +32,25 @@ 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
else: t+=2
else:
s="running" s="running"
wukong=hero[index] t=30
index+=1
if s=="running":
wukong=hero[index]
index+=1
if index==5: if index==5:
index=0 index=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