Class SnakeAI
java.lang.Object
GameObject
Snake
SnakeAI
Class of snake AI.
-
Field Summary
Fields inherited from class Snake
board, body, color, direction, newPartsNumber, points, TIMER_BASE_VALUE
Fields inherited from class GameObject
game, timer
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
control()
This method move snake using pathfinding.protected void
Like unity OnDestroy (invoke after destroy object or on end of game).protected void
render(Graphics2D g)
Method who render a object on screen (invoke on begin of each frames).Methods inherited from class Snake
awake, dead, Head, ModeLeft, MoveDown, MoveRight, MoveUp, start, update
Methods inherited from class GameObject
getDeltaTime, setTimer, timerClockDown
-
Constructor Details
-
SnakeAI
Constructor that pass reference to board.
-
-
Method Details
-
control
protected void control()This method move snake using pathfinding. -
onDestroy
protected void onDestroy()Description copied from class:GameObject
Like unity OnDestroy (invoke after destroy object or on end of game). -
render
Description copied from class:GameObject
Method who render a object on screen (invoke on begin of each frames).- Overrides:
render
in classGameObject
-