Пример #1
0
def defaultBlock(batch):
    """Return the default block"""
    b = block.Block(
        engine.getUID('b-%s'), 'red-block.png',
        batch=batch
    )
    b.draggable = b.rotatable = True
    b.addPhysics(engine.RectangleSpritePhysics())
    return b
Пример #2
0
def defaultGun(batch):
    """Return the default gun"""
    g = gun.Gun(engine.getUID('gun-%s'),
            gun.Rocket.getRocketGenerator(
                'rocket.png', 100000, 200, 100,
                ['rock', 'decoration'], 0, 0.2, batch
            ),
            pyglet.window.key.ENTER,
            pymunk.Vec2d(50, 00),
            x=900, y=300, batch=batch
    )
    g.rotation = 0
    g.addPhysics(engine.RectangleSpritePhysics())
    g.draggable = True
    return g
Пример #3
0
def defaultRepeller(batch):
    """Return the default repeller"""
    att = attractor.Repeller(
        engine.getUID('rep-%s'), 'repeller.png', ['helium'],
        [
            (attractor.Attractor.getPowerLawAttractor(*settings.S.standard_repeller_1), 20),
            (attractor.Attractor.getPowerLawAttractor(*settings.S.standard_repeller_2), 50),
            (attractor.Attractor.getPowerLawAttractor(*settings.S.standard_repeller_3), 80),
        ],
        x=500, y=300, batch=batch
    )
    att.draggable = True
    att.rotatable = True
    att.addPhysics(engine.RectangleSpritePhysics())
    return att