comparison pytouhou/game/game.py @ 153:37df8c618c2e

Add falling items.
author Emmanuel Gil Peyrot <linkmauve@linkmauve.fr>
date Sun, 09 Oct 2011 16:54:49 -0700
parents 86807b8a63bd
children 364935f6e313
comparison
equal deleted inserted replaced
152:86807b8a63bd 153:37df8c618c2e
49 'stg%denm2.anm' % stage)) 49 'stg%denm2.anm' % stage))
50 ecl = resource_loader.get_ecl('ecldata%d.ecl' % stage) 50 ecl = resource_loader.get_ecl('ecldata%d.ecl' % stage)
51 self.ecl_runner = ECLMainRunner(ecl, self.new_enemy, self) 51 self.ecl_runner = ECLMainRunner(ecl, self.new_enemy, self)
52 52
53 53
54 def drop_bonus(self, x, y, _type):
55 player = self.players[0] #TODO
56 item_type = self.item_types[_type]
57 item = Item((x, y), item_type, self)
58 self.items.append(item)
59
60
54 def change_bullets_into_star_items(self): 61 def change_bullets_into_star_items(self):
55 player = self.players[0] #TODO 62 player = self.players[0] #TODO
56 item_type = self.item_types[6] 63 item_type = self.item_types[6]
57 self.items.extend(Item((bullet.x, bullet.y), item_type, 0.0, item_type.speed, player, self) for bullet in self.bullets) 64 self.items.extend(Item((bullet.x, bullet.y), item_type, self, player=player) for bullet in self.bullets)
58 self.bullets = [] 65 self.bullets = []
59 66
60 67
61 def new_enemy(self, pos, life, instr_type, pop_enemy): 68 def new_enemy(self, pos, life, instr_type, pop_enemy):
62 enemy = Enemy(pos, life, instr_type, self.enm_anm_wrapper, self, pop_enemy) 69 enemy = Enemy(pos, life, instr_type, self.enm_anm_wrapper, self, pop_enemy)