-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathflappybird.kv
64 lines (60 loc) · 1.49 KB
/
flappybird.kv
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
#:kivy 1.8.0
<FlappyBirdGame>:
mcnay: mcnay
background: background
canvas:
Color:
rgb: 137 / 255.0, 228 / 255.0, 135 / 255.0
Background:
id: background
pos: root.pos
Mcnay:
id: mcnay
center_x: root.center_x
center_y: root.center_y
Label:
font_size: 70
center_x: root.center_x
top: root.top - 30
markup: True
text: "[color=ffffff]" + str(root.score) + "[/color]"
<Background>:
image_one: image_one
image_two: image_two
Image:
id: image_one
source: "images/background.png"
pos: 0, 0
size: 800, 600
Image:
id: image_two
source: "images/background.png"
pos: root.width, 0
size: 800, 600
<Obstacle>:
width: 30
canvas:
Color:
rgb: 21 / 255.0, 180 / 255.0, 39 / 255.0
Rectangle:
pos: self.x, self.gap_top + 20
size: self.width, self.height - self.gap_top
Rectangle:
pos: self.x, 112
size: self.width, self.gap_top - self.gap_size - 112
Image:
source: "images/pipe_bottom.png"
center_x: root.center_x
y: root.gap_top - 20
Image:
source: "images/pipe_top.png"
center_x: root.center_x
y: root.gap_top - root.gap_size - 40
<Mcnay>:
bird_image: image
size: 50, 50
Image:
id: image
source: "images/flappy.png"
size: root.size
pos: root.pos