Exemplo n.º 1
0
    #mass = 10
    #moment = phys.moment_for_poly(mass, points)

    #racer = phys.Body(10, moment)
    #racer.position = phys.Vec2d(Settings.SCREEN_WIDTH/2,
    #                           Settings.SCREEN_HEIGHT-30)
    #shape = phys.Poly(racer, points)
    #shape.friction = 0.5
    #shape.elasticity = 0.95
    #space.add(racer, shape)
    racer.setPhysicsSpace(space)


    track = Track()
    for t in xrange(100):
        track.addSegment(space=space)

    camP1 = Camera( (0,0), (0,                      0,Settings.SCREEN_WIDTH/2,Settings.SCREEN_HEIGHT/2))
    #camP1 = Camera( (0,0), (0,                      0,Settings.SCREEN_WIDTH,Settings.SCREEN_HEIGHT))
    camP2 = Camera( (0,0), (Settings.SCREEN_WIDTH/2,0,Settings.SCREEN_WIDTH/2,Settings.SCREEN_HEIGHT))

    camP3 = Camera( (0,0), (0,                      Settings.SCREEN_HEIGHT/2,Settings.SCREEN_WIDTH/2,Settings.SCREEN_HEIGHT/2))

    camP1.anchorPt.x -= 300

    renderer.setTrack(track)
    renderer.addCamera(camP1)
    renderer.addCamera(camP2)
    renderer.addCamera(camP3)
    renderer.addRacer(racer.shape)
Exemplo n.º 2
0
 def generateNewTrack(self):
     track = Track()
     for t in xrange(50):
         track.addSegment(space=self.physSpace)
     return track