-
Notifications
You must be signed in to change notification settings - Fork 0
/
kaboom.kv
63 lines (57 loc) · 1.26 KB
/
kaboom.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
#:kivy 1.10.1
#:import utils kivy.utils
<Bomb>:
size: 20, 30
source: "img/bomb.png"
keep_ratio: False
allow_stretch: True
<BombList>:
canvas:
Color:
rgb: utils.get_color_from_hex("ff00ff")
<Bomber>:
screen_size: self.screen_size
size: 80, 100
source: "img/bomber.png"
allow_stretch: True
keep_ratio: False
<Bucket>:
size: 75, 125
source: "img/3buckets.png"
allow_stretch: True
keep_ratio: False
pos: self.pos
<PauseButton>:
text: "Pause"
<KaboomGame>:
bucket: bucket
bomber: bomber
bombs: bombs
pause_button: pause_button
canvas:
Color:
rgb: utils.get_color_from_hex("dd88dd")
Rectangle:
size: root.width, root.height - 150
pos: 0, 0
Label:
font_size: 50
center_x: root.width * 3 / 4
top: root.top - 20
text: str(root.score)
Bomber:
id:bomber
center_y: root.height-125
screen_size: root.width
Bucket:
id:bucket
center_y: 100
BombList:
id:bombs
PauseButton:
id: pause_button
size:100, 40
center_x: root.width / 6
top: root.height - 30
text: "Pause (3)"
on_press: root.pause_game()