diff options
author | Minteck <nekostarfan@gmail.com> | 2021-06-05 19:27:48 +0200 |
---|---|---|
committer | Minteck <nekostarfan@gmail.com> | 2021-06-05 19:27:48 +0200 |
commit | 8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6 (patch) | |
tree | 7096b67b189c0220826123c7d5b121752545d140 /views/script/game_global.js | |
download | kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.gz kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.tar.bz2 kartik-client-8cf5cefe6e91a5a1ed6eeaae4d94760d84c304a6.zip |
Presque sortie du jeu
Diffstat (limited to 'views/script/game_global.js')
-rw-r--r-- | views/script/game_global.js | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/views/script/game_global.js b/views/script/game_global.js new file mode 100644 index 0000000..4e6de21 --- /dev/null +++ b/views/script/game_global.js @@ -0,0 +1,45 @@ +$("#box").fadeOut(0); +$("#bg").fadeOut(0); +setTimeout(() => { + $("#box").fadeIn(500); + $("#bg").fadeIn(500); +}, 200) + +global.startgame = () => { + keysEnabled = true; + $("#credits").fadeOut(200) + Sound.intro(); + + setTimeout(() => { + started = true; + }, 1700) + + setTimeout(() => { + if (location.search === "?sp") { + enableAI(); + } + }, 1200) +} + +startHooks.push(() => { + global.hitshow = false; + global.started = false; + keysEnabled = false; + + $("body").focus(); + + if (!online) { + setTimeout(startgame, 7000) + } + + if (online && role === "host") { + setTimeout(() => { + clientWriter(JSON.stringify({ + _type: "ipc", + action: "gameIsReady", + message: null + }) + "|") + startgame(); + }, 7000) + } +})
\ No newline at end of file |