Sign in to follow this  
nuclear123

simple maze game :)

Recommended Posts

ok so i decided about 10 min ago to make a maze game for my first game to make in a CUI.... i understand i can make the character as a class with certain functions to control him. im unsure about how to approach the MAZE part im sure there are many approaches to this but how should i make the maze? as a class? structure? maybe something different? any little tips in the right direction would be helpfull :) dont be to helpfull i wanna do most of the work here...-thx

Share this post


Link to post
Share on other sites
Depends on how the maze looks? A good start might be to load a maze from file.
For example you can have something like this in maze.txt

############
# # #
# # # #
# # # #
# #
############


Where the '#' is a wall and space as a pathway.

Share this post


Link to post
Share on other sites
If your maze contains nothing but walls and empty spaces, you could just create a 2-dimensional array which contains variables that show whether or not a wall exists in that particular space. You'd probably want to load the maze from files, like Concentrate said, though, just so you don't have to hardcode each maze into your program.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this