Class Board
java.lang.Object
GameObject
Board
Class to visualize enviroment in game.
-
Field Summary
Fields inherited from class GameObject
game, timer
-
Constructor Summary
ConstructorDescriptionBoard(int obstaclesCount)
Constructor set borders of scene, spawn obstacles and fill empty spaces with cells. -
Method Summary
Modifier and TypeMethodDescriptionGetCell(int x, int y)
Return cell in position.Return cell in position.GetClosestEmptyCell(Cell cell)
Return empty cell closest to cell.GetClosestFruit(Cell origin)
Return fruit closest to origin else return null.Return first empty cell starting from (0,0) else return null.Return random empty cell on board.Methods inherited from class GameObject
awake, getDeltaTime, onDestroy, render, setTimer, start, timerClockDown, update
-
Field Details
-
board
-
-
Constructor Details
-
Board
public Board(int obstaclesCount)Constructor set borders of scene, spawn obstacles and fill empty spaces with cells.
-
-
Method Details
-
GetCell
Return cell in position. -
GetCell
Return cell in position. -
GetFirstEmptyCell
Return first empty cell starting from (0,0) else return null. -
GetRandomEmptyCell
Return random empty cell on board. If there is non return null. -
GetClosestEmptyCell
Return empty cell closest to cell. -
GetClosestFruit
Return fruit closest to origin else return null.
-