```
import pyglet
from pyglet.window import Window, mouse, gl
from pyglet.image.codecs.png import PNGImageDecoder

window = pyglet.window.Window(
                790, 640,
              resizable=False,                                                  # Make sure it is not resizable
              caption="Something",                                     # Caption of window
              config=pyglet.gl.Config(double_buffer=True),                      # Avoids flickers
              vsync=False)

kitten = pyglet.image.load('bar.png', decoder=PNGImageDecoder())
image_part = kitten.get_region(x=0, y=0, width=400, height=40)
ball = pyglet.sprite.Sprite(image_part, x=50, y=20+50)
ball.scale = 0.25

image = kitten.get_region(x=0, y=40, width=400, height=40)
lol = pyglet.sprite.Sprite(image, x=50, y=30+50)
lol.scale = 0.25

a = kitten.get_region(x=0, y=80, width=200, height=40)
ab = pyglet.sprite.Sprite(a, x=50, y=40+50)
ab.scale = 0.25

def update(self, dt):
   on_draw()

@window.event
def on_draw():
    window.clear()
    pyglet.gl.glClearColor(255,255,255,255)
    lol.draw()
    ball.draw()
    ab.draw()

def update(dt):
    on_draw()   
pyglet.clock.schedule_interval(update, 1/60)

pyglet.app.run()

```

I am trying to make 2d animation of sorting algorithms and have no idea on how to animate the image-regions.
when run this code, It gives three static bars on the screen, all I need is to switch their pplaces..!
THanks for the help