Long time CoC fan here. Ever since playing the game I've become interested in making my own CoC-style text adventure game with a higher degree of player customization. I've started working on my own project in JavaFX, and the UI is nearly done. I've been using the CoC source as a sort of guideline, the obvious difference being it's written in Flash instead of Java. I've noticed several classes in the CoC source code invoke methods in Player.as without initializing player.as in said class. I can't get this to work in Java without initializing the player class every time I want to invoke a method from it, which ends up creating a new Player object every time. I only want Player to be initialized once, but I'd like to be able to invoke methods in the Player class without creating a new Player object every single time.
Here are all the files in my project folder. To clarify further, I want to invoke Player.java methods from either of the Controller.java classes without initializing Player each time.
tl;dr
Lots of class files in CoC invoke player methods without initializing the player class. I can't figure out how to do this in javaFX without initializing player class every time, which gets ridiculously messy. If anyone has a solution to this it'd be greatly appreciated!
Here are all the files in my project folder. To clarify further, I want to invoke Player.java methods from either of the Controller.java classes without initializing Player each time.
tl;dr
Lots of class files in CoC invoke player methods without initializing the player class. I can't figure out how to do this in javaFX without initializing player class every time, which gets ridiculously messy. If anyone has a solution to this it'd be greatly appreciated!