I want to try make an RPG game(in Java), and have encountered some questions regarding the framework of the game. I have very little experience with game framework, and the only tutorials I've found on this don't seem to work well for a largert RPG.
The post ended up being quite long, so if you don't feel like reading all of it I'd be grateful if you could share some links if you know about any good tutorials on this!
Since there is going to be a lot of code I suppose I will need to create separate classes for the different "game states", such as Main Menu, World Map, Local Map, Start Screen, etc. To handle these different states of the game, I decided that I will make a "game state" class (or "framework" class if you want) which has a variable "GameState(enum)" and. Furthermore, I do not want to create a new screen to draw on for each of these classes, so I should also create a separate class for the screen.
My question is: How do I go about putting all this together?
The first thing that came to mind was to start the actual game in the "game state" class. The Screen class extends JFrame, and classes that will draw on the screen extend Canvas. If the game state changes from "Loading" to "Main Menu", the "game state" class says something like "Screen.add(MainMenu)", so that everything drawn in the Main Menu class will be showed on the Screen. The "game state" class will be the core of the game, and can controll all the different classes. Does this sound like a good idea? If the player leaves the "local map" and needs to enter "world map", somehow I need to tell the State Engine to change the state. Should I simply declare an instance of "StateEngine" in the local map class, so that the local map class has access to its state engine? (and let the state engine class set it to "LocalMap.StateEngine = this"?)
I'm very sorry if my questions seem confusing. I am quite confused about this, so any suggestions for a good game framework are more than welcome!