1234567891011121314 |
- #include <cmath>
- #include "server/world/WorldGenerator.h"
- void WorldGenerator::generate(World& w) {
- for(int x = 0; x < w.blocks.getSize(); x++) {
- for(int z = 0; z < w.blocks.getSize(); z++) {
- int height = sinf(x * 0.25f) * 2.0f + cosf(z * 0.25f) * 2.0f + 6.0f;
- for(int y = 0; y < height; y++) {
- w.blocks.set(x, y, z, 1);
- }
- }
- }
- }
|