I’m thinking of creating a maze game, but I don’t want to generate the mazes automatically/randomly (they need to be solveable, and I’d like to be able to place items, enemies, etc. along/near the solution route). So that means I need to include a bunch of mazes and then create the maps based off those. The mazes could be made up of grids 100x100 in size (where each grid cell is ~50px).
What’s the best way to do this?
My only thought is to have text files with the mazes made up of ASCII characters (e.g. # is a wall object, @ is the player’s starting position, etc.). Then I’d read in a text file, and go through each character creating the matching object in the game.
Pros:
- Text files are minimal in terms of storage
- As I’m reading in the characters from the file, I can be creating the objects at different relative X,Y positions to create slightly different mazes (i.e. 8 mazes (normal rotated 4 ways, flipped rotated 4 ways))
Cons:
- Not as ideal as just having each maze pre-built as an external layout
Is this the best way to do it? Or are external layouts better? Or is there a better way I haven’t considered?