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 3597738
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 18, 20262026-05-18T20:09:22+00:00 2026-05-18T20:09:22+00:00

Can anyone plese tell me How do i create a Map for PacMan in

  • 0

Can anyone plese tell me How do i create a Map for PacMan in C++.
Any Suggestions for getting m Started.?

Thanx in Advance.

  • 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. Editorial Team
    Editorial Team
    2026-05-18T20:09:22+00:00Added an answer on May 18, 2026 at 8:09 pm

    That’s quite a wide question and depends on additional requirements. Basically I would go for a two-dimensional array that will simply represent the cells. Each cell would contain either:

    1. A wall
    2. A one-way wall (to represent the gate through which the monsters go)
    3. An empty cell
    4. A cell with food
    5. A “teleportation cell” that will send the pacman to a different place (to represent the two cells on the left and right sides)

    The monsters and the pacman itself will not be represented in the map. Instead each should just have his position in the map.

    This doesn’t require C++, it only requires C, but if you deliberately want a C++ solution you can replace the arrays with a vector, or in this case, a vector of vectors.

    How will the monsters move

    If you want to reach point A from point B in a map, you can use any of a variety of algorithms that will find you the shortest path within the map – like the A* algorithm. However, in this case, you need to take a few things into account:

    1. The pacman itself is always on the move, which changes the path from one step to another.
    2. You don’t want all the monsters to have the same path, otherwise you won’t really have several monsters, because all of them will move the same.
    3. You don’t want the monsters to be extremely effective, because then the game will become too hard and will not be much fun.

    I would suggest using some random decisions when the monster reaches a “crossroad”, along with a general bias towards the pacman itself. So if the monster is at a point where there are 3 directions, like East, West and North, and the pacman is to the north, I would make a random decision with 40% chance to the north, 30% to the east and 30% to the west.

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

Sidebar

Related Questions

Can i get the source code for a WAMP stack installer somewhere? Any help
I need to solve the following question which i can't get to work by
If all tables I want to delete from have the column gamer_id can i
Every time that I want to do a Layout, I'm getting a black layout
I want to use a temp directory that will be unique to this build.
I'm trying to build a C++ extension for python using swig. I've followed the
I'm in the process of porting some code from Linux to Mac OS X.
i have a input tag which is non editable, but some times i need
I have a new web app that is packaged as a WAR as part
We manage a site for a medical charity. They have a number of links

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.