Mercurial > skaapsteker
changeset 354:b37dbc557ae0
Stub classes for all items.
author | Jeremy Thurgood <firxen@gmail.com> |
---|---|
date | Sat, 09 Apr 2011 14:01:32 +0200 |
parents | 3ac03073218f |
children | 5bdb4677510a |
files | skaapsteker/sprites/items.py |
diffstat | 1 files changed, 83 insertions(+), 7 deletions(-) [+] |
line wrap: on
line diff
--- a/skaapsteker/sprites/items.py Sat Apr 09 13:56:48 2011 +0200 +++ b/skaapsteker/sprites/items.py Sat Apr 09 14:01:32 2011 +0200 @@ -1,6 +1,27 @@ from base import Item +class BreakableItem(Item): + whole_image_file = None + broken_image_file = None + + def setup(self, broken, **opts): + super(BreakableItem, self).setup(**opts) + self.broken = broken + + + def setup_image_data(self, pos): + self.image_file = self.broken_image_file if self._me.broken else self.whole_image_file + super(BreakableItem, self).setup_image_data(pos) + + + def smash(self): + self._me.broken = True + self.broken = True + self.setup_image_data(self._starting_tile_pos) + + + ################################################## # Collectibles @@ -62,21 +83,76 @@ print "Sadly, the teapot is empty." + ################################################## -# Unclassified +# Guard seduction + + +class Fan(Item): + image_file = 'fan.png' + + + +################################################## +# Samurai distraction + + +class Kindling(Item): + image_file = 'props/kindling.png' + + +class Oil(Item): + image_file = 'props/oil.png' + + + +################################################## +# Cannon destruction + + +class Cannon(BreakableItem): + whole_image_file = 'props/cannon-whole.png' + broken_image_file = 'props/cannon-broken.png' -class Vase(Item): - image_file = 'dummy.png' +################################################## +# Geisha character assassination + - def setup(self, broken, **opts): - super(Vase, self).setup(**opts) - self.broken = broken +class Vase(BreakableItem): + whole_image_file = 'props/vase-whole.png' + broken_image_file = 'props/vase-broken.png' class Salmon(Item): - image_file = 'dummy.png' + image_file = 'props/fish.png' +################################################## +# Theatrical debut + + +class NoMask(BreakableItem): + whole_image_file = 'props/no-mask-whole.png' + broken_image_file = 'props/no-mask-broken.png' + + +class NoCostume(Item): + image_file = 'props/no-costume.png' + + + +################################################## +# Big business + + +class Rice(BreakableItem): + whole_image_file = 'props/rice-whole.png' + broken_image_file = 'props/rice-broken.png' + + +class Documents(Item): + image_file = 'haiku-scroll.png' +