def use (self, otherobject):
pass
+class GoldCoins (GameObject):
+ # initialize
+ def __init__ (self, row, col, image, value):
+ text = "gold coins"
+ self.value = value
+ GameObject.__init__ (self, row, col, text, image, False)
+
+ # no interaction with this object
+ def interact (self):
+ return True
+
+ # use the object on Butaba - add to his gold
+ def use (self, butaba):
+ butaba.gold += self.value
+
class HealthPotion (GameObject):
# initialize
butaba.health = butaba.MAXHEALTH
class Chest (GameObject):
- def __init__ (self, row, col, text, image, key_id, locked = False, items = []):
+ def __init__ (self, row, col, text, image, key_id, locked = False, objects = []):
self.key_id = key_id
self.locked = locked
- self.items = items
+ self.objects = objects
GameObject.__init__ (self, row, col, text, image, False)
# no interaction with this object. Also solid so return False