MCPcopy Create free account
hub / github.com/ndleah/python-mini-project / player_move

Function player_move

TEXTVENTURE/game.py:379–404  ·  view source on GitHub ↗
(myAction)

Source from the content-addressed store, hash-verified

377
378# Player Movement
379def player_move(myAction):
380 dest = input("\nWhere would you like to move? 🚶\n> ")
381
382 if dest in "UP":
383 destination = ZONE_MAP[player.location]["UP"]
384
385 movement_handler(destination)
386
387 elif dest in "DOWN":
388 destination = ZONE_MAP[player.location]["DOWN"]
389
390 movement_handler(destination)
391
392 elif dest in "LEFT":
393 destination = ZONE_MAP[player.location]["LEFT"]
394
395 movement_handler(destination)
396
397 elif dest in "RIGHT":
398 destination = ZONE_MAP[player.location]["RIGHT"]
399
400 movement_handler(destination)
401
402 else:
403 print("\nI don't understand that command.\nPlease enter a valid command. ⚠️\n")
404 player_move(myAction)
405
406
407# Player Location

Callers 1

promptFunction · 0.85

Calls 1

movement_handlerFunction · 0.85

Tested by

no test coverage detected