Apr-30-2017, 09:23 PM
Okay, you have the items in your room lists. First thing you want to do is show them to the user. In the print_message function, I would print out the items in the room. Something like:
Check out the text adventure tutorial link in my signature. It has an example of a system just like that, only using dictionaries instead of lists.
print('You see the following items:', ', '.join(room[1]))Then, in the get_player_choice function, allow them to get or drop items. Change the input text to "What do you want to do?". You're going to need a player inventory. This would work as another list, that you pass to the various functions. So, the player would enter something like 'get paintings'. You can parse that into the command (get) and the parameter (paintings). I find the partition method of strings to be good for that. Then check that the thing they want is in the room (with the in operator on the room's contents). If it is, remove it from room's contents and append it to the player's inventory. Dropping the item would work the same, but in reverse.
Check out the text adventure tutorial link in my signature. It has an example of a system just like that, only using dictionaries instead of lists.
Craig "Ichabod" O'Brien - xenomind.com
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures
I wish you happiness.
Recommended Tutorials: BBCode, functions, classes, text adventures