Hey guys im having tons of "fun" creating a copy of the Pacman game in greenfoot
i had the great idea of trying to give the ghosts AI (its not fun...)
i got 2 questions:
how do i get the location of pacman from another actor or to another actor to be use like a variable (mainly to be used in the following question)
so i have decided to not use nodes mainly because i don't have the time so i was planning on using the turnTowards command to try and get the ghosts to track to pacman (i don't really know how else to do it =/. It wont work great but i don't know any other way of doing it.
so to get the "turnTowards" command to work im planning on getting the rotation of the ghost and rounding it to the closest direction (0,90,180,270). but I'm not sure how to code the syntax of "greaterthan 45* lessthan 135*" (45 and 135 would round to 90)
if anyone has an easier idea to do what i need please lemi know i really have no idea how else to do it
some important factors to take into account if your answering this is:
there are walls (like in the original)
i am using a different layout to normal (
)
and i would like to be able to add the different personality's to the ghosts
Thanks Thomas

