You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
571 B
34 lines
571 B
package mightypork.rogue.world.gen;
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
import mightypork.rogue.world.World;
|
|
|
|
|
|
public class WorldCreator {
|
|
|
|
public static Random rand = new Random();
|
|
|
|
|
|
public static World createWorld(long seed)
|
|
{
|
|
synchronized (rand) {
|
|
rand.setSeed(seed);
|
|
|
|
final World w = new World();
|
|
w.setSeed(seed);
|
|
|
|
final int count = 7;
|
|
|
|
for (int lvl = 1; lvl <= count; lvl++) {
|
|
w.addLevel(LevelGenerator.build(w, rand.nextLong(), lvl, LevelGenerator.DUNGEON_THEME, lvl == count));
|
|
}
|
|
|
|
w.createPlayer();
|
|
|
|
return w;
|
|
}
|
|
}
|
|
|
|
}
|
|
|