repacman icon indicating copy to clipboard operation
repacman copied to clipboard

Define a game map, instead of a grid

Open emmenko opened this issue 6 years ago • 16 comments

Obviously a Pacman game uses a map 🤓

A map is based on top of our grid system and it basically means that certain movements are not permitted.

Acceptance criteria

  • Pacman (and Ghosts) can only run on the map paths
  • Fruits can only be spawn within the map paths
  • Movements towards a "dead end" will result in a stale position until an allowed movement is performed (e.g. going down, there is a wall and you can only turn left or right)
  • The map should allow a couple of "tunnels", to continue the movement from the opposite side

emmenko avatar May 14 '18 19:05 emmenko

Another question: Is the map procedurally generated, or static?

ncthbrt avatar May 14 '18 20:05 ncthbrt

I don't have much experience with these sort of things but I would assume it's a mix.

For instance, we need to know where the elements can be spawn and move. So if we build a matrix of points, we can specify which points are part of the "path" and which not.

[x x x x x x]
[x o o o x x]
[o o x o o o]
[x x x o x x]
[x o o o x x]
[x x x x x x]

👆Something like this ("o" is where you can move)

But again, I never built something like this so those are just my assumptions.

Do you have any experience with those things?

emmenko avatar May 15 '18 07:05 emmenko

That sounds good. Would also recommend allowing for explicit spawn points. Gives you a lot more control and reduces the edge cases.

ncthbrt avatar May 15 '18 07:05 ncthbrt

You mean for things like random fruit?

emmenko avatar May 15 '18 08:05 emmenko

I'd love to implement a procedurally generated map. Maze-generation is always fun to play around with.

I'm having issues getting the project up and running from my workplace, so it'll have to wait for me to get back home.

diplofocus avatar May 15 '18 09:05 diplofocus

Sure, if you already have experience with that we're happy to get all the help we can 🙌

emmenko avatar May 15 '18 10:05 emmenko

@emmenko Yes, and for ghosts

ncthbrt avatar May 15 '18 10:05 ncthbrt

Yeah. Well ghosts always spawns from a specific place if I'm not mistaken 🤔

emmenko avatar May 15 '18 11:05 emmenko

I still keep getting the most useful: Fatal error: exception Failure("Unknown error while loading plugin")

Working on figuring out what's wrong.

diplofocus avatar May 15 '18 20:05 diplofocus

PS: @diplofocus I added you to the team, welcome! 👏

emmenko avatar May 15 '18 20:05 emmenko

I still keep getting the most useful:

When do you get the error? When you start? When you build?

Try pulling the latest changes, there was a bugfix in the vscode settings.

emmenko avatar May 15 '18 20:05 emmenko

@diplofocus I came across this the other day in case it helps get your map-generation creativity going (iirc the original game has a single static map for all levels)

Schmavery avatar May 16 '18 09:05 Schmavery

Cool, thanks for the link!

emmenko avatar May 16 '18 09:05 emmenko

I get the error while trying to start the app. Same happens on both my work PC and my home PC. The build passed after I installed some pulse-audio libraries, but still can't get it to start.

As for the article, my starting point was just a maze, but tweaked and mirrored to produce a more "playable" map. If I remain unable to run the project, I'll implement the maze generation in a separate file, with a text-visualization. Hopefully someone with more luck running the app can integrate the algorithm in to the rest of the game.

diplofocus avatar May 16 '18 14:05 diplofocus

We should try to get you set up, it's not good if you can't start the app. Can you try cloning the repo again and do a clean install?

emmenko avatar May 16 '18 15:05 emmenko

@diplofocus did you look at https://github.com/Schmavery/reprocessing/issues/74 ? Otherwise can you open an issue on reprocessing? One way to get a better error is to compile to native and run that. Sometimes the hotreloading swallows the error messages :/

bsansouci avatar May 16 '18 15:05 bsansouci