def respawn(self, pos): """Respawn powerup.""" self.pos = pos self.pot_field = PotentialField.create(self.game.tilemap.width, self.game.tilemap.height, pos) self.elapsed_lifetime = 0 self.elapsed_blink = 0 self.isalive = True self.isvisible = True
def reinit(self, pos, prototype): """Reinit powerup.""" self.pot_field = PotentialField.create(self.game.tilemap.width, self.game.tilemap.height, pos) self.respawn(pos) self.tex = prototype['tex'] self.actions = prototype['actions'] self.lifetime = prototype.get('lifetime', 100000) self.blinkrate = prototype.get('blinkrate', 100000) self.startblinkingat = prototype.get('startblinkingat', 100000) self.autorespawn = prototype.get('autorespawn', False)