Hello people!,
I was programming games in c++, and now Im moving to Java world ;D.
In my game design, I use a GameContext interface:
public interface GameContext {
public void start(); // called by GamePlayer
public void logic(InputEvents i); // InputEvents are all my game inputs
public void render(Screen s); // Screen is another class from my package
public void end(); // called by GamePlayer
}
And a GamePlayer, that plays the GameContext:
class GamePlayer {
public void play(GameContext g) {
g.start();
// game loop
g.logic(InputEvents.getInstance());
g.render(Screen.getInstance());
// end loop
g.end();
}
public void stop() { /* code */ }
}
My question is how the main game loop is coded in java, which classes should I use, and how?.
(I already now the FPS and that stuff, but I don’t know how to code it, the API is huge!!! :))
I read some books and tutorials, but they are old or very confusing :-.
Thanks in advance!