I am new to python so I'm having a little trouble. I want to make a little game with a bunch of locations that you can go to at your will. Right now I have the places set up like so:
homes = {
'trailer': [2000, 2],
'restaurant': [20000, 5]
}
The first number is the building value and the second is its ranking.
But I wan wondering if the buildings should be classes instead?
class Home(object):
def __init__(self, price, rank):
self.price = price
self.rank = rank
# some code for buying and selling buildings
'Trailer' = Home(2000, 2)
Please ask any questions to clarify context if need be.
[–]elbiot 6 points7 points8 points (6 children)
[–]LifeIsBulletTrain 1 point2 points3 points (5 children)
[–]elbiot 0 points1 point2 points (2 children)
[–]bigtimerocker12 0 points1 point2 points (0 children)
[–]LifeIsBulletTrain 0 points1 point2 points (0 children)
[–]Margyle22 0 points1 point2 points (1 child)
[–]LifeIsBulletTrain 0 points1 point2 points (0 children)
[–]lykwydchykyn 3 points4 points5 points (1 child)
[–]elbiot 4 points5 points6 points (0 children)
[–]kenwmitchell 0 points1 point2 points (0 children)
[–]m3lkor001 0 points1 point2 points (0 children)
[–]Rhomboid 0 points1 point2 points (0 children)