So I'm currently trying to make a text-based game for my C++ class and can't seem to figure out how to make the if-else statement execute ONLY if there is a previously collected item in order for the story to make sense. If the item isn't in the inventory, the options for the players will be looped again for them to choose a different choice. I tried doing: else if(input6 == "rub" || inventory[0] = "Purple Fruit") but it would just execute the statement regardless of whether or not the player has the item. Thanks for your time!! I really mean it.
Aucun commentaire:
Enregistrer un commentaire