diff options
author | Tim Ansell <mithro@mithis.com> | 2009-01-20 12:26:42 (GMT) |
---|---|---|
committer | Tim Ansell <mithro@mithis.com> | 2009-01-20 12:33:22 (GMT) |
commit | fa682c20c77fe1eed52726542cc12a34ea21bf79 (patch) | |
tree | 6525c25529e60212b534deaa84d63918e50ca7a2 | |
parent | 747a90f1c2b05f3c36aa94e37bfbb914458b9185 (diff) |
Add death animation and raptor animation.
-rw-r--r-- | child-death.png | bin | 0 -> 39476 bytes | |||
-rw-r--r-- | child-death01.png | bin | 0 -> 1793 bytes | |||
-rw-r--r-- | child-death02.png | bin | 0 -> 1795 bytes | |||
-rw-r--r-- | child-death03.png | bin | 0 -> 1809 bytes | |||
-rw-r--r-- | child-death04.png | bin | 0 -> 1780 bytes | |||
-rw-r--r-- | child-death05.png | bin | 0 -> 1797 bytes | |||
-rw-r--r-- | child-death06.png | bin | 0 -> 1909 bytes | |||
-rw-r--r-- | child-death08.png | bin | 0 -> 2246 bytes | |||
-rw-r--r-- | child-death09.png | bin | 0 -> 2230 bytes | |||
-rw-r--r-- | child-death10.png | bin | 0 -> 2235 bytes | |||
-rw-r--r-- | child-death11.png | bin | 0 -> 2504 bytes | |||
-rw-r--r-- | child-death12.png | bin | 0 -> 5358 bytes | |||
-rw-r--r-- | child-death13.png | bin | 0 -> 5502 bytes | |||
-rw-r--r-- | child-death14.png | bin | 0 -> 4547 bytes | |||
-rw-r--r-- | child-death15.png | bin | 0 -> 4358 bytes | |||
-rw-r--r-- | child-death16.png | bin | 0 -> 3874 bytes | |||
-rw-r--r-- | child-death17.png | bin | 0 -> 3887 bytes | |||
-rw-r--r-- | child-death18.png | bin | 0 -> 3924 bytes | |||
-rw-r--r-- | child-death19.png | bin | 0 -> 3748 bytes | |||
-rw-r--r-- | child-death20.png | bin | 0 -> 3177 bytes | |||
-rw-r--r-- | child-death21.png | bin | 0 -> 2630 bytes | |||
-rw-r--r-- | child-death22.png | bin | 0 -> 2272 bytes | |||
-rw-r--r-- | ovpc.py | 41 | ||||
-rw-r--r-- | raptor-anim.png | bin | 0 -> 12371 bytes | |||
-rw-r--r-- | raptor.png | bin | 5343 -> 0 bytes | |||
-rw-r--r-- | raptor1.png | bin | 0 -> 4882 bytes | |||
-rw-r--r-- | raptor2.png | bin | 0 -> 6272 bytes | |||
-rw-r--r-- | raptor3.png | bin | 0 -> 6583 bytes |
28 files changed, 31 insertions, 10 deletions
diff --git a/child-death.png b/child-death.png Binary files differnew file mode 100644 index 0000000..cfdcbf7 --- /dev/null +++ b/child-death.png diff --git a/child-death01.png b/child-death01.png Binary files differnew file mode 100644 index 0000000..be41272 --- /dev/null +++ b/child-death01.png diff --git a/child-death02.png b/child-death02.png Binary files differnew file mode 100644 index 0000000..7e69175 --- /dev/null +++ b/child-death02.png diff --git a/child-death03.png b/child-death03.png Binary files differnew file mode 100644 index 0000000..09101c4 --- /dev/null +++ b/child-death03.png diff --git a/child-death04.png b/child-death04.png Binary files differnew file mode 100644 index 0000000..b9ea5e8 --- /dev/null +++ b/child-death04.png diff --git a/child-death05.png b/child-death05.png Binary files differnew file mode 100644 index 0000000..fc008e5 --- /dev/null +++ b/child-death05.png diff --git a/child-death06.png b/child-death06.png Binary files differnew file mode 100644 index 0000000..f518422 --- /dev/null +++ b/child-death06.png diff --git a/child-death08.png b/child-death08.png Binary files differnew file mode 100644 index 0000000..585c8af --- /dev/null +++ b/child-death08.png diff --git a/child-death09.png b/child-death09.png Binary files differnew file mode 100644 index 0000000..8e689d8 --- /dev/null +++ b/child-death09.png diff --git a/child-death10.png b/child-death10.png Binary files differnew file mode 100644 index 0000000..026e80b --- /dev/null +++ b/child-death10.png diff --git a/child-death11.png b/child-death11.png Binary files differnew file mode 100644 index 0000000..da3cc0e --- /dev/null +++ b/child-death11.png diff --git a/child-death12.png b/child-death12.png Binary files differnew file mode 100644 index 0000000..8daba2a --- /dev/null +++ b/child-death12.png diff --git a/child-death13.png b/child-death13.png Binary files differnew file mode 100644 index 0000000..bc413e7 --- /dev/null +++ b/child-death13.png diff --git a/child-death14.png b/child-death14.png Binary files differnew file mode 100644 index 0000000..f8dd4a5 --- /dev/null +++ b/child-death14.png diff --git a/child-death15.png b/child-death15.png Binary files differnew file mode 100644 index 0000000..ecf60ae --- /dev/null +++ b/child-death15.png diff --git a/child-death16.png b/child-death16.png Binary files differnew file mode 100644 index 0000000..e26737b --- /dev/null +++ b/child-death16.png diff --git a/child-death17.png b/child-death17.png Binary files differnew file mode 100644 index 0000000..a94bedc --- /dev/null +++ b/child-death17.png diff --git a/child-death18.png b/child-death18.png Binary files differnew file mode 100644 index 0000000..dde6fc9 --- /dev/null +++ b/child-death18.png diff --git a/child-death19.png b/child-death19.png Binary files differnew file mode 100644 index 0000000..de03bec --- /dev/null +++ b/child-death19.png diff --git a/child-death20.png b/child-death20.png Binary files differnew file mode 100644 index 0000000..0214965 --- /dev/null +++ b/child-death20.png diff --git a/child-death21.png b/child-death21.png Binary files differnew file mode 100644 index 0000000..a685cb1 --- /dev/null +++ b/child-death21.png diff --git a/child-death22.png b/child-death22.png Binary files differnew file mode 100644 index 0000000..3dfcca8 --- /dev/null +++ b/child-death22.png @@ -5,6 +5,7 @@ from pyglet.window import key from random import randrange, random import math import time +import glob from pyglet.gl import * window = pyglet.window.Window(800, 400, caption='OVPC') @@ -13,19 +14,33 @@ window.push_handlers(keys) batch = pyglet.graphics.Batch() +child_death_files = glob.glob("child-death[012]*.png") +child_death_files.sort() +child_death = pyglet.image.Animation.from_image_sequence( + [pyglet.resource.image(x) for x in child_death_files], + 0.1, False) + +raptor_anim_files = glob.glob("raptor[123].png") +raptor_anim_files.sort() +raptor_anim = pyglet.image.Animation.from_image_sequence( + [pyglet.resource.image(x) for x in raptor_anim_files], + 0.1, True) + 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), - pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch), - pyglet.sprite.Sprite(pyglet.resource.image('raptor.png'), batch=batch)] + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch), + pyglet.sprite.Sprite(raptor_anim, batch=batch)] child = pyglet.sprite.Sprite(pyglet.resource.image('child.png'), batch=batch) def update(dt): + global child + if keys[key.ESCAPE]: import sys sys.exit(0) @@ -66,7 +81,13 @@ def update(dt): continue if (raptor.x-child.x) < (child.width+raptor.width)*0.5-10: - print time.time(), "Collision with", i + raptor.x += dt * 150 + + if child.image is child_death: + continue + child.image = child_death + + @window.event def on_draw(): diff --git a/raptor-anim.png b/raptor-anim.png Binary files differnew file mode 100644 index 0000000..aae6d84 --- /dev/null +++ b/raptor-anim.png diff --git a/raptor.png b/raptor.png Binary files differdeleted file mode 100644 index 57d7369..0000000 --- a/raptor.png +++ /dev/null diff --git a/raptor1.png b/raptor1.png Binary files differnew file mode 100644 index 0000000..5bb4f2a --- /dev/null +++ b/raptor1.png diff --git a/raptor2.png b/raptor2.png Binary files differnew file mode 100644 index 0000000..5a36718 --- /dev/null +++ b/raptor2.png diff --git a/raptor3.png b/raptor3.png Binary files differnew file mode 100644 index 0000000..acd582b --- /dev/null +++ b/raptor3.png |