-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsnake.kv
More file actions
37 lines (32 loc) · 701 Bytes
/
snake.kv
File metadata and controls
37 lines (32 loc) · 701 Bytes
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
#:kivy 1.11
<SnakeCell>:
canvas:
Rectangle:
pos: self.pos
size: self.size
<Fruit>
canvas:
Rectangle:
pos: self.pos
size: self.size
source: './images/apple.png'
<SnakeGame>:
snake_head: head_id
fruit: fruit_id
label_game_over: game_over_id
SnakeCell:
id : head_id
size: self.size
Fruit:
id : fruit_id
size: self.size
Label:
font_size: 50
center_x: root.width / 2
top: root.top - 50
text: str(root.score)
Label:
id: game_over_id
font_size: 70
center_x: root.width/2
center_y: root.height/2