Player Location
I've found a simple way to implement player location. The whole map is just an array of 64 Rooms, so the player location can be stored as an int. The movement function will simply add or subtract 1 or 8 depending on the direction moved. Whenever the game checks the player's location for something in that room, room[player_location] will bring it up. Currently movement is handled with the WASD keys, but this is only temporary for the purposes of testing.
I also added simple strings that described the room, and said if there was an item in it. Most room descriptions aren't defined yet, but they can be done once the primary codebase is complete.
I am still thinking of the best way to implement the text input from the player. Currently the game is using ASGE rendering, so I am unsure if using cin would be a poor choice for the task.
Get Haunted House
Haunted House
Port of a text adventure made in BASIC to modern C++ for my Low-Level Programming module
Status | Released |
Author | MachJacob |
Tags | Creepy, Text based |
Languages | English |
More posts
- PostmortemApr 11, 2019
- Additional FunctionalityApr 11, 2019
- Text Input!Apr 07, 2019
- The port beginsJan 04, 2019
- Starting PointNov 18, 2018
Leave a comment
Log in with itch.io to leave a comment.