X-Git-Url: https://harishankar.org/repos/?p=butaba-adventures.git;a=blobdiff_plain;f=gameobjects.py;h=b4992a352eb38238c1028a9e23cad98ad87f2806;hp=e64dc91c374d437ffb7ad1259621ea89990be83d;hb=3e350cff23064e74da2ead6c65e46ccdf3e7fa2f;hpb=f4b468331db23412a3d8195e8ca2650093411697 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