Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64 Pac-Man Clone
#31
(01-06-2023, 05:44 AM)TerryRitchie Wrote:
(01-06-2023, 03:46 AM)madscijr Wrote:
(01-06-2023, 02:46 AM)TerryRitchie Wrote: Yes, I agree, a level editor would be cool. However, games that do support level editors are built with that functionality in mind before a line of code is even written. Unfortunately I didn't design the game with an editor in mind. It would take much more than a simple modification I'm afraid. I would need to rewrite the entire maze handling routine to accommodate it. I suppose a generic maze generator and handler could be designed that would allow graphics of all the various pac-man iterations to be plugged into (or evern custom graphics). But then there's the issue with movement too. Pac-man looks simple enough at the surface but underneath pac-man has a very sophisticated movement algorithm. You can literally slide pac-man around corners at 7 different points at intersections. The original programmers of pac-man were quite ingenious with its design as I found out while emulating it.

Wow, I always thought the game had good feel, but I never knew how it was implemented. 

I'm not intimately acquainted with the code like you, but when I think about it, it seems that any maze is just a combination of the same limited set of turns and intersections. There are only so many directions Pac Man can go, so even with 7 different points each, any maze can probably be broken down into the same root "tileset", no?

The maze in pac-man is deceptive. Each pellet is actually contained in an 8x8 box and these 8x8 boxes are chained together to form paths. The maze itself is 16x16 but the characters running around in the maze are only concerned with those 8x8 boxes. Once a character enters an 8x8 box it then keep track of it's position within the box (0 through 7). Once position 8, or position -1, is reached it leaves that box and moves to the next one. That is why ghosts can seem to partially cover pac-man but still not kill him. It gives the player that sense of "yikes, it almost got me" when in reality the two characters were in separate 8x8 boxes.

The reason pac-man can slide around corners in 7 different positions is due to the nature of these 8x8 boxes. If pac-man is at an intersection the player can decide to turn at any time within the first 3 or 4 points, depending on direction, and the sooner the turn the bigger slide around a corner pac-man gets. It's a brilliant tactic that allows pac-man to speed up a bit around corners to evade ghosts. The ghosts are not allowed to slide but must wait until they reach the center of an 8x8 box to turn. This is the reason the maze borders are all rounded off, so the pac-man sprite does not cover them while sliding.

I have lots of maze generating code. You can view a really good algorithm in my Super Mega Bug game that generates random braided mazes of any size. Rounded corners and sliding needs special coding and sliding would require a maze generator that can create rounded corners. Doable but much more work.

You have a Vectrex! How cool is that! I remember seeing these for sale when I was kid and wanted one so bad.

I have a decent maze generating algorithm, which I used in a couple games (they were on the old qb64.org site, I need to re-upload all my programs here!). 

But I was thinking of a human-edited mazes - I think tweaking it to work with a maze editor has challenges but I have faith in your abilities, LOL! 

I do have a Vectrex! As a kid the only way I could play one was to go to Sears and play the display model! So finally, as an adult with a "real job" and ebay, I was able to procure my very own at a decent price, woohoo! I also accumulated the Atari Video Music (2 of 'em!), various Atari/Sears Pong home consoles, Atari Video Pinball, Coleco Telstar Combat, and an Apple IIe platinum system. I ended up selling most of that stuff - no room! But I kept the Vectrex - it's just too cool to get rid of! I still have my C64 & Atari 2600 too! (Alas I sold my childhood TI99/4A, but not before transferring all my BASIC creations to PC!)
Reply


Messages In This Thread
QB64 Pac-Man Clone - by TerryRitchie - 12-26-2022, 08:10 PM
RE: QB64 Pac-Man Clone - by james2464 - 12-26-2022, 08:33 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 12-26-2022, 08:47 PM
RE: QB64 Pac-Man Clone - by Jack - 12-26-2022, 10:09 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 12-26-2022, 10:46 PM
RE: QB64 Pac-Man Clone - by PhilOfPerth - 12-27-2022, 06:42 AM
RE: QB64 Pac-Man Clone - by Dimster - 12-27-2022, 05:21 PM
RE: QB64 Pac-Man Clone - by Dimster - 12-27-2022, 05:37 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 12-27-2022, 08:31 PM
RE: QB64 Pac-Man Clone - by Dimster - 12-27-2022, 08:37 PM
RE: QB64 Pac-Man Clone - by Jack - 12-27-2022, 09:17 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 12-28-2022, 02:42 PM
RE: QB64 Pac-Man Clone - by mnrvovrfc - 12-30-2022, 07:21 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 12-30-2022, 05:10 PM
RE: QB64 Pac-Man Clone - by LEM - 12-30-2022, 07:02 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 12-30-2022, 05:13 PM
RE: QB64 Pac-Man Clone - by Pwillard - 01-05-2023, 03:43 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-05-2023, 04:16 PM
RE: QB64 Pac-Man Clone - by Dav - 01-05-2023, 11:31 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-06-2023, 12:25 AM
RE: QB64 Pac-Man Clone - by Dav - 01-06-2023, 01:52 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-06-2023, 03:02 AM
RE: QB64 Pac-Man Clone - by madscijr - 01-06-2023, 02:10 AM
RE: QB64 Pac-Man Clone - by mnrvovrfc - 01-06-2023, 02:38 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-06-2023, 02:58 AM
RE: QB64 Pac-Man Clone - by madscijr - 01-06-2023, 03:54 AM
RE: QB64 Pac-Man Clone - by madscijr - 01-06-2023, 03:28 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-06-2023, 02:46 AM
RE: QB64 Pac-Man Clone - by madscijr - 01-06-2023, 03:46 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-06-2023, 05:44 AM
RE: QB64 Pac-Man Clone - by madscijr - 01-06-2023, 03:03 PM
RE: QB64 Pac-Man Clone - by TempodiBasic - 01-08-2023, 07:01 PM
RE: QB64 Pac-Man Clone - by RokCoder - 01-09-2023, 10:12 AM
RE: QB64 Pac-Man Clone - by TerryRitchie - 01-09-2023, 06:55 PM
RE: QB64 Pac-Man Clone - by RedAfro-LIVE - 02-03-2023, 07:49 PM
RE: QB64 Pac-Man Clone - by mnrvovrfc - 02-03-2023, 10:08 PM
RE: QB64 Pac-Man Clone - by RedAfro-LIVE - 02-06-2023, 01:47 PM
RE: QB64 Pac-Man Clone - by SMcNeill - 02-06-2023, 03:19 PM
RE: QB64 Pac-Man Clone - by mnrvovrfc - 02-06-2023, 07:57 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 02-06-2023, 05:41 PM
RE: QB64 Pac-Man Clone - by RedAfro-LIVE - 02-06-2023, 06:20 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 02-06-2023, 07:55 PM
RE: QB64 Pac-Man Clone - by madscijr - 02-07-2023, 09:52 PM
RE: QB64 Pac-Man Clone - by TerryRitchie - 02-08-2023, 01:43 AM
RE: QB64 Pac-Man Clone - by madscijr - 02-08-2023, 12:54 PM
RE: QB64 Pac-Man Clone - by bplus - 02-03-2023, 08:17 PM
RE: QB64 Pac-Man Clone - by RedAfro-LIVE - 02-06-2023, 02:41 PM
RE: QB64 Pac-Man Clone - by bplus - 02-06-2023, 05:00 PM
RE: QB64 Pac-Man Clone - by bplus - 02-06-2023, 07:50 PM
RE: QB64 Pac-Man Clone - by bplus - 02-06-2023, 08:22 PM



Users browsing this thread: 54 Guest(s)