- Sep 9, 2022
- 43
- 25
Just to ask if there's a way to display an element from a List array, because when I try
the console reply with
EDIT: Oh sure because the object inside is another class... but How I debug it?
Because when I start a new game Places[1] still active when it should not and I still wonder WTF is going on
Code:
Places[0]
Code:
<store.Place object at 0x00000000057837f0>
Code:
init python:
# MAP PLACES
class Place(object):
def __init__(self, x, y, name, isHome, owned, price, IsActive):
self.x = x
self.y = y
self.name = name
self.isHome = isHome
self.owned = owned
self.price = price
self.IsActive = IsActive
@property
def placeIcon(self):
if self.isHome == True and self.owned == False:
icon = "map/House_Rentable.png"
elif self.isHome == True and self.owned == True:
icon = "map/House_Rented.png"
else:
icon = "map/" + self.name.lower() + "_icon.png"
return(icon)
Places = []
Places.append(Place(843,264, "RAE Office", False, False, 0, True))
Places.append(Place(80, 750, "Cheapest House", True, False, 50, False))
Places.append(Place(1292, 840, "Cheap House", True, False, 250, False))
Places.append(Place(872, 789, "Tech House", True, False, 500, False))
Last edited: