C++ implemented code 1


Hello,

When opening the project there is very basic use on rendering text to screen, with a clear set colour background.  I have setup a basic menu where player open the game and just have to press enter to start the game. The menu will also display instructions on how to play the game.

I have setup the 2D array to load the rooms, This array will take the room number and then the number of exits, hence the 2 dimensional array. You are able to see the start of the array in my images for this blog, and looking at it you will see the 64 rooms and then the number of exits being 4. you will also notice that there are alot of -1 in the array, the -1 means there is no exit if this direction is chosen.

There is also an image showing the destructor for the rooms within a for loop, this will prevent memory leaks. The initialize for the rooms will at start of the game will set them up, this also gets the players direction to start them navigating around the map. Within the update function the rooms will display which room the player is in.

I have also shown the room class where it will read off the 2d array to setup which room is which. it will also get the number of exists and stop the player from going out of the map or breaking it.

Thank you for reading.

Get Haunted House

Leave a comment

Log in with itch.io to leave a comment.