示例#1
0
 def __init__(self, world):
     self.world = world
     self.camera = Camera(tracking=self)
     self.pos = (0.0, 52)
     self.angle = -pi / 2.0
     self.vel_angle = 0.0
     heightmap = heightmap_1d(12, mul=0.7)
     self.heightmap = [(x + 1.0) * 4.0 + 2.0 for x in heightmap]
     self.x = 0
     self.stack = []
示例#2
0
 def __init__(self):
     self.world = World()
     self.heightmap = heightmap_1d(14)
     self.camera = Camera()
     self.x = 0
     try:
         shutil.rmtree("data/world")
     except OSError:
         pass
     os.makedirs("data/world")
示例#3
0
 def __init__(self, world):
     self.world = world
     self.camera = Camera(tracking=self)
     self.pos = (0.0, 52)
     self.angle = -pi / 2.0
     self.vel_angle = 0.0
     heightmap = heightmap_1d(12, mul=0.7)
     self.heightmap = [(x + 1.0) * 4.0 + 2.0 for x in heightmap]
     self.x = 0
     self.stack = []
示例#4
0
 def __init__(self):
     self.world = World()
     self.heightmap = heightmap_1d(14)
     self.camera = Camera()
     self.x = 0
     try:
         shutil.rmtree("data/world")
     except OSError:
         pass
     os.makedirs("data/world")
示例#5
0
 def __init__(self):
     self.lunarsurface = LunarSurface()
     self.texture = pygame.Surface((512, 512))
     self.surface = pygame.Surface((512, 512))
     self.surface.set_colorkey((255, 0, 255))
     self.surface.fill((255, 0, 255))
     heightmap = heightmap_1d(9)
     for x in range(512):
         height = int((heightmap[x] + 1.0) * 256 + 0)
         for y in range(512):
             a = random.uniform(16.0, 32.0)
             self.texture.set_at((x, y), (a, a, a))
         for y in range(512 - height, 512):
             a = random.uniform(16.0, 32.0)
             self.surface.set_at((x, y), (a, a, a))
示例#6
0
文件: cave.py 项目: Cynerva/jttcotm
 def __init__(self):
     self.lunarsurface = LunarSurface()
     self.texture = pygame.Surface((512, 512))
     self.surface = pygame.Surface((512, 512))
     self.surface.set_colorkey((255, 0, 255))
     self.surface.fill((255, 0, 255))
     heightmap = heightmap_1d(9)
     for x in range(512):
         height = int((heightmap[x] + 1.0) * 256 + 0)
         for y in range(512):
             a = random.uniform(16.0, 32.0)
             self.texture.set_at((x, y), (a, a, a))
         for y in range(512 - height, 512):
             a = random.uniform(16.0, 32.0)
             self.surface.set_at((x, y), (a, a, a))
示例#7
0
    def __init__(self, depth=3):
        self.starfield = Starfield()

        self.textures = []
        mul = 0.125 / 2.0
        for _ in range(depth):
            texture = pygame.Surface((512, screen_height * 2))
            texture.set_colorkey((255, 0, 255))
            texture.fill((255, 0, 255))
            heightmap = heightmap_1d(9)
            for x in range(512):
                min_y = int((heightmap[x] * mul + 1.0) / 2.0 * screen_height)
                for y in range(min_y, screen_height * 2):
                    noise = random.uniform(0.9, 1.0)
                    color = tuple(255.0 * noise * mul for _ in range(3))
                    texture.set_at((x, y), color)
            self.textures.append(texture)
            mul *= 2