-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathaaa.sh
executable file
·53 lines (46 loc) · 911 Bytes
/
aaa.sh
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
#!/usr/bin/env bash
source cfg/config.sh
source code/threads.sh
source code/input.sh
source code/gfx.sh
source gfx/sprites.sh
source code/sfx.sh
source code/music.sh
source code/title.sh
source code/game.sh
source code/gameover.sh
source code/victory.sh
export LOOP=
setup() {
music-teardown
cfg-load
gfx-setup
trap teardown EXIT INT TERM
trap start-loop USR1
sound-setup
music-setup
joystick-setup
}
teardown() {
cfg-save
gfx-teardown
sound-teardown
music-teardown
joystick-teardown
terminate-all-threads
trap exit USR1
sleep "${DELAY}"
exit
}
start-loop() {
${LOOP}
(sleep "${DELAY}" && kill -USR1 $$) &
}
case ${BASH_VERSINFO[@]::2} in [1-3]' '[0-9][0-9]|[1-3]' '[0-9]|'4 '[0-1])
echo -e "\nYour Bash version is too old! Bash 4.2+ is required to run this game, you have ${BASH_VERSION} installed."
exit 1;;
esac
setup
title-mode
start-loop
start-input-handler