MazeAI / MazeAIPlayer

Namespace Playniax.MazeAI

Inherits from MazeAISprite

Script can be found in Assets/Playniax/Framework/Extensions/MazeAI/Scripts (MonoBehaviour)/MazeAIPlayer.cs

Class MazeAIPlayer

Description

Base class for maze player sprites. The sprite will display a Pacman-like behaviour.

Public fieldsDescription
Direction startDirection = Direction.Right Start direction.
bool pacmanMode When enabled the sprite will continue to move on its path until the first possible exit.
bool allowScrolling Whether the camera follows the sprite or not.
float scrollingSteps = 15 Camera speed.
bool SetCameraPositionOnAwake = true Whether the camera starts at the same position as the sprite or not.

Public MethodsDescription
virtual void OnSetDirection(Vector3 direction)OnSetDirection is called when the sprite changes direction. Implement OnSetDirection if you for example want the sprite to face the correct direction.
void BorderControl(bool pause)Call this from update if you want the sprite to respect tilemap borders.
virtual bool IsObstacle(Tilemap tilemap, Vector3 position, Vector3[] contactPoints, int contactPoint)Returns whether a tile in the tilemap is an obstacle or not.
void Left()Call this if you want the sprite to go left.
void Right()Call this if you want the sprite to go right.
void Up()Call this if you want the sprite to go up.
void Down()Call this if you want the sprite to go down.