Pac man ghost ai

This forum is currently in read-only mode.
From the Asset Store
This ghastly character will bring the spooky vibes right into your game with AAA Game Character Ghost.
  • Thank you Pixel,

    You did very well but to be honest this is beyond my skills! it seems you got the logic and a bit of Math knowledge ! which i don t have.Everybody need to know that the guys from Namco who did this game where absolutly genious.Pac man is not a simple game , it need a foxy approach.I like the idea to check wether or not there is a wall or not in any direction and that the ghost do not systematicaly engage in a free space but in a random way(i can t find the process of this randomness).i think from there it could be possible to make a kind a chazing mode.I m 3d artist and not a coder , i just know a bit of python.I m going to decrypt this code line by line until i understand the way you came to this.

    questions:why you did not use the grid object ?

    Do you think with more tools in construct it could be simpler ? if yes which kind of tools

    do you think there is another way to accomplish this ?

    Thank you from the community for your remarquable help and kindness.


  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • I don't think the grid behavior works too well for a Pac-Man game, since the sprite would only be able to move from grid space to grid space. That would be especially annoying if you were using it for the player sprite itself.

    I'm pretty sure there are many other ways to do the same thing, it's just the one that came to my mind. If somebody had a very simple solution I'd like to see that too.

    Anyway, I found one bug in my latest example. Has to do with the starting position of ghosts which can create infinite loops right on startup (my first example didn't have that bug). I've fixed this and added the ability for ghosts to handle a dead end (to turn around, this would have caused a infinite loop in both older examples).

    Also I've turned it into something a little different. Right now you can only draw your level, place ghosts and then run it to see what happens. I know it's far from a complete Pac-Man game yet. But I believe this could be really cool with features like being able to load different tile/sprite sets and save/load created levels of course. I'm currently thinking about turning this into a little side project of mine.

    No source for this sry, but maybe it's still interesting: DOWNLOAD

    [quote:22wev2cc]I m going to decrypt this code line by line until i understand the way you came to this.

    That's a very good attitude right there. Once you get the hang of it you'll come up with your own (better?) solution.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)