Credit to https://github.com/CapsCollective/super-mario-bros for base code
An AI system that makes Mario automatically navigate platformer levels using A* and Theta* pathfinding algorithms.
- Smart Navigation: Mario finds the best path to his destination, avoiding obstacles and death pits
- Jump Planning: Automatically jumps over gaps and onto platforms
- Real-time Mapping: Scans the screen to understand the level layout
- Visual Debugging: Shows the planned path in the Unity console
The AI converts the game world into a grid and uses pathfinding algorithms to navigate:
■Walls/Obstacles▣Mario's position!Target destination*Planned path□Safe walkable areas
- Add
Coordinates.csto an empty GameObject - Drag Mario and obstacles into the script's fields
- Make sure Mario has the "Player" tag
- Press play and watch Mario navigate automatically
Coordinates.cs- Main AI controllerAStar.cs- Pathfinding algorithmNode.cs- Grid systemPriorityQueue.cs- Pathfinding helper
C#, Unity, A*/Theta* algorithms