I have started on a pacman type game and I would like for the ghosts to detect pacmans location, but right now all i can do is have the ghost moving randomly is there a way to go about detection the coordinates of something within the script?
Offline
Try going into "sensing", and find the block like this:
You can use it so that the ghosts can detect pacman's location, and react to it. It's explained a little better here: http://wiki.scratch.mit.edu/wiki/()_of_ … ing_block)
Offline
That's a pretty good idea. In a pacman I used to be working on, I made a sprite that did two things forever. It went to Blinky, and it pointed towards Pacman. Then I made a list for Blinky. If the pointer was pointing mostly up, item #1 on the list would be Up. If the pointer was also pointing slightly to the right, item #2 would be Right. Basically, it was a list of which direction Blinky wanted to go. If blinky wanted to go up, but couldn't (because of a wall) he would just use the next item on the list. Hope this helps. (I do concede that it took a lot of script just to get Blinky moving on "Chase mode", I never finished scatter mode).
Offline
It's also worth pointing out (if you don't already know it) that each ghost has a "personality". Blinky always (when in "Chase mode" wants to take the shortest route to get to pacman, Pinky wants to get to two squares ahead of pacman, Inky is kind of strange... I don't really understand him. Clyde always (when in "Chase mode") is trying to move towards pacman, but once he gets close, moves back to his corner.
Offline
More than you want to know and ALMOST everything you need to know...
The Pac-Man Dossier!
Offline