Exemplo n.º 1
0
 def init(self, actor: stdbomb.Bomb, position: Sequence[Union[int, float]],
          velocity: Sequence[Union[int, float]],
          materials: Sequence[ba.Material]):
     factory = stdbomb.BombFactory.get()
     actor.node = ba.newnode('prop',
                             delegate=actor,
                             attrs={
                                 'body':
                                 'landMine',
                                 'model':
                                 factory.land_mine_model,
                                 'light_model':
                                 factory.land_mine_model,
                                 'color_texture':
                                 ba.gettexture('achievementCrossHair'),
                                 'position':
                                 position,
                                 'velocity':
                                 velocity,
                                 'shadow_size':
                                 0.44,
                                 'reflection':
                                 'powerup',
                                 'reflection_scale': [1],
                                 'materials':
                                 materials
                             })
Exemplo n.º 2
0
    def init(self, actor: stdbomb.Bomb, position, velocity, materials):
        factory = stdbomb.BombFactory.get()
        actor.node = ba.newnode('prop',
                                delegate=actor,
                                attrs={
                                    'position': position,
                                    'velocity': velocity,
                                    'body': 'sphere',
                                    'materials': materials
                                })

        actor.first_shield = ba.newnode(
            'shield', owner=actor.node, attrs={
                'color': (1, 1, 1),
                'radius': 0.6})

        actor.node.connectattr(
            'position', actor.first_shield, 'position')

        actor.second_shield = ba.newnode(
            'shield', owner=actor.node, attrs={
                'color': (20, 0, 0),
                'radius': 0.4})

        actor.node.connectattr(
            'position', actor.second_shield, 'position')

        ba.animate(actor.second_shield, 'radius',
                   {0: 0.1, 0.05: 0.4, 0.2: 0.1, 0.25: 0.5, 0.4: 0.3, 0.7: 0.1}, True)
Exemplo n.º 3
0
 def init(self, actor: stdbomb.Bomb, position, velocity, materials):
     factory = stdbomb.BombFactory.get()
     actor.node = ba.newnode('prop', delegate=actor, attrs={
         'body': 'sphere',
         'model': factory.impact_bomb_model,
         'color_texture': ba.gettexture('ouyaAButton'),
         'position': position,
         'velocity': velocity,
         'shadow_size': 0.3,
         'reflection': 'powerup',
         'reflection_scale': [1.5],
         'materials': materials})
Exemplo n.º 4
0
    def init(self, actor: stdbomb.Bomb, position, velocity, materials):
        factory = stdbomb.BombFactory.get()
        actor.node = ba.newnode('prop',
                                delegate=actor,
                                attrs={
                                    'body': 'sphere',
                                    'body_scale': 0.85,
                                    'position': position,
                                    'velocity': velocity,
                                    'materials': materials
                                })

        actor.first_shield = ba.newnode('shield',
                                        owner=actor.node,
                                        attrs={
                                            'color': (1, 1, 1),
                                            'radius': 0.6
                                        })

        actor.node.connectattr('position', actor.first_shield, 'position')

        actor.second_shield = ba.newnode('shield',
                                         owner=actor.node,
                                         attrs={
                                             'color': (0, 0, 20),
                                             'radius': 0.4
                                         })

        actor.node.connectattr('position', actor.second_shield, 'position')

        color = {
            0: (1, 1, 1),
            1: (20, 0, 0),
            2: (20, 10, 0),
            3: (20, 20, 0),
            4: (0, 20, 0),
            5: (0, 10, 20),
            6: (0, 0, 20),
            7: (10, 0, 20),
            8: (1, 1, 1)
        }

        ba.animate_array(actor.second_shield, 'color', 3, color, True)
Exemplo n.º 5
0
 def init(self, actor: stdbomb.Bomb, position: Sequence[Union[int, float]],
          velocity: Sequence[Union[int, float]],
          materials: Sequence[ba.Material]):
     factory = StickyGiftFactory.get()
     materials += (factory.sticky_gift_material, )
     actor.node = ba.newnode('prop',
                             delegate=actor,
                             attrs={
                                 'body': 'sphere',
                                 'model': factory.sticky_gift_model,
                                 'light_model': factory.sticky_gift_model,
                                 'color_texture':
                                 factory.sticky_gift_texture,
                                 'position': position,
                                 'velocity': velocity,
                                 'shadow_size': 0.44,
                                 'reflection': 'sharper',
                                 'reflection_scale': [0, 8.5, 10],
                                 'materials': materials
                             })