X-Git-Url: https://harishankar.org/repos/?p=butaba-adventures.git;a=blobdiff_plain;f=gameobjects.py;fp=gameobjects.py;h=b4992a352eb38238c1028a9e23cad98ad87f2806;hp=e64dc91c374d437ffb7ad1259621ea89990be83d;hb=5075eb87b2a41e7f93c81a3ad2cfc1ac94a11314;hpb=0c8a13e68a280cfbcb3248e0c33937f6553c841d diff --git a/gameobjects.py b/gameobjects.py index e64dc91..b4992a3 100644 --- a/gameobjects.py +++ b/gameobjects.py @@ -25,6 +25,21 @@ class GameObject: 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