You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Almas Baimagambetov edited this page Oct 12, 2017
·
3 revisions
Game state is nothing more (at the moment) than a bunch of observable values that affect the game.
A reference to GameState can be obtained as follows:
GameStatestate = getGameState();
There are five types of used values:
boolean
int
double
String
Object (anything not from above falls under this category)
Each value has a name associated with it.
A raw value can be accessed by:
intlives = state.getInt("lives");
Each value is backed up by a JavaFX Property.
This means you can listen for changes and you can also bind to the properties for auto-updates.
A property value can be accessed by: