Updated text parsing and commands
This commit is contained in:
@@ -406,9 +406,8 @@ def parse(input_text):
|
|||||||
command = "take"
|
command = "take"
|
||||||
object1 = " ".join(words[2:])
|
object1 = " ".join(words[2:])
|
||||||
return command, object1
|
return command, object1
|
||||||
elif words[0] == "look" and words[1] == "around" and len(words) > 2:
|
elif words[0] == "look" and words[1] == "around" and len(words) == 2:
|
||||||
command = "look"
|
command = "look_around"
|
||||||
object1 = " ".join(words[2:])
|
|
||||||
return command, object1
|
return command, object1
|
||||||
|
|
||||||
# Single-word commands
|
# Single-word commands
|
||||||
|
|||||||
2
main.py
2
main.py
@@ -296,7 +296,7 @@ def main_game_loop():
|
|||||||
get_instructions()
|
get_instructions()
|
||||||
elif command == "scene":
|
elif command == "scene":
|
||||||
game_engine.display_current_scene()
|
game_engine.display_current_scene()
|
||||||
elif command == "look":
|
elif command == "look_around":
|
||||||
game_engine.look_around()
|
game_engine.look_around()
|
||||||
elif command == "inventory":
|
elif command == "inventory":
|
||||||
game_engine.player.inventory.current_inventory()
|
game_engine.player.inventory.current_inventory()
|
||||||
|
|||||||
Reference in New Issue
Block a user