-
Notifications
You must be signed in to change notification settings - Fork 0
/
energy.kv
76 lines (69 loc) · 1.54 KB
/
energy.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
65
66
67
68
69
70
71
72
73
#:import random random
FloatLayout:
score_label: score_label
ScrollingBackground:
speed: 0.3
x_offset: 0.27
ScrollingBackground:
speed: 0.1
x_offset: 0.73
Ship
ScoreLabel:
id: score_label
<ScoreLabel@Label>:
font_size: "80dp"
color: 1, 0.7, 0.7, 0.6
text: str(app.score)
size_hint: None, None
size: self.texture_size
pos_hint:
{
"center_x": 0.5,
"center_y": 0.8,
}
<Ship>:
size_hint: None, None
width: "20dp"
height: self.width
pos_hint:
{
"center_x": 0.5,
"center_y": 0.5,
}
canvas.after:
Color:
rgba:
(
[.3, .4, 1, 1] if self.growth > 0 else [1, .4, .3, 1]
)
Line:
width: 2
circle:
[
self.center_x,
self.center_y,
self.width / 4,
360 * self.energy,
0
]
Image:
source: "images/RingGreen.zip"
anim_delay: 0.05
allow_stretch: True
size: root.size
pos: root.pos
<Enemy>:
size_hint: None, None
width: "20dp"
height: self.width
Image:
source: "atlas://images/enemies/enemy-0%s" % random.randint(1, 3)
allow_stretch: True
size: root.size
pos: root.pos
Label:
pos: root.pos
size: self.texture_size
color: 0, 0, 0, 1
markup: True
text: "[b]%s[/b]" % str(root.score)