NazirMuhammadZafarIqbal / maze_runners

Our project is going to be a 2D game about the labyrinth. Each of the levels is going to be randomly generated and the player has to find the way out of it. At the start of the game, there is going to be a menu where you can exit or start the game. The platform we chose is PC. Keyboard controls are used to play the game and there is an award for finishing the game within a time limit.
0 stars 0 forks source link

Maze generation algorithm - data structure #1

Closed Farkas-Martin closed 2 years ago

Farkas-Martin commented 2 years ago

The first step for the algorithm should be the creation of a general data structure for the levels. This data structure should contain the level's grid, entrance and exit position, with wall positions included.

Mattyhun commented 2 years ago

The data structure will be a char matrix[][] The different map elements will be stored as chars 'x' = walls 'o' = space 'e' = exit 's' = starting position

NazirMuhammadZafarIqbal commented 2 years ago

@Mattyhun, I have seen the changes you made. I appreciate that you decided and did it in a short time. My suggestion is to create a class for this purpose like GameBoard. In this, we can have different methods which develop the GameBoard step by step e.g. first assigning the starting and ending position, then walls creation, and implementing a random number generator method. Simply, doing it in an Object-Oriented way. We cannot do everything the main.cpp file as It will create a mess.