-
Notifications
You must be signed in to change notification settings - Fork 0
Game class
The game class is one of the controller classes the engine has. It is used to create the basic structure of your program.
This is the method used to create a new Display(Window).
String name:
The name you want to register the display with.
Display display = Game.display("Main");
This method is used to register a new scene to your program.
Scene scene:
The scene you want to register.
String alias:
The name you want to register the scene with.
Game.addScene(new GameScene(), "Game");
Scene MenuScene = new MenuScene();
Game.addScene(MenuScene, "Menu");
This method is used to set a custom refresh rate to the logic and the render loop. If this method is not used, the frame rate will be set to 60.
int frameRate:
The refresh rate you want the program to be looped with.
Game.setFrameRate(120);
This method is used to start the render and the Logic loop. It basically brings the program to life.
Game.start();
returns the scene with the given alias.
returns an map object Map<String, Scene>
with all registered scenes.
returns an map object Map<String, Display>
with all registered displays.