MadhavM-117 / pacmanJS

Pacman in JavaScript
MIT License
0 stars 0 forks source link

Draw the first level/maze #5

Closed MadhavM-117 closed 5 years ago

MadhavM-117 commented 5 years ago

How do you think the level/maze info should be structured?

Last time I did it, I had a 20x20 array of 1s and 0s. 1 => wall and 0 => no wall, The 20x20 array was then scaled to the size of the render area.

In this case, we could have a JSON, with a NxM array, with -1 => wall, 0 => empty, 1 => food, and 2 => super food.

Also, creating a smaller sub-program to create the map might be a good idea. Hand-creating a JSON file with the required values can get quite painstaking.

MadhavM-117 commented 5 years ago

@adhicoder to address the questions you mentioned over whatsapp:

How do you plan on making the sub program for the maze?

It could be another game-like interface, where the user can draw a maze and save it/download it as a JSON file.

Also, I think the goodies and bombs shouldn't be a part of the maze object. They should be objects of their own.

Can you elaborate? I just think the entirety of the maze (goodies & bombs) should be user-specified, and not generated at runtime.