1. Arne Babenhauserheide
  2. fungus

Source

fungus / fungus_simple.py

#!/usr/bin/env python2
# encoding: utf-8

"""Simplified version of fungus_game, using the improved APIs of pyglet 1.1"""

import pyglet

class Spritty(pyglet.sprite.Sprite):
    def __init__(img_path, *args, **kwds):
        image = pyglet.resource.image(img_path)
        super(Spritty, self).__init__(image, *args, **kwds)

window = pyglet.window.Window()
batch = pyglet.graphics.Batch()
batches = [batch]
images = []
for i in range(1000): 
    spritty = Spritty("graphics/wesnoth/impaler.png", batch=batch)
    images.append(sprite)

        

@window.event
def on_draw():
    global batch
    window.clear()
    for i in batches:
        i.draw()

def jump_around(dt, *args, **kwds):
    for i in range(len(images)):
        images[i].x = (sprite.x + dt)%5 - 2 + (i%7)*i
        images[i].y = (sprite.y + dt+2)%5 - 2 + (i%5)*i

pyglet.clock.schedule_interval(jump_around, 1/60.0)
pyglet.app.run()