Ejemplo n.º 1
0
 def __init__(self, ship, n, light_angle):
     gloss.Sprite.__init__(self,
                           gloss.Texture('art/shuttle_light_%s.png' % n))
     self._ship = ship
     self.gspeed = ship.gspeed
     self.gcenter = ship.gcenter
     self.mass = 4
     self._raw_scale = .015  # fixme
     self._alpha = 0
     self._light_angle = degrees(light_angle)
Ejemplo n.º 2
0
 def __init__(self, pcenter):
     self._texture = gloss.Texture("fire.png")
     self._ps = gloss.ParticleSystem(
         self._texture,
         onfinish=self._finished,
         position=pcenter.tup,
         name="fire",
         initialparticles=25,
         particlelifespan=750,
         drag=4,
         minspeed=50,
         maxspeed=100,
         minscale=game.zoom,
         maxscale=game.zoom,
     )
Ejemplo n.º 3
0
 def __init__(self, gcenter):
     gloss.Sprite.__init__(self, gloss.Texture('art/shuttle.png'))
     self._angle = degrees(0)
     self._target_angle = degrees(0)
     self._angular_velocity = degrees_per_sec(0)
     self._orbit_prediction_thread = None
     self._orbit_prediction_running = False
     self._raw_scale = .025
     self._raw_scale = .015  # fixme
     self._tp = None
     self.gcenter = gcenter
     self.gspeed = GVector(0, -0.3)
     self.mass = 4
     self.orbit = ()
     self.propellent = 1500
     self.hull_temperature = 0
     self.landing_gears_deployed = False
     self._start_orbit_prediction()
Ejemplo n.º 4
0
 def __init__(self, gcenter):
     texture = pygame.Surface(size=(1, 1))
     texture = gloss.Texture("art/red_dot.png")
     wind = gcenter - game._suns[0].gcenter
     wind.modulo = 200
     self._ps = gloss.ParticleSystem(
         texture,
         onfinish=self._finished,
         position=gcenter.on_screen.tup,
         name="fire",
         initialparticles=1,
         particlelifespan=275,
         wind=map(int, wind.tup),
         minspeed=100,
         maxspeed=300,
         minscale=game.zoom * .1,
         maxscale=game.zoom * .1,
         startcolor=Color(1, 0, 0, 1),
         endcolor=Color(1, 1, 0, 0),
     )
Ejemplo n.º 5
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)
Ejemplo n.º 6
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),
        )
Ejemplo n.º 7
0
 def draw_loading_screen(self):
     """Display an intro image while loading sprites"""
     s = gloss.Sprite(gloss.Texture('art/loading.png'))
     gloss.Sprite.draw(s, scale=self.resolution.x / 800.0)
Ejemplo n.º 8
0
 def __init__(self, fname, raw_scale):
     self._angle = 0
     gloss.Sprite.__init__(self, gloss.Texture(fname))
     self._raw_scale = raw_scale
     self._raw_rotation = 0.0