AI-Project/survival/biomes/noise.py

7 lines
250 B
Python
Raw Permalink Normal View History

2021-05-10 12:56:08 +02:00
from perlin_noise import PerlinNoise
def generate_noise(width: int, height: int, octaves, seed):
noise_map = PerlinNoise(octaves=octaves, seed=seed)
return [[noise_map([x / width, y / height]) for y in range(width)] for x in range(height)]