Skip to content
← Back to Community
python monopoly game
Profile icon
minecraftmake55

need help making a monopoly game on python

Answered by hyperupcall [earned 5 cycles]
View Answer
Voters
Profile icon
Ilovecats2
Profile icon
NoorulHafizahHa
Profile icon
MantraMittal
Profile icon
katyadee
Profile icon
ChristopherMull
Profile icon
minecraftmake55
Comments
hotnewtop
Profile icon
hyperupcall

What kind of help are ya looking for? :)

Profile icon
minecraftmake55

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

Profile icon
minecraftmake55
Profile icon
hyperupcall

@minecraftmake55 🤔 Do you have some sort of repl

Edit: Got it

Profile icon
minecraftmake55
Profile icon
hyperupcall

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

Profile icon
minecraftmake55

@eankeen could you help on the multplayer thing

Profile icon
PYer

@minecraftmake55 you two should go work in discord

Profile icon
PYer

@eankeen that works in python

Profile icon
minecraftmake55

@PYer dont have it

Profile icon
PYer
Profile icon
AS4

https://repl.it/@AS4/Dinoepic maybe helpful (in Java)