Map Rooms


Compared to my original idea of having the rooms as a list of enums, I ended up changing  it to a list of strings in a array.

I did this because I was having issues getting the enums to work with the movement correctly, as-well as using an array of strings ended up being a lot more less code and neater code generally.


So the way the array works is each spot in the array has a string which has information on the room location of the map , which in the main.cpp the location after each movement get rendered to the screen so the player is aware which room they are in, the room gets updated by the movement which will be explained in the next blog post.


Also for the rooms that have the items there is a if statement for each item to check to see if the player is in the the room which the item is in , as-well to make sure the player has not picked up the item already, if they have not picked up the item yet , an extra message will be rendered to the screen to inform the player there is an item to take.



Leave a comment

Log in with itch.io to leave a comment.