Example #1
0
 def __init__(self,
              name,
              pos,
              sprite,
              hp,
              defense,
              res,
              max_move,
              strength,
              strategy,
              lvl=1,
              compl_sprite=None):
     Destroyable.__init__(self, name, pos, sprite, hp, defense, res)
     self.max_move = max_move
     self.on_move = []
     self.timer = TIMER
     self.strength = strength
     self.alterations = []
     self.lvl = lvl
     self.xp = 0
     self.xp_next_lvl = self.determine_xp_goal()
     self.state = 0
     self.items = []
     self.nb_items_max = NB_ITEMS_MAX
     if compl_sprite:
         compl = pg.transform.scale(
             pg.image.load(compl_sprite).convert_alpha(),
             (TILE_SIZE, TILE_SIZE))
         self.sprite.blit(compl, (0, 0))
     '''Possible strategies :
             - STATIC : Entity will never move, just attack if possible
             - PASSIVE : Entity will react to attacks, and pursue opponent if it's trying to flee
             - SEMI_ACTIVE : Entity will only move if an opponent is at reach
             - ACTIVE : Entity always move to get closer from opponents'''
     self.strategy = strategy
Example #2
0
 def __init__(self,
              name,
              pos,
              sprite,
              hp,
              defense,
              res,
              max_move,
              strength,
              lvl=1):
     Destroyable.__init__(self, name, pos, sprite, hp, defense, res)
     self.max_move = max_move
     self.on_move = []
     self.timer = TIMER
     self.strength = strength
     self.alterations = []
     self.lvl = lvl
     self.xp = 0
     self.xp_next_lvl = self.determine_xp_goal()
     self.state = 0
     self.items = []
     self.nb_items_max = NB_ITEMS_MAX
 def __init__(self, name, pos, sprite, hp, defense, res):
     Destroyable.__init__(self, name, pos, sprite, hp, defense, res)
Example #4
0
 def __init__(self, name, pos, sprite, hp, defense, res):
     Destroyable.__init__(self, name, pos, sprite, hp, defense, res)
     # Useful in case of saving
     self.sprite_link = sprite