Ejemplo n.º 1
0
 def __init__(self, *args, **kwargs):
     super(BouncySphere, self).__init__(*args, **kwargs)
     self.radius = 20
     self.slices = 12
     x = y = z = self.radius
     self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
     self.aabb = self.oobb.transformed(self.forward, self.up)
Ejemplo n.º 2
0
 def __init__(self, *args, **kwargs):
     super(CubeTest, self).__init__(*args, **kwargs)
     self.side = 20
     self.slices = 1
     x = y = z = self.side / 2
     self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
     self.aabb = self.oobb.transformed(self.forward, self.up)
Ejemplo n.º 3
0
 def __init__(self, team=None, **kwargs):
     super(SpawnPoint, self).__init__(**kwargs)
     x = y = z = 10
     self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
     self.aabb = self.oobb.transformed(self.forward, self.up)
     self.team = team
     self.spawnable = True
     self.alive = True
Ejemplo n.º 4
0
 def __init__(self, *args, **kwargs):
     super(Cliff, self).__init__(*args, **kwargs)
     self.side = 25
     self.oobb = collision.BoundingBox(-self.side / 2, self.side / 2,
                                       -self.side / 2, self.side / 2,
                                       -self.side / 2, self.side / 2)
     self.aabb = self.oobb.transformed(self.forward, self.up)
     self.color = (0.0, 0.5, 0.06)
Ejemplo n.º 5
0
 def __init__(self, *args, **kwargs):
     super(PowerUp, self).__init__(*args, **kwargs)
     self.radius = 20
     self.slices = 12
     self.color = (0.0, 1.0, 0.0, 0.5)
     x = y = z = self.radius
     self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
     self.aabb = self.oobb.transformed(self.forward, self.up)
Ejemplo n.º 6
0
 def __init__(self, *args, **kwargs):
     super(Rocket, self).__init__(*args, **kwargs)
     #self.velocity = (0,0,0)
     self.radius = 1
     self.slices = 12
     x = y = z = self.radius
     self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
     self.aabb = self.oobb.transformed(self.forward, self.up)
Ejemplo n.º 7
0
 def __init__(self, *args, **kwargs):
     super(XWing, self).__init__(*args, **kwargs)
     self.side = 25
     self.oobb = collision.BoundingBox(-self.side / 2, self.side / 2,
                                       -self.side / 2, self.side / 2,
                                       -self.side / 2, self.side / 2)
     self.aabb = self.oobb.transformed(self.forward, self.up)
     self.color = (1.0, 1.0, 1.0)
     self.texture = pyglet.image.load('../models/xwing.jpg').get_texture()
Ejemplo n.º 8
0
 def __init__(self, gate, position, forward, up, color):
     self.gate = gate
     self.health = 100
     self.side = 5
     super(SpawnTarget, self).__init__(position, forward, up)
     self.color = color
     self.oobb = collision.BoundingBox(-self.side / 2, self.side / 2,
                                       -self.side / 2, self.side / 2,
                                       -self.side / 2, self.side / 2)
     self.aabb = self.oobb.transformed(self.forward, self.up)
Ejemplo n.º 9
0
 def __init__(self, *args, **kwargs):
     super(TorusTest, self).__init__(*args, **kwargs)
     self.radius = 5
     self.inner_radius = 0.5
     self.slices = 100
     self.inner_slices = 50
     x = y = self.radius + self.inner_radius
     z = self.inner_radius
     self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
     self.aabb = self.oobb.transformed(self.forward, self.up)
Ejemplo n.º 10
0
 def __init__(self, *args, **kwargs):
     super(Wall, self).__init__(*args, **kwargs)
     self.size = 500
     x = y = self.size / 2
     self.oobb = collision.BoundingBox(-x - 50, x + 50, -y - 50, y + 50, 0,
                                       -100)
     self.aabb = self.oobb.transformed(self.forward, self.up)
     self.color = (0.1, 0, 0.06)
     texture_image = pyglet.image.load('../images/star_background.jpg')
     # self.texture = texture_image.get_texture()
     self.texture = pyglet.image.TileableTexture.create_for_image(
         texture_image)
Ejemplo n.º 11
0
    def __init__(self, **kwargs):
        super(SpawnGate, self).__init__(**kwargs)
        self.health = 100
        self.radius = 5
        self.inner_radius = 0.5
        self.slices = 5
        self.inner_slices = 8
        x = y = self.radius + self.inner_radius
        z = self.inner_radius
        self.oobb = collision.BoundingBox(-x, x, -y, y, -z, z)
        self.aabb = self.oobb.transformed(self.forward, self.up)

        self.target_points = None
        self.down_gates = 0
Ejemplo n.º 12
0
    def __init__(self, team, name, pos = Vector3(0,0,0), forward = Vector3(0,0,0), up = Vector3(0,0,0)):
        super(Player, self).__init__(pos, forward, up)

        self.team, self.name = team, name
        self.health = settings.MAX_HEALTH
        self.kills, self.deaths = 0, 0
        self.dead = False

        self.oobb = collision.BoundingBox(-2.5, 2.5, -2.5, 2.5, -2.5, 2.5)
        self.aabb = self.oobb.transformed(self.forward, self.up)
        self.collision_reaction_default = self.collision_reaction
        self.laser_mana = 100
        self.laser_fire = False
        self.maxed_laser = False
        self.is_firing = False
        # because the server is stupid
        self.l_t = time()
        self.last_time = time()
        # hit detector
        self.hit_by = 0
        self.last_health = self.health