예제 #1
0
     sys.exit()
 elif ev.type == KEYDOWN:
     if ev.key == K_LEFT:
         char.set_left()
         char.set_go_left(True)
         char.set_on_wall(False) #Allow logic to figure out whether or not a wall is hit
         #char.set_on_floor(False)
     elif ev.key == K_RIGHT:
         char.set_right()
         char.set_go_right(True)
         char.set_on_wall(False) #Allow logic to figure out whether or not a wall is hit
         #char.set_on_floor(False)
     elif ev.key in (K_UP, K_DOWN, K_SPACE) and char.on_floor:
         char.flip()
         #char.set_on_wall(False)
         char.set_on_floor(False) #Allow logic to figure out whether or not a floor is hit
     #elif ev.key==K_f:
     #   char.set_on_floor(not char.on_floor)
     #elif ev.key==K_w:
     #   char.set_on_wall(not char.hitwall)
     elif ev.key == K_s:
         char.set_sad(True)
     elif ev.key == K_h:
         char.set_sad(False)
     elif ev.key == K_k:
         char.kill()
     elif ev.key == K_r:
         char.revive()
     elif ev.key == K_w:
         save_game(char, save_path)
 elif ev.type == KEYUP: