Ejemplo n.º 1
0
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)
Ejemplo n.º 2
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)
Ejemplo n.º 3
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)
Ejemplo n.º 4
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)
Ejemplo n.º 5
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)
Ejemplo n.º 6
0
    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)
Ejemplo n.º 7
0
 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)
Ejemplo n.º 8
0
    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)
Ejemplo n.º 9
0
    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)