def on_key_down(key, mod, unicode):
    if (key == keys.ESCAPE):
        exit()
    if (key == keys.R):
        sprite.x = 0
    if (key == keys.F):
        animate(sprite, x=WIDTH)
def on_key_down(key, mod, unicode):
    if (key == keys.ESCAPE):
        exit()
    if (key == keys.R):
        sprite.x = 0
    if (key == keys.F):
        animate(sprite, x=WIDTH)