Package playn.core
Class Game
java.lang.Object
playn.core.Game
Defines a simple game API. It's not necessary to use this abstraction for your PlayN games, but
it takes care of some standard stuff that most games are likely to want.
This implementation separates game processing into two phases: simulation and render. The
simulation phase takes place via update
and is called with a monotonoically increasing
timer at a fixed rate. The interpolation phase takes place via paint
and is called
every time the game is rendered to the display (which may be more frequently than the simulation
is updated). The render phase will generally interpolate the values computed in update
to provide smooth rendering based on lower-frequency simulation updates.
- See Also:
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
-
Field Details
-
plat
The platform on which this game is running. -
update
A signal emitted on every simulation update. -
paint
A signal emitted on every frame.
-
-
Constructor Details
-
Game
Creates a clocked game with the desired simulation update rate, in ms.
-
-
Method Details
-
update
Called on every simulation update. The default implementation emits the clock to theupdateClock
signal, but you can override this method to change or augment this behavior.- Parameters:
clock
- a clock configured with the update timing information.
-
paint
Called on every frame. The default implementation emits the clock to thepaintClock
signal, but you can override this method to change or augment this behavior.- Parameters:
clock
- a clock configured with the frame timing information.
-