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_VALUEFields inherited from class GameObject
game, timer -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcontrol()This method move snake using pathfinding.protected voidLike unity OnDestroy (invoke after destroy object or on end of game).protected voidrender(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, updateMethods 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:GameObjectLike unity OnDestroy (invoke after destroy object or on end of game). -
render
Description copied from class:GameObjectMethod who render a object on screen (invoke on begin of each frames).- Overrides:
renderin classGameObject
-