I've never worked with code for Video Games...Where do you start?

Dani AI

Generated

A practical, low-friction path to a Pac‑Man style game is to keep the scope tiny and iterate. already has the right starting point with C++/Java; earlier replies (for example and ) pointed toward tutorials and forums. A useful sequence: implement a tile-based maze renderer, add sprite-based Pac‑Man movement and pellet collision, add scoring/lives, then introduce ghosts one at a time. Libraries that handle windowing, input and audio will speed progress so the core work stays on game logic.

Architect the game around a fixed-timestep update and a separate render pass. Use a simple entity model for moving characters and a tilemap for collisions. A compact loop pattern (pseudo-C++):

double previous = getTime();
double lag = 0.0;
const double MS_PER_UPDATE = 16.6667; // 60 Hz

while (running) {
  double current = getTime();
  double elapsed = current - previous;
  previous = current;
  lag += elapsed;
  handleInput();
  while (lag >= MS_PER_UPDATE) {
    update(MS_PER_UPDATE / 1000.0);
    lag -= MS_PER_UPDATE;
  }
  render(lag / MS_PER_UPDATE);
}

Ghost behavior works well as a finite‑state machine (scatter, chase, frightened, eaten). The original ghosts use distinct targeting rules rather than identical random moves; pathfinding (A* or BFS on the grid) can be used to turn those targets into actual routes. Debug by visualizing tiles, target nodes and computed paths. As recommended, share source as attachments or a repo for review rather than pasting huge inline dumps. Note: Pac‑Man is a copyrighted property; avoid distributing official assets when releasing code.

Recommended Answers

All 13 Replies

Ok ok your asking a bit of a mouthful there;

Do you know any languages at all yet?

Ok ok your asking a bit of a mouthful there;

Do you know any languages at all yet?

Yes, I know C++ but still learning and the same goes for Java.

This should be good, so where do I start?

:D

shame it doesnt compile!

^^^it didn't?

it wouldn't of been much help if it did anyway, because you don't have access to the files.

I FOUND THIS: http://www.ascotti.org/programming/pie/pie.htm

Try that and post the source code if it works. I can't because I use public library computers and they have blocked downloads.

administrator restrictions will not let me post the main loop, SORRY!

you can't download it and try

Can't you just post a link to the source code, rather than keep pasting it into this thread?

Can't you just post a link to the source code, rather than keep pasting it into this thread?

i posted a link as well!

Hi.

I deleted the source code posts, as they are un-workable in this format to someone who wants to work with them. Please either post the link where they can be found, or post the files as attachments for someone to grab.

Had you been trying to get your code corrected / bug squashed, then we could have looked at them.

Christian

or post the files as attachments for someone to grab

I'll do that next time!

I want to know too

commented: Don't bump old posts =/ +0
commented: Bumping a 3 year old thread to say "I want to know too"... +0
commented: Here's to your collection of orange cookies. -4

Oh really now, did you have to necropost in a thread 3 years old?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.