comparison pytouhou/game/game.py @ 303:647bde10353d

Add score/effective_score distinction and prepare for highscore handling.
author Thibaut Girka <thib@sitedethib.com>
date Sat, 10 Mar 2012 20:37:15 +0100
parents da53bc29b94a
children f3099ebf4f61
comparison
equal deleted inserted replaced
302:34ea45d95489 303:647bde10353d
115 115
116 def drop_bonus(self, x, y, _type, end_pos=None): 116 def drop_bonus(self, x, y, _type, end_pos=None):
117 player = self.players[0] #TODO 117 player = self.players[0] #TODO
118 if _type > 6: 118 if _type > 6:
119 return 119 return
120 if len(self.items) >= self.nb_bullets_max:
121 return #TODO: check
120 item_type = self.item_types[_type] 122 item_type = self.item_types[_type]
121 item = Item((x, y), _type, item_type, self, end_pos=end_pos) 123 item = Item((x, y), _type, item_type, self, end_pos=end_pos)
122 self.items.append(item) 124 self.items.append(item)
123 125
124 126
232 player.state.y = self.height -16 234 player.state.y = self.height -16
233 235
234 for bullet in self.players_bullets: 236 for bullet in self.players_bullets:
235 bullet.update() 237 bullet.update()
236 238
239 #XXX: Why 78910? Is it really the right value?
240 player.state.effective_score = min(player.state.effective_score + 78910,
241 player.state.score)
242 #TODO: give extra lives to the player
243
237 244
238 def update_effects(self): 245 def update_effects(self):
239 for effect in self.effects: 246 for effect in self.effects:
240 effect.update() 247 effect.update()
241 248