Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
484 B
2
Indexable
Never
# Player's starting position
player_position = [0, 0]

# Function to move the player
def move_player(direction, distance):
    if direction == "north":
        player_position[1] += distance
    elif direction == "south":
        player_position[1] -= distance
    elif direction == "east":
        player_position[0] += distance
    elif direction == "west":
        player_position[0] -= distance

# Example usage
move_player("north", 5)
print("Player's position:", player_position)
Leave a Comment