def __init__(self, *args): super(Swordsman, self).__init__(*args) Character.set_health(self, Swordsman.MAX_HEALTH) Character.set_speed(self, Swordsman.MOVE_SPEED) actor = Actor( "models/swordsman", { "idle": "models/swordsman-idle", "walk": "models/swordsman-walk", "run": "models/swordsman-run", "hurt": "models/swordsman-hurt", "die": "models/swordsman-die", "attack": "models/swordsman-attack" }) team = Character.get_team(self) if team == 0: """ actor = Actor("models/swordsman_red", {"idle": "models/swordsman-idle", "walk": "models/swordsman-walk", "run": "models/swordsman-run", "hurt": "models/swordsman-hurt", "die": "models/swordsman-die", "attack": "models/swordsman-attack"}) """ tex = loader.loadTexture("models/textures/swordsman_red.png") ts = actor.findTextureStage('*') actor.setTexture(ts, tex, 1) #ts = actor.findTextureStage('ts') #actor.setTexture(ts, tex) elif team == 1: """ actor = Actor("models/swordsman_blue", {"idle": "models/swordsman-idle", "walk": "models/swordsman-walk", "run": "models/swordsman-run", "hurt": "models/swordsman-hurt", "die": "models/swordsman-die", "attack": "models/swordsman-attack"}) """ tex = loader.loadTexture("models/textures/swordsman_blue.png") ts = actor.findTextureStage('*') actor.setTexture(ts, tex, 1) #ts = actor.findTextureStage('ts') #actor.setTexture(ts, tex) Character.set_actor(self, actor) self.hb = HealthBar(1.5, value=Swordsman.MAX_HEALTH) self.hb.reparentTo(self._floater) self.hb.setValue(self.get_health()) self.model = loader.loadModel("models/circle") self.model.setTransparency(True) self.model.reparentTo(self._character) self.model.setAlphaScale(0.5) self.model.setScale(2) self.model.setPos(0, 0, -10)
def __init__(self, *args): super(Swordsman, self).__init__(*args) Character.set_health(self, Swordsman.MAX_HEALTH) Character.set_speed(self, Swordsman.MOVE_SPEED) actor = Actor("models/swordsman", {"idle": "models/swordsman-idle", "walk": "models/swordsman-walk", "run": "models/swordsman-run", "hurt": "models/swordsman-hurt", "die": "models/swordsman-die", "attack": "models/swordsman-attack"}) team = Character.get_team(self) if team == 0: """ actor = Actor("models/swordsman_red", {"idle": "models/swordsman-idle", "walk": "models/swordsman-walk", "run": "models/swordsman-run", "hurt": "models/swordsman-hurt", "die": "models/swordsman-die", "attack": "models/swordsman-attack"}) """ tex = loader.loadTexture("models/textures/swordsman_red.png") ts = actor.findTextureStage('*') actor.setTexture(ts, tex, 1) #ts = actor.findTextureStage('ts') #actor.setTexture(ts, tex) elif team == 1: """ actor = Actor("models/swordsman_blue", {"idle": "models/swordsman-idle", "walk": "models/swordsman-walk", "run": "models/swordsman-run", "hurt": "models/swordsman-hurt", "die": "models/swordsman-die", "attack": "models/swordsman-attack"}) """ tex = loader.loadTexture("models/textures/swordsman_blue.png") ts = actor.findTextureStage('*') actor.setTexture(ts, tex, 1) #ts = actor.findTextureStage('ts') #actor.setTexture(ts, tex) Character.set_actor(self, actor) self.hb = HealthBar(1.5, value=Swordsman.MAX_HEALTH) self.hb.reparentTo(self._floater) self.hb.setValue(self.get_health()) self.model = loader.loadModel("models/circle") self.model.setTransparency(True) self.model.reparentTo(self._character) self.model.setAlphaScale(0.5) self.model.setScale(2) self.model.setPos(0, 0, -10)
def __init__(self, *args): super(Axeman, self).__init__(*args) Character.set_health(self, Axeman.MAX_HEALTH) actor = Actor("models/axeman", {"idle": "models/axeman-idle", "walk": "models/axeman-walk", "run": "models/axeman-run" , "hurt": "models/axeman-hurt", "die": "models/axeman-die", "attack": "models/axeman-swing", "special":"models/axeman-special-attack"}) Character.set_speed(self, Axeman.MOVE_SPEED) # loda texture based on team team = Character.get_team(self) if team == 0: tex = loader.loadTexture("models/textures/axeman_red.png") ts = actor.findTextureStage("*") actor.setTexture(ts, tex, 1) elif team == 1: tex = loader.loadTexture("models/textures/axeman_blue.png") ts = actor.findTextureStage('*') actor.setTexture(ts, tex, 1) Character.set_actor(self, actor) #attach axe rightHand = self._character.exposeJoint(None, 'modelRoot', 'hand_ctrl_r') axe = loader.loadModel("models/axe") axe_tex = loader.loadTexture("models/textures/axe.png") axe.setTexture(axe_tex, 1) axe.setPos(-3.0, 0.6, -0.2) axe.setHpr(0, -90, -90) axe.setScale(10) axe.reparentTo(rightHand) axe.show() self.hb = HealthBar(1.5, value=Axeman.MAX_HEALTH) self.hb.reparentTo(self._floater) self.hb.setValue(self.get_health()) model = loader.loadModel("models/circle") model.setTransparency(True) model.reparentTo(self._character) model.setAlphaScale(0.5) model.setScale(2) model.setPos(0, 0, -10)
def __init__(self, *args): super(Axeman, self).__init__(*args) Character.set_health(self, Axeman.MAX_HEALTH) actor = Actor("models/axeman", {"idle": "models/axeman-idle", "walk": "models/axeman-walk", "run": "models/axeman-run" , "hurt": "models/axeman-hurt", "die": "models/axeman-die", "attack": "models/axeman-swing", "special":"models/axeman-special-attack"}) Character.set_speed(self, Axeman.MOVE_SPEED) # loda texture based on team team = Character.get_team(self) if team == 0: tex = loader.loadTexture("models/textures/axeman_red.png") ts = actor.findTextureStage("*") actor.setTexture(ts, tex, 1) elif team == 1: tex = loader.loadTexture("models/textures/axeman_blue.png") ts = actor.findTextureStage('*') actor.setTexture(ts, tex, 1) Character.set_actor(self, actor) #attach axe rightHand = self._character.exposeJoint(None, 'modelRoot', 'hand_ctrl_r') axe = loader.loadModel("models/axe") axe_tex = loader.loadTexture("models/textures/axe.png") axe.setTexture(axe_tex, 1) axe.setPos(-3.0, 0.6, -0.2) axe.setHpr(0, -90, -90) axe.setScale(10) axe.reparentTo(rightHand) axe.show() self.hb = HealthBar(1.5, value=Axeman.MAX_HEALTH) self.hb.reparentTo(self._character) model = loader.loadModel("models/circle") model.setTransparency(True) model.reparentTo(self._character) model.setAlphaScale(0.5) model.setScale(2) model.setPos(0, 0, -10)