Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 152143
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T09:34:14+00:00 2026-05-11T09:34:14+00:00

Essentially its a pacman clone game I’m working on. I have an Enemy class,

  • 0

Essentially its a pacman clone game I’m working on. I have an Enemy class, and 4 instances of this class created which all represent 4 ghosts of the game.

All ghosts start up in random areas of the screen and then they have to work their way towards the pacman character. As the player controls the pacman, moving it around, they should follow it and take the nearest possible way towards him.

There is no maze/obstacles (yet) so the entire map (400×400 pixels) is open ground to them.

For the player and each Ghost, i can retrieve the X, Y, image width and height attributes. Also, i already have a collision detection algorithm, so not worried about that, just about the ghosts finding their way to pacman.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. 2026-05-11T09:34:15+00:00Added an answer on May 11, 2026 at 9:34 am

    For a good pathfinding algorithm, using A* would probably be a good idea, however, for a simple game that doesn’t require sophisticated, efficient, nor effective path searching, simply having the characters move toward a target by finding out the direction of the target should be sufficient.

    For example, the decision to make the character move, in pseudocode:

    if (target is to the left of me):     move(left); else     move(right);  if (target is above me):     move(up); else     move(down); 

    Yes, the character is not going to make the most efficient movement, but it will get closer and closer to the target on each iteration of the game loop.

    It’s also my guess that an arcade game from the early 80’s probably wouldn’t be using sophisticated pathfinding algorithms.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So I am working on a game, essentially, its a top down view of
I am working on a program which is essentially single-threaded, and its only thread
I have a working Browser Helper Object (BHO) which is essentially an ATL based
I have the following HTML code, which essentially copies a textarea box, including its
We have an application that is essentially implementing its own messaging queue. When a
I have a largish complex app around 27k lines. Its essentially a rule drive
I essentially have the same goal as in this question: Calling a jQuery plugin
I have the following two classes: public class Animal { public Animal() { this(Animal->Horse);
I'm using genfromtxt to import essentially a 2D array that has all its values
Essentially what I have is an entity class (Article) and one article may belong

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.