Skip to content

Commit 118063e

Browse files
authored
Merge pull request #78 from PySlither/fixBasicTest
Fix #76
2 parents 7b30c7c + 0d915c5 commit 118063e

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

slither/slither.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -108,12 +108,12 @@ def isFocused():
108108
return bool(pygame.mouse.get_focused())
109109

110110
# Stage class
111-
class Stage():
111+
class Stage(object):
112112
def __init__(self):
113113
self.snakey = pygame.image.load(os.path.join(os.path.dirname(__file__), "snakey.png"))
114114
self.costumes = collections.OrderedDict({"costume0" : self.snakey})
115-
self.costumeNumber = 0
116-
self.costumeName = "costume0"
115+
self._costumeNumber = 0
116+
self._costumeName = "costume0"
117117
self.currentCostume = None
118118
self.bgColor = (255, 255, 255)
119119

@@ -122,7 +122,7 @@ def addCostume(self, costumePath, costumeName):
122122
'''Add a costume based on a given path and name.'''
123123
costume = pygame.image.load(os.path.join(scriptdir, costumePath))
124124
self.costumes[costumeName] = costume
125-
self.costumeName = costumeName # Switch to the new costume
125+
self._costumeName = costumeName # Switch to the new costume
126126

127127
def deleteCostumeByName(self, name):
128128
'''Delete a costume by name.'''
@@ -143,7 +143,7 @@ def costumeNumber(self):
143143
@costumeNumber.setter
144144
def costumeNumber(self, val):
145145
val = val % len(self.costumes)
146-
self.costumeName = list(self.costumes.keys())[val]
146+
self._costumeName = list(self.costumes.keys())[val]
147147
self.currentCostume = self.costumes[self.costumeName]
148148
self._costumeNumber = val
149149

@@ -171,7 +171,7 @@ def __init__(self):
171171
self.direction = 0 # Direction is how much to change the direction, hence why it starts at 0 and not 90
172172
self.show = True
173173
self.scale = 1 # How much to multiply it by in the scale
174-
self.zindex = 0 # How high up are we in the "z" axis?
174+
self._zindex = 0 # How high up are we in the "z" axis?
175175
sprites.append(self) # Add this sprite to the global list of sprites
176176

177177
@property

0 commit comments

Comments
 (0)