Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJoel 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)
commita73a3774b2254b26ab0001b0a685f0e0b33b9d8d (patch)
tree453727ffdd42f138331a43f881f359fe81eb7bb2
parent302f21f5fe890de437416b03293168d325670d58 (diff)
more, faster raptors
-rw-r--r--ovpc.py16
1 files changed, 10 insertions, 6 deletions
diff --git a/ovpc.py b/ovpc.py
index 5636469..14da6ae 100644
--- a/ovpc.py
+++ b/ovpc.py
@@ -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)