-
Notifications
You must be signed in to change notification settings - Fork 2
/
succer.kv
62 lines (52 loc) · 1.33 KB
/
succer.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.0.9
<SuccerBall>:
size: 50, 50
canvas:
Ellipse:
pos: self.pos
size: self.size
<SuccerPlayer>:
size: 128, 128
src: 'p1.png'
canvas.before:
Rectangle:
pos:self.pos
size:self.size
source:self.src
<SuccerGame>:
ball: succer_ball
player1: player_left
player2: player_right
canvas:
Rectangle:
pos: self.center_x-5, 0
size: 10, self.height
canvas.before:
Rectangle:
pos: self.pos
size: self.size
source: 'field.png'
Label:
font_size: 70
center_x: root.width / 4
top: root.top - 50
text: str(root.player1.score)
Label:
font_size: 70
center_x: root.width * 3 / 4
top: root.top - 50
text: str(root.player2.score)
SuccerBall:
id: succer_ball
center: self.parent.center
SuccerPlayer:
id: player_left
x: root.width/4
center_y: root.center_y
center_x: root.center_x
SuccerPlayer:
id: player_right
src: 'p2.png'
x: root.width*3/4
center_y: root.center_y
center_x: root.center_x