Mercurial > pyntnclick
diff gamelib/scenes/scene_widgets.py @ 464:54853e61b149
Blinken cameras
author | Stefano Rivera <stefano@rivera.za.net> |
---|---|
date | Sun, 29 Aug 2010 01:29:24 +0200 |
parents | 19aff54b2e73 |
children | a9925aaf5f61 cfd9c2bb4474 |
line wrap: on
line diff
--- a/gamelib/scenes/scene_widgets.py Sun Aug 29 01:26:12 2010 +0200 +++ b/gamelib/scenes/scene_widgets.py Sun Aug 29 01:29:24 2010 +0200 @@ -183,17 +183,26 @@ class BaseCamera(Thing): - "Base class for the camera puzzles" - - INITIAL = 'camera' - - def get_description(self): - return "A security camera watches over the room" + "Base class for the camera puzzles" + + INITIAL = 'online' + INITIAL_DATA = { + 'state': 'online', + } + + def get_description(self): + return "A security camera watches over the room" + + def interact_with_escher_poster(self, item): + # Order matters here, because of helper function + ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state) + self.state.scenes['bridge'].set_data('ai status', 'looping') + return ai_response + + def animate(self): + ai_status = self.state.scenes['bridge'].get_data('ai status') + if ai_status != self.get_data('status'): + self.set_data('status', ai_status) + self.set_interact(ai_status) + super(BaseCamera, self).animate() - def interact_with_escher_poster(self, item): - # Order matters here, because of helper function - ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state) - self.state.scenes['bridge'].set_data('ai status', 'looping') - return ai_response - -