Skip to content

Commit

Permalink
Merge pull request #78 from PySlither/fixBasicTest
Browse files Browse the repository at this point in the history
Fix #76
  • Loading branch information
Tymewalk authored Sep 11, 2016
2 parents 7b30c7c + 0d915c5 commit 118063e
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions slither/slither.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,12 +108,12 @@ def isFocused():
return bool(pygame.mouse.get_focused())

# Stage class
class Stage():
class Stage(object):
def __init__(self):
self.snakey = pygame.image.load(os.path.join(os.path.dirname(__file__), "snakey.png"))
self.costumes = collections.OrderedDict({"costume0" : self.snakey})
self.costumeNumber = 0
self.costumeName = "costume0"
self._costumeNumber = 0
self._costumeName = "costume0"
self.currentCostume = None
self.bgColor = (255, 255, 255)

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

def deleteCostumeByName(self, name):
'''Delete a costume by name.'''
Expand All @@ -143,7 +143,7 @@ def costumeNumber(self):
@costumeNumber.setter
def costumeNumber(self, val):
val = val % len(self.costumes)
self.costumeName = list(self.costumes.keys())[val]
self._costumeName = list(self.costumes.keys())[val]
self.currentCostume = self.costumes[self.costumeName]
self._costumeNumber = val

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

@property
Expand Down

0 comments on commit 118063e

Please sign in to comment.