comparison pytouhou/game/game.py @ 380:c25530efea3b

Replace player position in game zone right after its move; fix shots offsets at boundaries.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Fri, 07 Sep 2012 12:54:38 +0200
parents 6deab6ad8be8
children ac2891afb0bb
comparison
equal deleted inserted replaced
379:e0e284fcb288 380:c25530efea3b
281 for bullet in self.players_bullets: 281 for bullet in self.players_bullets:
282 bullet.update() 282 bullet.update()
283 283
284 for player in self.players: 284 for player in self.players:
285 player.update(keystate) #TODO: differentiate keystates (multiplayer mode) 285 player.update(keystate) #TODO: differentiate keystates (multiplayer mode)
286 if player.state.x < 8.:
287 player.state.x = 8.
288 if player.state.x > self.width - 8:
289 player.state.x = self.width - 8
290 if player.state.y < 16.:
291 player.state.y = 16.
292 if player.state.y > self.height - 16:
293 player.state.y = self.height -16
294 286
295 #XXX: Why 78910? Is it really the right value? 287 #XXX: Why 78910? Is it really the right value?
296 player.state.effective_score = min(player.state.effective_score + 78910, 288 player.state.effective_score = min(player.state.effective_score + 78910,
297 player.state.score) 289 player.state.score)
298 #TODO: give extra lives to the player 290 #TODO: give extra lives to the player