Basic-Reb0rn 3 (Finishing Core Functionality)


Making Progress

Adding Items

To add the items to the rooms I needed to go through all the room numbers and figure out which ones had items, set the names of the items based on their room number, make a bool function to check if they have been collected or not and add functionality for the player to be able to use them.

I used another Constant array for the item names and set them to render when the player is in the room that the item is in and added functions in the rooms class to set which rooms actually have items, using a bool since the room either has an item or it doesn't.   Then i made the "isObtained" bool functions to allow it to be un-rendered once the player inputs the pick up button, in this case that button was "T", (which would stand for "Take" in this case), on the keyboard since I didn't want the player to manually type in "take" every time like they did in the original, though i am starting to believe that it was part of the games charm, as a dyslexic person i found it tedious as i spell the words wrong almost every time  and its also consistent with the way I did movement, once the player picked up an item their score will increase by 10  using the renderer, and some simple variables . 

After this was completed i thought this would be a good time to add an Inventory list on the screen so the players can see what they picked up. I made a function called "inventory" that checks the item array and which ones read true for the "isObtained" function we used to un-render them from the rooms once the player uses the pick-up input, it then renders the item name in a list on the screen.  

Next was adding obstacles and getting the items to be usable. I made it so that the number buttons act as a use input for each of the usable items similar to the way MMO-RPG handle this in modern day games. I also needed to render this since the player wouldnt automatically know this or any of my controls for that matter. So some simple hard coding in the renderer was done to print instructions onto the screen that tells the player what buttons to press for all the controls.  

Then i made another function called "renderUseItem" which checks the players current position and if they use an item in the correct room it renders text that will explain what the effect of the item was. Except for the candle which could be used at any time if the player had collected the right items. I also made the boat the end game solution, by making it the means of escape for the player when they use it in the right place. this ends the game and presents the player with a bit of story text and their score. 

Adding Obstacles

The obstacles are few. The bats exists in one room and can be overcome by using aeorsil, the ghosts are overcome by using the vacuum, the magic barrier requires the magic book, which is obtained by using an axe to get into a locked room, a key to get through a door  and so on. The dark rooms require the player to have 2 items, the matches and candle, and stop the player from moving if the bool is false. All of these where harcoded into a very large if statement which asked for the "use" bool, which turned true when the player pressed the right number, and the room numbers of which the obstacles existed. 

That wraps up everything i did on this game. 

Leave a comment

Log in with itch.io to leave a comment.