Esempio n. 1
0
    def damage(self, bullet):
        dx = (self.width + self.height) * self.scale / 2
        dmg = DamageHelper.get_damage(self.position, bullet, dx)

        self.health -= dmg

        Global.damageSomeTank(id=self.id, dmg=dmg, health=self.health)

        Global.Queue.append({
            "action": NetworkActions.DAMAGE,
            NetworkDataCodes.TYPE: NetworkDataCodes.TANK,
            NetworkDataCodes.TANK_ID: self.id,
            NetworkDataCodes.HEALTH: self.health,
            NetworkDataCodes.DAMAGE: dmg
        })
Esempio n. 2
0
    def damage(self, object):
        id = object.get(NetworkDataCodes.TANK_ID)
        dmg = object.get(NetworkDataCodes.DAMAGE)
        health = object.get(NetworkDataCodes.HEALTH)

        Global.damageSomeTank(id=id, dmg=dmg, health=health)