Commit 37dd3548 authored by Alan Aguiar's avatar Alan Aguiar
Browse files

remove spaces

parent 6f6b6e28
......@@ -14,12 +14,10 @@ def make_back(parent):
w = parent.game_w
h = parent.game_h
floor_y = parent.floor_y
back = pygame.surface.Surface((w, h), 0)
back.fill(SKY)
rect = pygame.rect.Rect(0, floor_y, w, h - floor_y)
back.fill(GROUND, rect)
if w > 684:
t = int(math.ceil(w / 684.0))
else:
......
......@@ -14,9 +14,7 @@ class Bird(pygame.sprite.Sprite):
def __init__(self, parent, x=0, y=0):
pygame.sprite.Sprite.__init__(self)
self.parent = parent
self.mPos = [x, y]
self.mVel = 0
self.mAcc = 5
......
......@@ -64,6 +64,7 @@ class Flappy():
self.mes_y = (self.game_h - MES_H) / 2
self.game_p = self.game_w - DIST - self.pipe_w
self.max_s = self.floor_y - MIN_PIPE_H - DIST
self.min_pipe_h = MIN_PIPE_H
self.end_s_x = (self.game_w - 139) / 2
self.sc_x = (self.game_w - 70) / 2
......
......@@ -10,22 +10,19 @@ body = pygame.image.load('images/pipe.png')
class Pipe_I(pygame.sprite.Sprite):
def __init__(self, parent, x=0, height=82):
def __init__(self, parent, x, height):
pygame.sprite.Sprite.__init__(self)
self.flag = True
self.points = True
self.parent = parent
self.mPos = [x, 500]
self.mVel = -5
if height < 82:
height = 82
h = height - 42
self.p = h / 40
self.height = self.p * 40 + 42
self.mPos[1] = self.parent.floor_y - self.height
self.image = pygame.surface.Surface((91, self.height), 0)
self.image.fill((255, 255, 255))
self.image.blit(head, (0, 0))
for i in range(self.p):
self.image.blit(body, (4, 42 + i * 40))
......@@ -51,7 +48,7 @@ class Pipe_I(pygame.sprite.Sprite):
elif self.mPos[0] < (self.parent.game_p):
if self.flag:
self.flag = False
h = random.randrange(82, self.parent.max_s)
h = random.randrange(self.parent.min_pipe_h, self.parent.max_s)
p = Pipe_I(self.parent, self.parent.game_w, h)
self.parent.sprites.add(p, layer=1)
self.parent.tubes.add(p)
......@@ -74,7 +71,6 @@ class Pipe_S(pygame.sprite.Sprite):
self.p = h / 40
self.height = self.p * 40 + 42
if self.height > height:
print 'truee'
dx = self.height - height
self.mPos[1] = -dx
self.image = pygame.surface.Surface((91, self.height), 0)
......
......@@ -75,6 +75,3 @@ class Message(pygame.sprite.Sprite):
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