-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathExit.py
More file actions
57 lines (41 loc) · 1.29 KB
/
Exit.py
File metadata and controls
57 lines (41 loc) · 1.29 KB
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
import os
import threading
import Animations
import Direction
import Game
class Exit(Game.CubeGame, threading.Thread):
_name = 'Exit'
_version = 'v0.1'
_menu_frame = [1, 0, 0, 0, 0, 0, 0, 1,
0, 1, 0, 0, 0, 0, 1, 0,
0, 0, 1, 0, 0, 1, 0, 0,
0, 0, 0, 1, 1, 0, 0, 0,
0, 0, 0, 1, 1, 0, 0, 0,
0, 0, 1, 0, 0, 1, 0, 0,
0, 1, 0, 1, 0, 0, 1, 0,
1, 0, 0, 0, 0, 0, 0, 1]
def __init__(self, cube_size, frame_size):
Game.CubeGame.__init__(self, cube_size, frame_size, self._name)
threading.Thread.__init__(self)
self.an = None
self.failed = False
def get_menu_frame(self):
return self._menu_frame
def has_menu_animation(self):
return True
def start_game(self):
pass
def play_animation(self):
self.an = Animations.TickerAnimation("exit")
self.an.start()
def close_animation(self):
self.an.stop()
def stopped_animation(self):
return self.an.stopped()
def is_animation_alive(self):
return self.an.is_alive()
def done(self):
pass
def run(self):
os.system("sudo shutdown -h now")
Direction.direction_p_1.value = 0