コード例 #1
0
    def __init__(self, ship, cw=True):
        self.gcenter = ship.gcenter
        self._tex = gloss.Texture("smoke.tga")
        self._ps = [] # Running particle systems

        # Distance of the RCS thrusters from the ship center
        gdelta_front = GVector(3.5, 0)
        gdelta_front.angle_cw_degs = degrees(180) - ship._angle
        gdelta_rear = GVector(4, 0)
        gdelta_rear.angle_cw_degs = degrees(0) - ship._angle

        wind_front = PVector(100, 0)
        wind_rear = PVector(200, 0)

        if cw:
            wind_front.angle_cw_degs = degrees(270) - ship._angle
            wind_rear.angle_cw_degs = degrees(90) - ship._angle
        else:
            wind_front.angle_cw_degs = degrees(90) - ship._angle
            wind_rear.angle_cw_degs = degrees(270) - ship._angle

        self._create_particles(ship.gcenter + gdelta_front, wind_front)
        self._create_particles(ship.gcenter + gdelta_rear, wind_rear)
コード例 #2
0
    def __init__(self, ship, cw=True):
        self.gcenter = ship.gcenter
        self._tex = gloss.Texture("smoke.tga")
        self._ps = []  # Running particle systems

        # Distance of the RCS thrusters from the ship center
        gdelta_front = GVector(3.5, 0)
        gdelta_front.angle_cw_degs = degrees(180) - ship._angle
        gdelta_rear = GVector(4, 0)
        gdelta_rear.angle_cw_degs = degrees(0) - ship._angle

        wind_front = PVector(100, 0)
        wind_rear = PVector(200, 0)

        if cw:
            wind_front.angle_cw_degs = degrees(270) - ship._angle
            wind_rear.angle_cw_degs = degrees(90) - ship._angle
        else:
            wind_front.angle_cw_degs = degrees(90) - ship._angle
            wind_rear.angle_cw_degs = degrees(270) - ship._angle

        self._create_particles(ship.gcenter + gdelta_front, wind_front)
        self._create_particles(ship.gcenter + gdelta_rear, wind_rear)
コード例 #3
0
    def __init__(self, gcenter, thrust):
        self.gcenter = gcenter
        tex = gloss.Texture("smoke.tga")

        wind = PVector(game.zoom * 48, 0)
        wind.angle_cw_degs = degrees(180) - thrust.angle_cw_degs
        wind = wind.round_tup

        self._ps = gloss.ParticleSystem(
            tex,
            onfinish = self._finished,
            position = gcenter.on_screen.tup,
            name = "smoke",
            initialparticles = 20,
            particlelifespan = 190,
            growth = .8,
            wind = wind,
            minspeed = .1,
            maxspeed = 10,
            minscale = game.zoom * .05,
            maxscale = game.zoom * .1,
            startcolor = Color(1, 1, 1, 1),
            endcolor = Color(1, 1, 1, 0),
        )
コード例 #4
0
    def __init__(self, gcenter, thrust):
        self.gcenter = gcenter
        tex = gloss.Texture("smoke.tga")

        wind = PVector(game.zoom * 48, 0)
        wind.angle_cw_degs = degrees(180) - thrust.angle_cw_degs
        wind = wind.round_tup

        self._ps = gloss.ParticleSystem(
            tex,
            onfinish=self._finished,
            position=gcenter.on_screen.tup,
            name="smoke",
            initialparticles=20,
            particlelifespan=190,
            growth=.8,
            wind=wind,
            minspeed=.1,
            maxspeed=10,
            minscale=game.zoom * .05,
            maxscale=game.zoom * .1,
            startcolor=Color(1, 1, 1, 1),
            endcolor=Color(1, 1, 1, 0),
        )