Ask coding questions

← Back to all posts
python monopoly game
minecraftmake55 (6)

need help making a monopoly game on python

Answered by eankeen (2249) [earned 5 cycles]
View Answer
eankeen (2249)

What kind of help are ya looking for? :)

minecraftmake55 (6)

@eankeen how to do certain code or how to fix it

eankeen (2249)

@minecraftmake55 :thinking: Do you have some sort of repl

Edit: Got it

eankeen (2249)

@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 ;)

minecraftmake55 (6)

@eankeen could you help on the multplayer thing

PYer (4017)

@minecraftmake55 you two should go work in discord

PYer (4017)

@eankeen that works in python