A Simple Game
Chapter I
Well, you made the project on your IDE, know PowerHigh works. Now let's do a very simple game!
First of all, i assume you know how to use java 9 modules. Since you know how to do it, make your module-info requires powerhigh.core and powerhigh.swing
Now let's create a new class, extending SimpleGame:
You will see that since SimpleGame is an abstract class, you need to extend some methods, they will be explained later, overriding them should give the following:
The update(Interface, double) method takes in input an interface, it's purpose is for update (physics, movements) and input of the game.
The exit(Interface) will be automatically called by SimpleGame when the Interface is disposed (in most cases, closed).
The init(Interface) is called once just before the Interface is showed up on screen. It's mostly where we're gonna set size, viewports, attributes, etc.
If you understood all that, you know that to set the title, size, and resizability, it's to do in the init(Interface) method, it is very easy to do it!
Not hard to understand what thoses methods do! Now you arleady can run the project, and you will see a black window with "Hello PowerHigh" as title! Congratulations!
Last updated