def generateProjectile(self, pos): shotLifeLength = 200 shotSpeed = 1 attack = Attack.Attack("shot.png", self.game, pos, (4,4)) attack.damage = 5 attack.velocity = VectorMath.normalize(VectorMath.sub (self.game.player.getMidPos(),self.getMidPos()),shotSpeed) attack.framesToLive = shotLifeLength return attack
def distanceToPoint(self, point): return VectorMath.magnitude((VectorMath.sub(self.pos,point)))