Commit d6c7509d by BellCodeEditor

auto save

parent 83fb61bb
Showing with 18 additions and 8 deletions
......@@ -20,20 +20,30 @@ hero = [pygame.image.load('hero1.png'),
index = 0
jumpzt = "running"
y = 400
t = 30
while True:
for event in pygame.event.get():
if event.type == locals.QUIT:
# 接收到退出事件后退出程序
exit()
for event in pygame.locals.KEYDOWN:
if envet.key == locals.K_SPACE:
if jumpzt == "running":
if y > 150:
y -= 5
else:
y
if y < 400:
if event.type == locals.KEYDOWN:
if event.key == locals.K_SPACE:
jumpzt = "up"
if jumpzt == "up":
if t > 0 :
y -= t
t -= 2
else:
jumpzt = "down"
if jumpzt == "down":
y+=t
t+=2
else:
jumpzt = "running"
if y == 400:
t = 30
wukong = hero[index]
index+=1
......
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