1 min
For navigating the ship I had pretty good idea of how I was going to do this as I covered it breifly in my last post.
I instantiated two room objects from my room class. A “current room” object and a “next room” object. I did this so it would render the current rooms information to the screen and the “next room” was for checking if the room I wanted to go into was safe or required an item to access it.
next_room->updateRoom(current_room->roomExits(i));
if(!next_room->accessible())
{
//code here
}
else if (next_room->accessible())
{
//code here
}
The code example above is how I did it. So the next room gets updated with the number from ‘current_room->roomExits(i)’ and if it is a viable exit then that number will be between 0-48. It then updates the ‘next_rooms’ values with the data from the element of the vector, mentioned in the previous post, corresponding to the number that was passed in.
Subscribe to this blog via RSS.
Low level programming dev diary 28
Text based adventure dev diary 6
Level design developer diary 3
Game engine programming dev diary 14
Audio-visual production dev diary 7
Audio-Visual Production: Particle System Mesh Spawning Issues
Posted on 20 Feb 2020Low level programming dev diary (28) Text based adventure dev diary (6) Level design developer diary (3) Post mortem (4) Ex-machina dev diary (11) Game engine programming dev diary (14) Network game dev diary (11) Audio-visual production dev diary (7)