projects
/
butaba-adventures.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added the Conversation Interaction
[butaba-adventures.git]
/
gameobjects.py
diff --git
a/gameobjects.py
b/gameobjects.py
index
190631f
..
2edbc5b
100644
(file)
--- a/
gameobjects.py
+++ b/
gameobjects.py
@@
-1,18
+1,15
@@
# object classes - classes for game interactive objects
# object classes - classes for game interactive objects
-import pygame
-import os.path
-
-import utility
# base class for all objects
class GameObject:
# initialization routine
# base class for all objects
class GameObject:
# initialization routine
- def __init__ (self, row, col, text, image = None, can_pickup = True):
+ def __init__ (self, row, col, text, image = None, can_pickup = True
, use_str = "Use"
):
self.row = row
self.col = col
self.image = image
self.text = text
self.can_pickup = can_pickup
self.row = row
self.col = col
self.image = image
self.text = text
self.can_pickup = can_pickup
+ self.use_str = use_str
# override this for interaction, i.e. when character walks into the item
def interact (self):
# override this for interaction, i.e. when character walks into the item
def interact (self):
@@
-30,7
+27,7
@@
class GoldCoins (GameObject):
def __init__ (self, row, col, image, value):
text = "gold coins"
self.value = value
def __init__ (self, row, col, image, value):
text = "gold coins"
self.value = value
- GameObject.__init__ (self, row, col, text, image, False)
+ GameObject.__init__ (self, row, col, text, image, False
, "Take"
)
# no interaction with this object
def interact (self):
# no interaction with this object
def interact (self):
@@
-45,7
+42,7
@@
class HealthPotion (GameObject):
# initialize
def __init__ (self, row, col, image):
text = "health potion"
# initialize
def __init__ (self, row, col, image):
text = "health potion"
- GameObject.__init__ (self, row, col, text, image, True)
+ GameObject.__init__ (self, row, col, text, image, True
, "Drink"
)
# no interaction with this object
def interact (self):
# no interaction with this object
def interact (self):
@@
-62,7
+59,7
@@
class Chest (GameObject):
self.key_id = key_id
self.locked = locked
self.objects = objects
self.key_id = key_id
self.locked = locked
self.objects = objects
- GameObject.__init__ (self, row, col, text, image, False)
+ GameObject.__init__ (self, row, col, text, image, False
, "Open"
)
# no interaction with this object. Also solid so return False
def interact (self):
# no interaction with this object. Also solid so return False
def interact (self):