Exemplo n.º 1
0
 def add(self, entity):
     verify_attrs(entity,
                  [('invisibility_time', 0), 'invisibility_duration',
                   'invisibility_cooldown_time', 'visible',
                   ('invisibility_cooldown', 0)])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 2
0
 def add(self, entity):
     verify_attrs(entity, [
         'decoy_cooldown_time', 'x', 'y', 'dx', 'dy',
         ('decoy_cooldown', 0), 'color'
     ])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 3
0
 def add(self, entity):
     verify_attrs(entity, [
         'smoke_screen_rad', 'smoke_screen_cooldown_time', 'color', 'x',
         'y', 'width', 'height', ('smoke_screen_cooldown', 0)
     ])
     entity.register_handler('action', self.handle_action)
     entity.register_handler('update', self.handle_update)
Exemplo n.º 4
0
 def add(self, entity):
     verify_attrs(entity, [
         'speed_boost_activation_cooldown_time',
         'speed_boost_duration_time', 'speed_boost_speed', 'speed',
         ('speed_boost_activation_cooldown', 0),
         ('base_speed', entity.speed), ('speed_boost_time', 0)
     ])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 5
0
 def add(self, entity):
     verify_attrs(entity, [
         'minefield_ang_density', 'minefield_rad_density',
         'minefield_max_rad', 'minefield_min_rad',
         'minefield_cooldown_time', 'x', 'y', 'dx', 'dy', 'width', 'height',
         ('minefield_cooldown', 0), 'color'
     ])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 6
0
    def __init__(self, renderer, entity, layers=[], hud=[]):
        verify_attrs(entity, ('x', 'y', 'width', 'height', 'angle', 'screen_x', 'screen_y', 'screen_width', 'screen_height'))
        self.entity = entity
        self.hud_entities = hud
        self.layers = layers
        self.renderer = renderer
        self.pixel_format = sdl2hl.PixelFormat.argb8888

        self.transform_point = self.world_to_camera
        self.transform_angle = self.world_to_camera_angle
        self.transform_width = self.world_to_camera_width
        self.transform_height = self.world_to_camera_height
Exemplo n.º 7
0
 def add(self, entity):
     verify_attrs(entity, ['liveness'])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 8
0
 def add(self, entity):
     verify_attrs(entity, [('dx', 0), ('dy', 0), 'follow_entity','mirror_dir'])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 9
0
 def add(self, entity):
     verify_attrs(entity, ['smoke_screen_rad', 'smoke_screen_cooldown_time', 'color', 'x', 'y', 'width', 'height', ('smoke_screen_cooldown', 0)])
     entity.register_handler('action', self.handle_action)
     entity.register_handler('update', self.handle_update)
Exemplo n.º 10
0
 def add(self, entity):
     verify_attrs(entity, ['visible', 'x', 'y', 'color', 'height', 'width'])
     
     entity.register_handler('draw', self.handle_draw)
Exemplo n.º 11
0
 def add(self, entity):
     verify_attrs(entity, ['decoy_cooldown_time', 'x', 'y', 'dx', 'dy',('decoy_cooldown',0), 'color'])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 12
0
 def add(self, entity):
     verify_attrs(entity, ['x', 'y', 'color', 'radius', ('previous_radius', entity.radius)])
     entity.register_handler('draw', self.handle_draw)
Exemplo n.º 13
0
 def add(self, entity):
     verify_attrs(entity, ['radius', 'max_radius', 'growth_rate'])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 14
0
 def add(self, entity):
     verify_attrs(entity, ['liveness'])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 15
0
 def add(self, entity):
     verify_attrs(entity, [('dx', 0),
                           ('dy', 0), 'follow_entity', 'mirror_dir'])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 16
0
 def add(self, entity):
     verify_attrs(entity, ['chasing', ('time_since_action', 0)])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 17
0
    def add(self, entity):
        verify_attrs(entity, [('dx', 1), ('dy', 0)])
        entity.facing = 1

        entity.register_handler('update', self.handle_update)
Exemplo n.º 18
0
    def add(self, entity):
        verify_attrs(entity, ['visible', 'x', 'y', 'color', 'height', 'width'])

        entity.register_handler('draw', self.handle_draw)
Exemplo n.º 19
0
 def add(self, entity):
     verify_attrs(entity, [('dx', 1), ('dy', 0)])
     entity.facing = 1
           
     entity.register_handler('update', self.handle_update)
Exemplo n.º 20
0
 def add(self, entity):
     verify_attrs(entity,['chasing',('time_since_action',0)])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 21
0
 def add(self, entity):
     verify_attrs(entity, [
         'time_limit',
         ('time_remaining', entity.time_limit), 'x', 'y', 'width', 'height'
     ])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 22
0
 def add(self, entity):
     verify_attrs(entity, ['target', 'x', 'y', 'direction', 'width', 'height'])
     entity.register_handler('draw', self.handle_draw)
Exemplo n.º 23
0
 def add(self, entity):
     verify_attrs(entity, ['spawn_period', ('spawn_timer', 0)])
     entity.register_handler('update', self.handle_update)
Exemplo n.º 24
0
 def add(self, entity):
     verify_attrs(entity, [('invisibility_time', 0), 'invisibility_duration', 'invisibility_cooldown_time', 'visible', ('invisibility_cooldown',0)])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 25
0
 def add(self, entity):
     verify_attrs(entity, ['chasing'])
     entity.register_handler('input', self.handle_input)
Exemplo n.º 26
0
 def add(self, entity):
     verify_attrs(entity,['chasing'])
     entity.register_handler('input', self.handle_input)
Exemplo n.º 27
0
 def add(self, entity):
     verify_attrs(entity, ['minefield_ang_density', 'minefield_rad_density', 'minefield_max_rad', 'minefield_min_rad', 'minefield_cooldown_time', 'x', 'y', 'dx', 'dy', 'width', 'height', ('minefield_cooldown',0), 'color'])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 28
0
 def add(self, entity):
     verify_attrs(entity, ['target', 'x', 'y', 'width', 'height'])
     entity.register_handler('draw', self.handle_draw)
Exemplo n.º 29
0
 def add(self, entity):
     verify_attrs(entity, ['speed_boost_activation_cooldown_time', 'speed_boost_duration_time', 'speed_boost_speed', 'speed', ('speed_boost_activation_cooldown',0), ('base_speed', entity.speed), ('speed_boost_time', 0)])
     entity.register_handler('update', self.handle_update)
     entity.register_handler('action', self.handle_action)
Exemplo n.º 30
0
 def add(self, entity):
     verify_attrs(entity, ['time_limit', ('time_remaining', entity.time_limit), 'x', 'y', 'width', 'height'])
     entity.register_handler('update', self.handle_update)