python monopoly game
minecraftmake55 (4)

need help making a monopoly game on python

You are viewing a single comment. View All
eankeen (547)

@eankeen So maybe add a bit of data:
1. An array of objects (let's call it properties) that contains information about each property
Something kind of like this:

        "name": Mediterranean Avanue",
        "cost": 80
        "name": "Baltic Avenue",
        "cost": 80

☝ This may not work in python, so you might have to look up "how to create an array of objects in python" if it doesn't work

  1. some integer that represents the player's location in the array, like where they are on the map (let's call it placement for now)

Then, maybe create a function called rollDice or something. When it's called, it can get the random number, and add to placement

Then, maybe you can output wherever the player is

print("You are at the following property")
print( properties[placement].name )

print("The property costs this much:")
print( properties[placement].cost )

You may want to consider creating an array that represents all of the properties the player has purchased ;)