Closed Farkas-Martin closed 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
@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.
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.