Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QB64 Pac-Man Clone
#30
(01-06-2023, 03:46 AM)madscijr Wrote:
(01-06-2023, 02:46 AM)TerryRitchie Wrote:
(01-06-2023, 02:10 AM)madscijr Wrote: This is really nice. Thank you. 

I know you have worked hard on this, and it's excellent. Now I'm going to try and push for just a little more. The obvious would be Ms. Pac Man, but I think there is something better - add an editor and a couple of options to be able to MAKE Ms. Pac Man from inside the game, as well as create different mazes, edit the Pac sprites and edibles, play with the rules a little bit, change colors timers and speeds, play simultaneous multiplayer (cooperative or competitive?), maybe even a simple editor and primitive language to program the ghosts' logic or fruit's path through the maze. 

That's asking for a lot. Maybe just a way to edit mazes to start with, would give this game a longevity and add a new level of fun that the original never had. 

But anyway, great job, as always! You did it with Berzerk, you did it with Asteroids. What about Tempest (with level editor!), Gravitar, and Defender / Stargate?? ?

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.
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: 68 Guest(s)