<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def step(self):
 """ Step the engine one tick """

        self.director.window.switch_to()
        self.director.window.dispatch_events()
        self.director.window.dispatch_event('on_draw')
        self.director.window.flip()

        # Ticking before events caused glitches.
        pyglet.clock.tick()