Ignore:
Timestamp:
Sep 7, 2013, 8:01:03 PM (7 years ago)
Author:
Adrianna Pińska <adrianna.pinska@…>
Branch:
default
rebase_source:
2c68cc5ff2614fa8e2aa6663677c18370284a505
Message:

the black goat with a thousand young

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nagslang/enemies.py

    r500 r553  
    304304        return [("name", "string"), ("position", "coordinates"),
    305305                ("attack_range", "distance")]
     306               
     307
     308class Queen(RunAndGunAlien):
     309    enemy_type = "queen"
     310    impulse_factor = 180
     311    health = 500
     312    enemy_damage = 50
     313    is_moving = True
     314    spawn_time = 10
     315    spawn_size = 5
     316    spawn_class = ChargingAlien
     317    spawn_class_args = (200,)
     318   
     319    def __init__(self, space, world, position, attack_range=100):
     320        super(Queen, self).__init__(space, world, position, attack_range)
     321        self.add_timer('spawn', self.spawn_time)
     322       
     323    def spawn(self, result):
     324        if not self.check_timer('spawn'):
     325            self.start_timer('spawn', self.spawn_time)
     326            for i in range(self.spawn_size):
     327                result.add += (self.spawn_class(self.get_space(),
     328                self.world, self.physicser.position,
     329                *self.spawn_class_args),)
     330               
     331    def attack(self, result):
     332        self.ranged_attack(300, ACID_SPEED, ACID_DAMAGE, 'acid', 1, result)
     333
     334    def update(self, dt):
     335        result = super(Queen, self).update(dt)
     336        self.spawn(result)
     337        return result
     338
     339    @classmethod
     340    def requires(cls):
     341        return [("name", "string"), ("position", "coordinates"),
     342                ("attack_range", "distance")]
    306343
    307344
Note: See TracChangeset for help on using the changeset viewer.