- Home /
PacMan IA of ghost using nodes/waypoints
I am studying old game programming that will be used in my final exam of the course of games, but I have difficulty understanding how I can make the ghosts move randomly through the labyrinth through nodes / waypoints (this is the first time I work with nodes / waypoints so I do not know how to program and if they are the same thing).
Thank you from anyone who can help, I researched and saw several videos teaching to program the AI of the ghosts, but none worked with me.
My most recent attempt was to follow the "The Weekly Coder" video tutorials video "How to make a game like Pac-Man in Unity 5 - Part 4 - Moving Node to Node" I followed the tutorial since the first part of it, but at the time of testing the unity of the error in this line of video
(
if (o.name! = "Pacman")
{
board [(int) pos.x, (int) pos.y] = o;
}
)
The error says "Array index is out of range"
Thanks to all who can help !!
Hi, the error means that you have probably a GameObject that is out of the given position (that from the tutorial I saw it is 28 for the x position and 36 for the y position. Check if you haven’t GameObjects out of this positions.
Here there is a good tutorial to understand all ghosts behaviors: http://gameinternals.com/post/2072558330/understanding-pac-man-ghost-behavior