Mercurial > touhou
comparison pytouhou/game/enemy.py @ 134:e9ac3640280b
Add support for enemy spawnling enemies.
author | Emmanuel Gil Peyrot <linkmauve@linkmauve.fr> |
---|---|
date | Fri, 16 Sep 2011 11:21:33 -0700 |
parents | fba45c37ec99 |
children | c53d91300c1c |
comparison
equal
deleted
inserted
replaced
133:2cad2e84a49e | 134:e9ac3640280b |
---|---|
20 from pytouhou.game.bullet import Bullet | 20 from pytouhou.game.bullet import Bullet |
21 from math import cos, sin, atan2, pi | 21 from math import cos, sin, atan2, pi |
22 | 22 |
23 | 23 |
24 class Enemy(object): | 24 class Enemy(object): |
25 def __init__(self, pos, life, _type, anm_wrapper, game_state): | 25 def __init__(self, pos, life, _type, anm_wrapper, game_state, pop_enemy): |
26 self._game_state = game_state | 26 self._game_state = game_state |
27 self._anm_wrapper = anm_wrapper | 27 self._anm_wrapper = anm_wrapper |
28 self._sprite = None | 28 self._sprite = None |
29 self._anmrunner = None | 29 self._anmrunner = None |
30 self._removed = False | 30 self._removed = False |
67 self.acceleration = 0. | 67 self.acceleration = 0. |
68 | 68 |
69 self.hitbox = (0, 0) | 69 self.hitbox = (0, 0) |
70 self.screen_box = None | 70 self.screen_box = None |
71 | 71 |
72 self.pop_enemy = pop_enemy | |
73 | |
72 | 74 |
73 def set_bullet_attributes(self, type_, anim, sprite_idx_offset, | 75 def set_bullet_attributes(self, type_, anim, sprite_idx_offset, |
74 bullets_per_shot, number_of_shots, speed, speed2, | 76 bullets_per_shot, number_of_shots, speed, speed2, |
75 launch_angle, angle, flags): | 77 launch_angle, angle, flags): |
76 self.bullet_attributes = (type_, anim, sprite_idx_offset, bullets_per_shot, | 78 self.bullet_attributes = (type_, anim, sprite_idx_offset, bullets_per_shot, |