Commit a2f6ae96 by BellCodeEditor

save project

parent 7edea485
Showing with 10 additions and 5 deletions
......@@ -22,7 +22,7 @@ index = 0
js='r'
y=400
t=30
ob=random.choice([stone,apple,cacti])
rect=ob.get_rect()
rect.x=1000
......@@ -36,19 +36,24 @@ while True:
# 接收到退出事件后退出程序
exit()
if event.type==locals.KEYDOWN:
if js=="r":
if event.key==locals.K_SPACE:
js='u'
if js=='u':
if y > 10:
y-=100
if t > 0:
y-=t
t-=2
else:
js='d'
if js=='d':
if y < 400:
y+=10
if t <= 30:
y+=t
t+=2
else:
js='r'
t=30
wk = hero[index]
if js=="r":
index += 1
if index==5:
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