Minor fix
This commit is contained in:
@@ -78,8 +78,6 @@ class Player(pygame.sprite.Sprite):
|
|||||||
for image in array:
|
for image in array:
|
||||||
image.set_colorkey((255,0,255))
|
image.set_colorkey((255,0,255))
|
||||||
|
|
||||||
def getCollisionBoxes(self):
|
|
||||||
return self.collisionBoxes
|
|
||||||
|
|
||||||
def __init__(self, mainGameClass):
|
def __init__(self, mainGameClass):
|
||||||
pygame.sprite.Sprite.__init__(self)
|
pygame.sprite.Sprite.__init__(self)
|
||||||
@@ -108,16 +106,17 @@ class Player(pygame.sprite.Sprite):
|
|||||||
|
|
||||||
self.collisionBoxes = pygame.sprite.Group()
|
self.collisionBoxes = pygame.sprite.Group()
|
||||||
|
|
||||||
collision = CollisionBox(0, 20, 60, 20, self.rect.center)
|
self.collisionBoxes.add(CollisionBox(0, 20, 60, 20, self.rect.center))
|
||||||
self.collisionBoxes.add(collision)
|
self.collisionBoxes.add(CollisionBox(-10, 5, 30, 20, self.rect.center))
|
||||||
collision = CollisionBox(-10, 5, 30, 20, self.rect.center)
|
self.collisionBoxes.add(CollisionBox(0, 35, 25, 40, self.rect.center))
|
||||||
self.collisionBoxes.add(collision)
|
|
||||||
collision = CollisionBox(0, 35, 25, 40, self.rect.center)
|
|
||||||
self.collisionBoxes.add(collision)
|
|
||||||
|
|
||||||
self.__doubleY = float(self.rect.x)
|
self.__doubleY = float(self.rect.x)
|
||||||
|
|
||||||
|
|
||||||
|
def getCollisionBoxes(self):
|
||||||
|
return self.collisionBoxes
|
||||||
|
|
||||||
|
|
||||||
def crouch(self):
|
def crouch(self):
|
||||||
if not self.isCrouching:
|
if not self.isCrouching:
|
||||||
self.isCrouching = True
|
self.isCrouching = True
|
||||||
@@ -128,7 +127,6 @@ class Player(pygame.sprite.Sprite):
|
|||||||
if self.isCrouching:
|
if self.isCrouching:
|
||||||
self.isCrouching = False
|
self.isCrouching = False
|
||||||
self.rect = self.rect.inflate(0, 32)
|
self.rect = self.rect.inflate(0, 32)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
def control(self, event):
|
def control(self, event):
|
||||||
|
|||||||
Reference in New Issue
Block a user