Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
T
Test
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Alan Aguiar
Test
Commits
37dd3548
Commit
37dd3548
authored
Mar 2, 2014
by
Alan Aguiar
Browse files
Options
Downloads
Patches
Plain Diff
remove spaces
parent
6f6b6e28
Branches
graficas-componente
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
background.py
+0
-2
0 additions, 2 deletions
background.py
bird.py
+0
-2
0 additions, 2 deletions
bird.py
main.py
+1
-0
1 addition, 0 deletions
main.py
pipe.py
+2
-6
2 additions, 6 deletions
pipe.py
scores.py
+0
-3
0 additions, 3 deletions
scores.py
with
3 additions
and
13 deletions
background.py
+
0
−
2
View file @
37dd3548
...
@@ -14,12 +14,10 @@ def make_back(parent):
...
@@ -14,12 +14,10 @@ def make_back(parent):
w
=
parent
.
game_w
w
=
parent
.
game_w
h
=
parent
.
game_h
h
=
parent
.
game_h
floor_y
=
parent
.
floor_y
floor_y
=
parent
.
floor_y
back
=
pygame
.
surface
.
Surface
((
w
,
h
),
0
)
back
=
pygame
.
surface
.
Surface
((
w
,
h
),
0
)
back
.
fill
(
SKY
)
back
.
fill
(
SKY
)
rect
=
pygame
.
rect
.
Rect
(
0
,
floor_y
,
w
,
h
-
floor_y
)
rect
=
pygame
.
rect
.
Rect
(
0
,
floor_y
,
w
,
h
-
floor_y
)
back
.
fill
(
GROUND
,
rect
)
back
.
fill
(
GROUND
,
rect
)
if
w
>
684
:
if
w
>
684
:
t
=
int
(
math
.
ceil
(
w
/
684.0
))
t
=
int
(
math
.
ceil
(
w
/
684.0
))
else
:
else
:
...
...
This diff is collapsed.
Click to expand it.
bird.py
+
0
−
2
View file @
37dd3548
...
@@ -14,9 +14,7 @@ class Bird(pygame.sprite.Sprite):
...
@@ -14,9 +14,7 @@ class Bird(pygame.sprite.Sprite):
def
__init__
(
self
,
parent
,
x
=
0
,
y
=
0
):
def
__init__
(
self
,
parent
,
x
=
0
,
y
=
0
):
pygame
.
sprite
.
Sprite
.
__init__
(
self
)
pygame
.
sprite
.
Sprite
.
__init__
(
self
)
self
.
parent
=
parent
self
.
parent
=
parent
self
.
mPos
=
[
x
,
y
]
self
.
mPos
=
[
x
,
y
]
self
.
mVel
=
0
self
.
mVel
=
0
self
.
mAcc
=
5
self
.
mAcc
=
5
...
...
This diff is collapsed.
Click to expand it.
main.py
+
1
−
0
View file @
37dd3548
...
@@ -64,6 +64,7 @@ class Flappy():
...
@@ -64,6 +64,7 @@ class Flappy():
self
.
mes_y
=
(
self
.
game_h
-
MES_H
)
/
2
self
.
mes_y
=
(
self
.
game_h
-
MES_H
)
/
2
self
.
game_p
=
self
.
game_w
-
DIST
-
self
.
pipe_w
self
.
game_p
=
self
.
game_w
-
DIST
-
self
.
pipe_w
self
.
max_s
=
self
.
floor_y
-
MIN_PIPE_H
-
DIST
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
.
end_s_x
=
(
self
.
game_w
-
139
)
/
2
self
.
sc_x
=
(
self
.
game_w
-
70
)
/
2
self
.
sc_x
=
(
self
.
game_w
-
70
)
/
2
...
...
This diff is collapsed.
Click to expand it.
pipe.py
+
2
−
6
View file @
37dd3548
...
@@ -10,22 +10,19 @@ body = pygame.image.load('images/pipe.png')
...
@@ -10,22 +10,19 @@ body = pygame.image.load('images/pipe.png')
class
Pipe_I
(
pygame
.
sprite
.
Sprite
):
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
)
pygame
.
sprite
.
Sprite
.
__init__
(
self
)
self
.
flag
=
True
self
.
flag
=
True
self
.
points
=
True
self
.
points
=
True
self
.
parent
=
parent
self
.
parent
=
parent
self
.
mPos
=
[
x
,
500
]
self
.
mPos
=
[
x
,
500
]
self
.
mVel
=
-
5
self
.
mVel
=
-
5
if
height
<
82
:
height
=
82
h
=
height
-
42
h
=
height
-
42
self
.
p
=
h
/
40
self
.
p
=
h
/
40
self
.
height
=
self
.
p
*
40
+
42
self
.
height
=
self
.
p
*
40
+
42
self
.
mPos
[
1
]
=
self
.
parent
.
floor_y
-
self
.
height
self
.
mPos
[
1
]
=
self
.
parent
.
floor_y
-
self
.
height
self
.
image
=
pygame
.
surface
.
Surface
((
91
,
self
.
height
),
0
)
self
.
image
=
pygame
.
surface
.
Surface
((
91
,
self
.
height
),
0
)
self
.
image
.
fill
((
255
,
255
,
255
))
self
.
image
.
fill
((
255
,
255
,
255
))
self
.
image
.
blit
(
head
,
(
0
,
0
))
self
.
image
.
blit
(
head
,
(
0
,
0
))
for
i
in
range
(
self
.
p
):
for
i
in
range
(
self
.
p
):
self
.
image
.
blit
(
body
,
(
4
,
42
+
i
*
40
))
self
.
image
.
blit
(
body
,
(
4
,
42
+
i
*
40
))
...
@@ -51,7 +48,7 @@ class Pipe_I(pygame.sprite.Sprite):
...
@@ -51,7 +48,7 @@ class Pipe_I(pygame.sprite.Sprite):
elif
self
.
mPos
[
0
]
<
(
self
.
parent
.
game_p
):
elif
self
.
mPos
[
0
]
<
(
self
.
parent
.
game_p
):
if
self
.
flag
:
if
self
.
flag
:
self
.
flag
=
False
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
)
p
=
Pipe_I
(
self
.
parent
,
self
.
parent
.
game_w
,
h
)
self
.
parent
.
sprites
.
add
(
p
,
layer
=
1
)
self
.
parent
.
sprites
.
add
(
p
,
layer
=
1
)
self
.
parent
.
tubes
.
add
(
p
)
self
.
parent
.
tubes
.
add
(
p
)
...
@@ -74,7 +71,6 @@ class Pipe_S(pygame.sprite.Sprite):
...
@@ -74,7 +71,6 @@ class Pipe_S(pygame.sprite.Sprite):
self
.
p
=
h
/
40
self
.
p
=
h
/
40
self
.
height
=
self
.
p
*
40
+
42
self
.
height
=
self
.
p
*
40
+
42
if
self
.
height
>
height
:
if
self
.
height
>
height
:
print
'
truee
'
dx
=
self
.
height
-
height
dx
=
self
.
height
-
height
self
.
mPos
[
1
]
=
-
dx
self
.
mPos
[
1
]
=
-
dx
self
.
image
=
pygame
.
surface
.
Surface
((
91
,
self
.
height
),
0
)
self
.
image
=
pygame
.
surface
.
Surface
((
91
,
self
.
height
),
0
)
...
...
This diff is collapsed.
Click to expand it.
scores.py
+
0
−
3
View file @
37dd3548
...
@@ -75,6 +75,3 @@ class Message(pygame.sprite.Sprite):
...
@@ -75,6 +75,3 @@ class Message(pygame.sprite.Sprite):
self
.
rect
.
x
=
self
.
mPos
[
0
]
self
.
rect
.
x
=
self
.
mPos
[
0
]
self
.
rect
.
y
=
self
.
mPos
[
1
]
self
.
rect
.
y
=
self
.
mPos
[
1
]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
sign in
to comment