Mercurial > skaapsteker
changeset 546:05d93c10e5ae
Remove Kaneda after the deal is off
author | Neil Muller <drnlmuller@gmail.com> |
---|---|
date | Sun, 10 Apr 2011 00:44:04 +0200 |
parents | 067d3d80ff2e |
children | 0ddfbb5b1ae7 |
files | data/game.json data/npcs/kaneda2.json skaapsteker/sprites/npcs.py |
diffstat | 3 files changed, 12 insertions(+), 4 deletions(-) [+] |
line wrap: on
line diff
--- a/data/game.json Sun Apr 10 00:41:43 2011 +0200 +++ b/data/game.json Sun Apr 10 00:44:04 2011 +0200 @@ -162,9 +162,9 @@ "hattori": { "type": "Hattori", "level": "road", "pos": [37, 8], "dsm": "npcs/hattori.json", "state": "start", "block": true, "facing": "left" }, "ichiro": { "type": "Ichiro", "level": "road", "pos": [36, 8], "dsm": "npcs/ichiro.json", "state": "start", "block": true, "facing": "right" }, "sasuke": { "type": "Sasuke", "level": "road", "pos": [54, 8], "dsm": "npcs/sasuke.json", "state": "start", "present": true}, - "kaneda2": { "type": "Kaneda", "level": "tea_house", "pos": [6, 10], "dsm": "npcs/kaneda2.json", "state": "start", "facing": "right" }, + "kaneda2": { "type": "Kaneda", "level": "tea_house", "pos": [6, 10], "dsm": "npcs/kaneda2.json", "state": "start", "facing": "right", "present": true }, "tetsuo": { "type": "Tetsuo", "level": "tea_house", "pos": [9, 10], "dsm": "npcs/tetsuo.json", "state": "start", "facing": "left" }, - "kaneda": { "type": "Kaneda", "level": "geisha_room", "pos": [10, 3], "dsm": "npcs/kaneda.json", "state": "start", "facing": "left" }, + "kaneda": { "type": "Kaneda", "level": "geisha_room", "pos": [10, 3], "dsm": "npcs/kaneda.json", "state": "start", "facing": "left", "present": true }, "kumiko": { "type": "Kumiko", "level": "geisha_room", "pos": [11, 13], "dsm": "npcs/kumiko.json", "state": "start" }, "maneki": { "type": "Maneki", "level": "market", "pos": [35, 6], "dsm": "npcs/maneki.json", "state": "start" }, "fishmonger": { "type": "FishMonger", "level": "fishmonger_house", "pos": [23, 5], "dsm": "npcs/fishmonger.json", "state": "start" },
--- a/data/npcs/kaneda2.json Sun Apr 10 00:41:43 2011 +0200 +++ b/data/npcs/kaneda2.json Sun Apr 10 00:44:04 2011 +0200 @@ -33,6 +33,6 @@ "auto_next": "state.gone", "on_exit" : "switch_to('tetsuo')" }, - "gone" : { + "gone" : { "on_entry": "npcs.kaneda2.present = False" } -} \ No newline at end of file +}
--- a/skaapsteker/sprites/npcs.py Sun Apr 10 00:41:43 2011 +0200 +++ b/skaapsteker/sprites/npcs.py Sun Apr 10 00:44:04 2011 +0200 @@ -62,6 +62,14 @@ ('right', lambda x: transform.flip(x, True, False))), } + def setup(self, name, world, dsm, state, present, facing=None): + super(Kaneda, self).setup(name, world, dsm, state, facing) + + def update(self): + if not self._me.present: + self.remove() + super(Kaneda, self).update() + class Tetsuo(NPC): image_dir = 'sprites/tetsuo'