def create_node(self): if self.model == "Grenade": m = Actor("grenade.egg") shell = m.find("**/shell") shell.setColor(1, 0.3, 0.3, 1) inner_top = m.find("**/inner_top") inner_bottom = m.find("**/inner_bottom") inner_top.setColor(0.4, 0.4, 0.4, 1) inner_bottom.setColor(0.4, 0.4, 0.4, 1) self.spin_bone = m.controlJoint(None, "modelRoot", "grenade_bone") m.set_scale(GRENADE_SCALE) elif self.model == "Missile": m = load_model("missile.egg") body = m.find("**/bodywings") body.set_color(0.3, 0.3, 1, 1) main_engines = m.find("**/mainengines") wing_engines = m.find("**/wingengines") main_engines.set_color(0.1, 0.1, 0.1, 1) wing_engines.set_color(0.1, 0.1, 0.1, 1) m.set_scale(MISSILE_SCALE) else: m = load_model("misc/rgbCube") m.set_scale(0.5) m.set_hpr(45, 45, 45) return m
def create_node(self): if self.model == "Grenade": m = Actor('grenade.egg') shell = m.find('**/shell') shell.setColor(1,.3,.3,1) inner_top = m.find('**/inner_top') inner_bottom = m.find('**/inner_bottom') inner_top.setColor(.4,.4,.4,1) inner_bottom.setColor(.4,.4,.4,1) self.spin_bone = m.controlJoint(None, 'modelRoot', 'grenade_bone') m.set_scale(GRENADE_SCALE) elif self.model == "Missile": m = load_model('missile.egg') body = m.find('**/bodywings') body.set_color(.3,.3,1,1) main_engines = m.find('**/mainengines') wing_engines = m.find('**/wingengines') main_engines.set_color(.1,.1,.1,1) wing_engines.set_color(.1,.1,.1,1) m.set_scale(MISSILE_SCALE) else: m = load_model('misc/rgbCube') m.set_scale(.5) m.set_hpr(45,45,45) return m
def create_node(self): if self.model == "Grenade": m = Actor('grenade.egg') shell = m.find('**/shell') shell.setColor(1, .3, .3, 1) inner_top = m.find('**/inner_top') inner_bottom = m.find('**/inner_bottom') inner_top.setColor(.4, .4, .4, 1) inner_bottom.setColor(.4, .4, .4, 1) self.spin_bone = m.controlJoint(None, 'modelRoot', 'grenade_bone') m.set_scale(GRENADE_SCALE) elif self.model == "Missile": m = load_model('missile.egg') body = m.find('**/bodywings') body.set_color(.3, .3, 1, 1) main_engines = m.find('**/mainengines') wing_engines = m.find('**/wingengines') main_engines.set_color(.1, .1, .1, 1) wing_engines.set_color(.1, .1, .1, 1) m.set_scale(MISSILE_SCALE) else: m = load_model('misc/rgbCube') m.set_scale(.5) m.set_hpr(45, 45, 45) return m
def create_node(self): m = load_model('plasma.egg') m.set_shader_auto() p = m.find('**/plasma') cf = self.energy p.setColor(1,(150/255.0)*cf,(150/255.0)*cf) m.set_scale(PLASMA_SCALE) return m
def create_node(self): self.model = load_model('missile.egg') self.body = self.model.find('**/bodywings') self.body.set_color(*self.color) self.main_engines = self.model.find('**/mainengines') self.wing_engines = self.model.find('**/wingengines') self.main_engines.set_color(*random.choice(ENGINE_COLORS)) self.wing_engines.set_color(*random.choice(ENGINE_COLORS)) self.model.set_scale(MISSILE_SCALE) self.model.set_hpr(0,0,0) return self.model