Skip to content

Querying the state of the game

Raluca D. Gaina edited this page Feb 12, 2018 · 1 revision

Some functions can be used to retrieve information of the current state of the game. StateObservation provides information about the game (score, winner, game tick, available actions). See the most important function:

State Observation functions Description
double getGameScore() Gets the score of the game at this observation.
int getGameTick() Returns the game tick of this particular observation.
Types.WINNER getGameWinner() Indicates if there is a game winner in the current observation. Possible values are Types.WINNER.PLAYER_WINS, Types.WINNER.PLAYER_LOSES and Types.WINNER.NO_WINNER.
Dimension getWorldDimension() Returns the world dimensions, in pixels.
int getBlockSize() Indicates the width in pixels of a sprite in the game.
boolean isGameOver() Indicates if the game is over or if it hasn't finished yet.

Table of Contents:

Clone this wiki locally