Mercurial > touhou
comparison pytouhou/game/game.py @ 299:e04e402e6380
Implemented Sakuya's time stop.
author | Elias Boutaleb <kagekyio@gmail.com> |
---|---|
date | Fri, 09 Mar 2012 21:43:33 +0100 |
parents | 94c636f8f863 |
children | da53bc29b94a |
comparison
equal
deleted
inserted
replaced
298:92a6fd2632f1 | 299:e04e402e6380 |
---|---|
55 self.difficulty_counter = 0 | 55 self.difficulty_counter = 0 |
56 self.difficulty_min = 12 if rank == 0 else 10 | 56 self.difficulty_min = 12 if rank == 0 else 10 |
57 self.difficulty_max = 20 if rank == 0 else 32 | 57 self.difficulty_max = 20 if rank == 0 else 32 |
58 self.boss = None | 58 self.boss = None |
59 self.spellcard = None | 59 self.spellcard = None |
60 self.time_stop = False | |
60 self.msg_runner = None | 61 self.msg_runner = None |
61 self.msg_wait = False | 62 self.msg_wait = False |
62 self.bonus_list = [0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, | 63 self.bonus_list = [0, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 0, 0, 1, 1, 0, |
63 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 2] | 64 1, 0, 1, 0, 1, 0, 1, 0, 1, 0, 0, 1, 1, 1, 0, 2] |
64 self.prng = prng or Random() | 65 self.prng = prng or Random() |
193 | 194 |
194 self.frame += 1 | 195 self.frame += 1 |
195 | 196 |
196 | 197 |
197 def update_effect(self): | 198 def update_effect(self): |
199 if self.time_stop: | |
200 return None | |
198 if self.effect is not None: | 201 if self.effect is not None: |
199 self.effect.update() | 202 self.effect.update() |
200 | 203 |
201 | 204 |
202 def update_enemies(self): | 205 def update_enemies(self): |
212 self.last_keystate = keystate | 215 self.last_keystate = keystate |
213 self.msg_runner.run_iteration() | 216 self.msg_runner.run_iteration() |
214 | 217 |
215 | 218 |
216 def update_players(self, keystate): | 219 def update_players(self, keystate): |
220 if self.time_stop: | |
221 return None | |
217 for player in self.players: | 222 for player in self.players: |
218 player.update(keystate) #TODO: differentiate keystates (multiplayer mode) | 223 player.update(keystate) #TODO: differentiate keystates (multiplayer mode) |
219 if player.state.x < 8.: | 224 if player.state.x < 8.: |
220 player.state.x = 8. | 225 player.state.x = 8. |
221 if player.state.x > self.width - 8: | 226 if player.state.x > self.width - 8: |
233 for effect in self.effects: | 238 for effect in self.effects: |
234 effect.update() | 239 effect.update() |
235 | 240 |
236 | 241 |
237 def update_bullets(self): | 242 def update_bullets(self): |
243 if self.time_stop: | |
244 return None | |
238 for bullet in self.cancelled_bullets: | 245 for bullet in self.cancelled_bullets: |
239 bullet.update() | 246 bullet.update() |
240 | 247 |
241 for bullet in self.bullets: | 248 for bullet in self.bullets: |
242 bullet.update() | 249 bullet.update() |