use of com.lilithsthrone.game.character.PlayerCharacter in project liliths-throne-public by Innoxia.
the class Main method startNewGame.
/**
* Starts a completely new game. Runs a new World Generation.
*/
public static void startNewGame(DialogueNodeOld startingDialogueNode) {
Main.game = new Game();
// Generate world:
if (!(gen == null))
if (gen.isRunning()) {
gen.cancel();
}
gen = new Generation();
gen.setOnSucceeded(new EventHandler<WorkerStateEvent>() {
@Override
public void handle(WorkerStateEvent t) {
FXMLLoader loader = new FXMLLoader(getClass().getResource("/com/lilithsthrone/res/fxml/main.fxml"));
Pane pane;
try {
if (Main.mainScene == null) {
pane = loader.load();
Main.mainController = loader.getController();
Main.mainScene = new Scene(pane);
if (Main.getProperties().lightTheme)
Main.mainScene.getStylesheets().add("/com/lilithsthrone/res/css/stylesheet_light.css");
else
Main.mainScene.getStylesheets().add("/com/lilithsthrone/res/css/stylesheet.css");
}
Main.primaryStage.setScene(Main.mainScene);
} catch (Exception e) {
e.printStackTrace();
}
Main.game.setPlayer(new PlayerCharacter(new NameTriplet("Player"), "", 1, Gender.M_P_MALE, RacialBody.HUMAN, RaceStage.HUMAN, null, WorldType.EMPTY, PlaceType.GENERIC_MUSEUM));
Main.game.initNewGame(startingDialogueNode);
Main.game.endTurn(0);
// Main.mainController.processNewDialogue();
}
});
new Thread(gen).start();
}
Aggregations