Commit d1138517 by BellCodeEditor

save project

parent 9e0c18b1
Showing with 7 additions and 2 deletions
...@@ -22,6 +22,7 @@ heroLength = len(hero) ...@@ -22,6 +22,7 @@ heroLength = len(hero)
state = "runing" state = "runing"
y = 400 y = 400
t = 30 t = 30
d = 30
while True: while True:
for event in pygame.event.get(): for event in pygame.event.get():
if event.type == locals.QUIT: if event.type == locals.QUIT:
...@@ -29,8 +30,12 @@ while True: ...@@ -29,8 +30,12 @@ while True:
exit() exit()
if event.type == locals.KEYDOWN: if event.type == locals.KEYDOWN:
if event.key == locals.K_w and state == "runing": if event.key == locals.K_w and state == "runing":
state = "w" y = 400
if state == "w" : state = "up"
if event.key == locals.K_s:
y = 500
if state == "up" :
if t > 0: if t > 0:
y -= t y -= t
t -= 2 t -= 2
......
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