Hello
I was wondering how to make a pacman ghost follow pacman I have tried using my script but no matter how I change it, it always ends up with the same result, stuck in a wall.
If you can offer some help it would be greatly appreciated.
Offline
I've read something about the real pacman ghost AI works, I think it checks each spot around them to see which is closest to pacman, and then move that way.
Offline
It completely depends on how you game is set out.
Could you upload it? Trying to make a script for something we have not seen is almost impossible.
Also "My script" does not really tell us anything about what does not work.
Offline
ScratchReallyROCKS wrote:
I've read something about the real pacman ghost AI works, I think it checks each spot around them to see which is closest to pacman, and then move that way.
I think this is the only way but it could be hard . If you can't get that to work try downloading another pacman and see how they do it!
Offline
AeroX2 wrote:
Ive had a look at other pacman scripts but they all are just a line of ifs which makes it very confusing and hard to understand
Well, that's what the AI is, and why they're not exactly simple enough for us to give any definite answer. You just need an if block for every condition, and what it should do in that situation.
Offline
It is really difficult to make a project go through a maze towards a specific point. It took me quite a while to figure out how to do it (several months, in fact), but I was able to concoct a simple Pathing AI: http://scratch.mit.edu/projects/coolstuff/1034493
However, giving it a "personality" like the Pacman ghosts could be really difficult... I wouldn't recommend it to anyone with anything short of, well, a lot of experience.
Offline
To make any ghost chase pacman, you make them continualy check if their y or x position equals pacmans y or x position, this checks if they are in a line with pacman, you then put a point twords pacman. If they "see" pacman they will chase him untill they lose sight of him.
Offline
I Infact Is Making A Pacman Simulater. So I Could Help You by giving you my script after its finshed.
Last edited by paperninjamaster (2010-12-31 14:01:33)
Offline
ScratchReallyROCKS wrote:
I've read something about the real pacman ghost AI works, I think it checks each spot around them to see which is closest to pacman, and then move that way.
To read about the AI of each ghost, go here.
I once tried to make a Pac-man game with Scratch but gave up because I was frustrated and bored, and it was running slowly. However, I have successfully created a Pacman game with my brother using Javascript; yes, I mean javascript to those of you who think it is impossible to make games with it .
Also, the ghosts don't use any pathfinding AI. They simply go in the cardinal direction that seems most direct to get to where they're going, so they sometimes take the long-way around to get somewhere.
Offline