Commit a2f6ae96 by BellCodeEditor

save project

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