comparison 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
comparison
equal deleted inserted replaced
463:8d25de1519db 464:54853e61b149
181 else: 181 else:
182 return None 182 return None
183 183
184 184
185 class BaseCamera(Thing): 185 class BaseCamera(Thing):
186 "Base class for the camera puzzles" 186 "Base class for the camera puzzles"
187 187
188 INITIAL = 'camera' 188 INITIAL = 'online'
189 189 INITIAL_DATA = {
190 def get_description(self): 190 'state': 'online',
191 return "A security camera watches over the room" 191 }
192 192
193 def interact_with_escher_poster(self, item): 193 def get_description(self):
194 # Order matters here, because of helper function 194 return "A security camera watches over the room"
195 ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state) 195
196 self.state.scenes['bridge'].set_data('ai status', 'looping') 196 def interact_with_escher_poster(self, item):
197 return ai_response 197 # Order matters here, because of helper function
198 198 ai_response = make_jim_dialog("3D scene reconstruction failed. Critical error. Entering emergency shutdown.", self.state)
199 199 self.state.scenes['bridge'].set_data('ai status', 'looping')
200 return ai_response
201
202 def animate(self):
203 ai_status = self.state.scenes['bridge'].get_data('ai status')
204 if ai_status != self.get_data('status'):
205 self.set_data('status', ai_status)
206 self.set_interact(ai_status)
207 super(BaseCamera, self).animate()
208