class RollingPin (WeaponEntity): weapon_model = 'obj/rolling-pin.egg' weapon_geom_free = geom.box (5, 5, 1) weapon_scale = Vec3 (.3, .3, .3) weapon_position = Vec3 (-2*.3, -5*.3, 1*.3) weapon_hpr = Vec3 (0, -90, 0)
class Lollypop (WeaponEntity): weapon_model = 'obj/lollypop.egg' weapon_geom_free = geom.box (5, 5, 1) weapon_scale = Vec3 (.3, .3, .3) weapon_position = Vec3 (-2*.3, -5*.3, 1*.3) weapon_hpr = Vec3 (0, -90, 0)
class BaseballBat (WeaponEntity): weapon_model = 'obj/baseball-bat.egg' weapon_geom_free = geom.box (5, 5, 1) weapon_scale = Vec3 (.3, .3, .3) weapon_position = Vec3 (-2*.3, -5*.3, 1*.3) weapon_hpr = Vec3 (0, -90, 0)
def __init__(self, *a, **k): super(PigeonFood, self).__init__(model=self.food_model, geometry=geom.box(2, 2, 0.5), *a, **k) self.model.setTexture(loader.loadTexture('obj/food.png')) self.model_scale = self.food_scale # A bit hackish, I guess self.entities.game.pigeon_food.append(self)
def __init__ (self, *a, **k): super (PigeonFood, self).__init__ ( model = self.food_model, geometry = geom.box (2, 2, 0.5), *a, **k) self.model.setTexture (loader.loadTexture ('obj/food.png')) self.model_scale = self.food_scale # A bit hackish, I guess self.entities.game.pigeon_food.append (self)
def __init__(self, entities=None, geometry=geom.box(1, 1, 1), category=default_category, collide=0xffff, *a, **k): super(PhysicalEntityBase, self).__init__(entities=entities, *a, **k) self._geom = geometry(entities.physics.space) self._geom.setCategoryBits(category) self._geom.setCollideBits(collide) entities.physics.register(self._geom)
def __init__ (self, entities = None, geometry = geom.box (1, 1, 1), category = default_category, collide = 0xffff, *a, **k): super (PhysicalEntityBase, self).__init__ ( entities = entities, *a, **k) self._geom = geometry (entities.physics.space) self._geom.setCategoryBits (category) self._geom.setCollideBits (collide) entities.physics.register (self._geom)
def __init__(self, *a, **k): super(Stick, self).__init__(model=self.MODEL, geometry=geom.box(5, 5, 50), *a, **k) self.model_position = Vec3(0, 0, -5) self.model.setTwoSided(True) # HACK self.hl_model = loader.loadModel(self.HL_MODEL) self.hl_model.setScale(1.3, 1.3, 1) self.scale = Vec3(near0, near0, near0) tsk = task.sinusoid(lambda x: self.set_scale(Vec3(x, x, x)), 0., 1.3) self.entities.tasks.add(tsk) self.init_task = weakref.ref(tsk)
def __init__ (self, *a, **k): super (Stick, self).__init__ ( model = self.MODEL, geometry = geom.box (5, 5, 50), *a, **k) self.model_position = Vec3 (0, 0, -5) self.model.setTwoSided (True) # HACK self.hl_model = loader.loadModel (self.HL_MODEL) self.hl_model.setScale (1.3, 1.3, 1) self.scale = Vec3 (near0, near0, near0) tsk = task.sinusoid (lambda x: self.set_scale (Vec3 (x, x, x)), 0., 1.3) self.entities.tasks.add (tsk) self.init_task = weakref.ref (tsk)