def onUpdate(self): self.locator.update() self.drawParam.dst = self.locator.position.makeRect(self.SIZE, True) self.drawParam.rotDegree = self.locator.speed.getAngle() force = Std.Vector2DF() force.setUnitVector(self.locator.speed.getAngle()) force *= self.FORCE_TO_BULLET self.bulletDamage = self.BASE_BULLET_DAMAGE * self.damageRate damageSum = Auxs.applyDamageToBullets( self.hitRect, self.bulletDamage) self.applyDamage(damageSum * 2) rebound = Auxs.applyExForceToBullets( self.hitRect, force) self.applyExternalForce(rebound * 60) if self.locator.speed.getAbs() < 10: self.erase()
def applyDamageToEnemy(self): if self.baseDamage > 0: Auxs.applyDamageToEnemies(self.hitRect, self.damage) Auxs.applyDamageToBullets(self.hitCircle, self.damage)