diff options
author | Joel Stanley <joel.stanley@adelaide.edu.au> | 2008-12-07 11:28:09 (GMT) |
---|---|---|
committer | Joel Stanley <joel.stanley@adelaide.edu.au> | 2008-12-07 11:28:09 (GMT) |
commit | a73a3774b2254b26ab0001b0a685f0e0b33b9d8d (patch) | |
tree | 453727ffdd42f138331a43f881f359fe81eb7bb2 | |
parent | 302f21f5fe890de437416b03293168d325670d58 (diff) |
more, faster raptors
-rw-r--r-- | ovpc.py | 16 |
1 files changed, 10 insertions, 6 deletions
@@ -12,7 +12,11 @@ window.push_handlers(keys) batch = pyglet.graphics.Batch() -raptors = [ +pack = [ + pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), + pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), + pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), + pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), @@ -44,12 +48,12 @@ def update(dt): if child.y < 0: child.y = 0 - for raptor in raptors: + for raptor in pack: if raptor.x < (0 - raptor.width): reset_enemy(raptor) - raptor.x -= dt * 100 - raptor.y += dt * randrange(-10, 10) + raptor.x -= dt * 150 + raptor.y += dt * randrange(-100, 100) @window.event def on_draw(): @@ -58,10 +62,10 @@ def on_draw(): batch.draw() def reset_enemy(raptor): - raptor.x = window.width + raptor.x = window.width + randrange(0,window.width*2) raptor.y = window.height * random() -for raptor in raptors: +for raptor in pack: raptor.scale = 0.5 reset_enemy(raptor) |