comparison pyntnclick/gamescreen.py @ 619:d9d1a9c4b833 pyntnclick

Add ScreenEvents.
author Simon Cross <hodgestar+bzr@gmail.com>
date Sat, 11 Feb 2012 21:40:36 +0200
parents 1a8dceccd98e
children 1c5ef1e02e30
comparison
equal deleted inserted replaced
618:1a8dceccd98e 619:d9d1a9c4b833
213 213
214 def _clear_all(self): 214 def _clear_all(self):
215 for widget in self.container.children[:]: 215 for widget in self.container.children[:]:
216 self.container.remove(widget) 216 self.container.remove(widget)
217 217
218 def process_event(self, event_name, data):
219 if event_name == 'restart':
220 self.start_game()
221
218 def start_game(self): 222 def start_game(self):
219 self._clear_all() 223 self._clear_all()
220 self.game = self.create_initial_state() 224 self.game = self.create_initial_state()
221 self.state_widget = StateWidget(self) 225 self.state_widget = StateWidget(self)
222 self.add(self.state_widget) 226 self.add(self.state_widget)