Commit 6f6b6e28 authored by Alan Aguiar's avatar Alan Aguiar
Browse files

center score message

parent 73bb21fa
......@@ -84,7 +84,7 @@ class Flappy():
self.bird.mAcc = 0
self.end_scores = EndScore(self.end_s_x, 200)
self.message = Message(self.mes_x, self.mes_y)
self.currentS = CurrentScore(self.sc_x, 100)
self.currentS = CurrentScore(self, self.sc_x, 100)
########################################################################
self.sprites.add(self.floor, layer=0)
self.sprites.add(self.bird, layer=2)
......
......@@ -37,8 +37,9 @@ class EndScore(pygame.sprite.Sprite):
class CurrentScore(pygame.sprite.Sprite):
def __init__(self, x=0, y=0):
def __init__(self, parent, x, y):
pygame.sprite.Sprite.__init__(self)
self.parent = parent
self.mPos = [x, y]
self.points = 0
self.image = back
......@@ -60,6 +61,7 @@ class CurrentScore(pygame.sprite.Sprite):
self.image.set_colorkey(self.bgColor)
self.image.blit(fontSurface, (0, 0))
self.rect = self.image.get_rect()
self.mPos[0] = (self.parent.game_w - self.size[0]) / 2
self.rect.x = self.mPos[0]
self.rect.y = self.mPos[1]
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment