located at the page: http://www.pyglet.org/doc/api/pyglet.sprite-module.html

the code: is missing a closing parenthesis on .append() to run.

from:
    ball_sprites.append(pyglet.sprite.Sprite(ball_image, x, y, batch=batch)
to
    ball_sprites.append(pyglet.sprite.Sprite(ball_image, x, y, batch=batch))

I added screen width/height:

window = pyglet.window.Window()
ball_image = pyglet.image.load('ball.png')
batch1 = pyglet.graphics.Batch()

ball_sprites = []
for i in range(200):
    x, y = randint(0,window.width), randint(0,window.height)

    ball_sprites.append(pyglet.sprite.Sprite(ball_image, x, y,
batch=batch1))

@window.event
def on_draw():
    batch1.draw()

pyglet.app.run()


-- 
Jake

-- 
You received this message because you are subscribed to the Google Groups 
"pyglet-users" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/pyglet-users?hl=en.

Reply via email to