old_contents: import pyglet
  from pyglet import gl
  
  from ..image import load_all
  from . import sprite
  
  
  CLEAR_COLOR_DEFAULT = (0.1, 0.2, 0.3, 1.0)
  
  
  def clear(color=CLEAR_COLOR_DEFAULT):
      r, g, b, _ = color
      gl.glClearColor(r, g, b, 1.0)
      gl.glClear(gl.GL_COLOR_BUFFER_BIT | gl.GL_DEPTH_BUFFER_BIT)
  
  
  def init(world, options):
  
      window = pyglet.window.Window(
          fullscreen=options.fullscreen,
          vsync=options.vsync,
          resizable=not options.fullscreen,
          caption='Tanks',
      )
  
      @window.event
      def on_draw():
          clear()
          draw_sprites((item, item.position, item.angle) for item in world)
  
      draw_sprites = sprite.init(window, world, load_all('data/images'))
  
      return window
  
  
new_contents: import pyglet
  import rabbyt
  
  from ..image import load_all
  from . import sprite
  
  
  CLEAR_COLOR_DEFAULT = (0.1, 0.3, 0.2)
  
  
  def clear(color=CLEAR_COLOR_DEFAULT):
      rabbyt.clear(rgba=CLEAR_COLOR_DEFAULT)
  
  
  def init(world, options):
  
      window = pyglet.window.Window(
          fullscreen=options.fullscreen,
          vsync=options.vsync,
          resizable=not options.fullscreen,
          caption='Tanks',
      )
  
      rabbyt.set_viewport((window.width, window.height))
      rabbyt.set_default_attribs()
  
      @window.event
      def on_draw():
          clear()
          draw_sprites((item, item.position, item.angle) for item in world)
  
      draw_sprites = sprite.init(window, world, load_all('data/images'))
  
      return window
  
  
subject: call rabbyt setup functions as described by documentation (although they don't seem to do anything.) Use rabbyt util to clear screen, simplifying our code.