Class SnakeAI


public class SnakeAI extends Snake
Class of snake AI.
  • Constructor Details

    • SnakeAI

      public SnakeAI(Board board)
      Constructor that pass reference to board.
  • Method Details

    • control

      protected void control()
      This method move snake using pathfinding.
      Overrides:
      control in class Snake
    • onDestroy

      protected void onDestroy()
      Description copied from class: GameObject
      Like unity OnDestroy (invoke after destroy object or on end of game).
      Overrides:
      onDestroy in class Snake
    • render

      protected void render(Graphics2D g)
      Description copied from class: GameObject
      Method who render a object on screen (invoke on begin of each frames).
      Overrides:
      render in class GameObject