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.
36 lines
642 B
36 lines
642 B
package mightypork.rogue.world;
|
|
|
|
|
|
import java.util.Random;
|
|
|
|
import mightypork.rogue.world.gen.LevelGenerator;
|
|
import mightypork.rogue.world.level.Level;
|
|
|
|
|
|
public class WorldCreator {
|
|
|
|
public static final 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 = 6;
|
|
|
|
for (int i = 1; i <= count; i++) {
|
|
final Level l = LevelGenerator.build(w, rand.nextLong(), i, LevelGenerator.DUNGEON_THEME, i == count);
|
|
w.addLevel(l);
|
|
}
|
|
|
|
w.createPlayer();
|
|
|
|
return w;
|
|
}
|
|
}
|
|
|
|
}
|
|
|