Merge branch 'master' of github.com:lvl2/avocados
commit
6d142808e2
|
@ -104,10 +104,14 @@ class Avocado:
|
||||||
if self.checkObstacle \
|
if self.checkObstacle \
|
||||||
and (self.rect.right < right and self.rect.left > left):
|
and (self.rect.right < right and self.rect.left > left):
|
||||||
self.checkObstacle = False
|
self.checkObstacle = False
|
||||||
|
# print(self.rect.bottom, top)
|
||||||
|
# if self.rect.bottom > top:
|
||||||
|
# self.vy = -self.vy
|
||||||
|
|
||||||
if self.checkObstacle \
|
if self.checkObstacle \
|
||||||
and ((self.rect.right > right and self.rect.left < right) \
|
and ((self.rect.right > right and self.rect.left < right) \
|
||||||
or (self.rect.left < left and self.rect.right > left)):
|
or (self.rect.left < left and self.rect.right > left)):
|
||||||
|
if self.rect.bottom > top:
|
||||||
self.vx = -self.vx
|
self.vx = -self.vx
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -12,11 +12,12 @@ class Crystal:
|
||||||
def __init__(self, screen):
|
def __init__(self, screen):
|
||||||
self.screen = screen
|
self.screen = screen
|
||||||
screen_width, screen_height = screen.get_size()
|
screen_width, screen_height = screen.get_size()
|
||||||
self.rect = self.screen.get_rect()
|
screen_rect = self.screen.get_rect()
|
||||||
self.imageCenterX = self.rect.centerx
|
self.imageCenterX = screen_rect.centerx
|
||||||
self.imageCenterY = self.rect.centery
|
self.imageCenterY = screen_rect.centery
|
||||||
self.pos = (self.imageCenterX-100,self.imageCenterY-5,200,183)
|
self.pos = (self.imageCenterX-100,self.imageCenterY-5,200,183)
|
||||||
|
|
||||||
|
|
||||||
def getBoundaries(self):
|
def getBoundaries(self):
|
||||||
return self.pos
|
return self.pos
|
||||||
|
|
||||||
|
|
1
game.py
1
game.py
|
@ -99,6 +99,7 @@ class TheGame:
|
||||||
return
|
return
|
||||||
pygame.mixer.music.fadeout(3000)
|
pygame.mixer.music.fadeout(3000)
|
||||||
|
|
||||||
|
|
||||||
def chooseRandomColor(self):
|
def chooseRandomColor(self):
|
||||||
selected = random.randint(0, 3)
|
selected = random.randint(0, 3)
|
||||||
if len(self.last_colors) > 5:
|
if len(self.last_colors) > 5:
|
||||||
|
|
Loading…
Reference in New Issue