def generate_terrain(self): generator = PlasmaFractalGenerator(200) generator.apply(self.gameGrid) self.gameGrid.connect_grid() generator = MeteorTerrainGenerator() smoother = Smoother(0.5) generator.apply(self.gameGrid) smoother.apply(self.gameGrid)
def generate_terrain(self): generator = PlasmaFractalGenerator(400) generator.apply(self.gameGrid) self.gameGrid.connect_grid() generator = MeteorTerrainGenerator() smoother = Smoother(0.5) generator.apply(self.gameGrid) smoother.apply(self.gameGrid) climatizer = LatitudeClimateBands() climatizer.apply(self.gameGrid)
columns = SCREEN_WIDTH / zoom rows = SCREEN_HEIGHT / zoom # create the grid, fill it with nodes # this is currently a bit slow... gameGrid = Grid() for x in range(0, X_GRID): for y in range(0 ,Y_GRID): terrain = TerrainData() gameGrid.add_node((x, y, 0), terrain) gameGrid.connect_grid() generator = MeteorTerrainGenerator() smoother = Smoother(0.5) generator.apply(gameGrid) smoother.apply(gameGrid) font_file = pygame.font.match_font('freemono') font = pygame.font.Font(font_file, FONT_SIZE) font.set_bold(True) movers = [] def rectRender(obj, loc): """ Renders a renderable object as a rectangle at the given grid square. """ rectX, rectY, rectZ = loc newrectX = (rectX - viewportX) * zoom newrectY = (rectY - viewportY) * zoom