Beispiel #1
0
def emitter_11():
    """Burst, emit from center, velocity along a line"""
    e = arcadeplus.Emitter(
        center_xy=CENTER_POS,
        emit_controller=arcadeplus.EmitBurst(BURST_PARTICLE_COUNT // 4),
        particle_factory=lambda emitter: arcadeplus.LifetimeParticle(
            filename_or_texture=TEXTURE,
            change_xy=arcadeplus.rand_on_line((-2, 1), (2, 1)),
            lifetime=DEFAULT_PARTICLE_LIFETIME,
            scale=DEFAULT_SCALE,
            alpha=DEFAULT_ALPHA))
    return emitter_11.__doc__, e
Beispiel #2
0
def emitter_25():
    """Interval, emit from center, velocity along a line"""
    e = arcadeplus.Emitter(center_xy=CENTER_POS,
                           emit_controller=arcadeplus.EmitterIntervalWithTime(
                               DEFAULT_EMIT_INTERVAL, DEFAULT_EMIT_DURATION),
                           particle_factory=lambda emitter: arcadeplus.
                           LifetimeParticle(filename_or_texture=TEXTURE,
                                            change_xy=arcadeplus.rand_on_line(
                                                (-2, 1), (2, 1)),
                                            lifetime=DEFAULT_PARTICLE_LIFETIME,
                                            scale=DEFAULT_SCALE,
                                            alpha=DEFAULT_ALPHA))
    return emitter_25.__doc__, e
Beispiel #3
0
def emitter_6():
    """Burst, emit on line"""
    e = arcadeplus.Emitter(
        center_xy=CENTER_POS,
        emit_controller=arcadeplus.EmitBurst(BURST_PARTICLE_COUNT),
        particle_factory=lambda emitter: arcadeplus.LifetimeParticle(
            filename_or_texture=TEXTURE,
            change_xy=arcadeplus.rand_in_circle(
                (0.0, 0.0), PARTICLE_SPEED_SLOW),
            lifetime=DEFAULT_PARTICLE_LIFETIME,
            center_xy=arcadeplus.rand_on_line((0.0, 0.0),
                                              (SCREEN_WIDTH, SCREEN_HEIGHT)),
            scale=DEFAULT_SCALE,
            alpha=DEFAULT_ALPHA))
    return emitter_6.__doc__, e
Beispiel #4
0
def emitter_19():
    """Interval, emit on line"""
    e = arcadeplus.Emitter(
        center_xy=(0.0, 0.0),
        emit_controller=arcadeplus.EmitterIntervalWithTime(
            DEFAULT_EMIT_INTERVAL, DEFAULT_EMIT_DURATION),
        particle_factory=lambda emitter: arcadeplus.LifetimeParticle(
            filename_or_texture=TEXTURE,
            change_xy=arcadeplus.rand_in_circle(
                (0.0, 0.0), PARTICLE_SPEED_SLOW),
            lifetime=DEFAULT_PARTICLE_LIFETIME,
            center_xy=arcadeplus.rand_on_line((0.0, 0.0),
                                              (SCREEN_WIDTH, SCREEN_HEIGHT)),
            scale=DEFAULT_SCALE,
            alpha=DEFAULT_ALPHA))
    return emitter_19.__doc__, e
Beispiel #5
0
def test_rand_on_line():
    """Smoke test"""
    arcadeplus.rand_on_line((-5.5, -2.2), (5.2, 14.7))