Class EnemyAI

  • All Implemented Interfaces:
    Constants, java.lang.Runnable

    public class EnemyAI
    extends AI
    implements java.lang.Runnable, Constants
    This is an implementation of the Depth-First search algorithm
    • Constructor Detail

      • EnemyAI

        public EnemyAI​(Scene scene,
                       Enemy enemy)
        Initialize the algorithm
        Parameters:
        scene - The scene the AI is in
        enemy - The enemy the AI is controlling
    • Method Detail

      • search

        public boolean search​(State searchInitial,
                              State searchGoal)
        Find a path to the objective
        Parameters:
        searchInitial - The start point
        searchGoal - The goal
        Returns:
        Returns true if a path to the goal is found or false otherwise
      • run

        public void run()
        Run the steps in a loop
        Specified by:
        run in interface java.lang.Runnable
        Overrides:
        run in class AI