fix flow, add it to the build script

This commit is contained in:
zapashcanon 2019-04-30 15:50:10 +02:00
parent 6c5af3804c
commit 0e5212287d
Signed by: zapashcanon
GPG Key ID: 8981C3C62D1D28F1
2 changed files with 13 additions and 6 deletions

View File

@ -4,11 +4,15 @@ set -eu
( cd "$(dirname "$0")/../"
vdir=src/css/vendors
( cd src/css/vendors
wget "https://fonts.googleapis.com/css?family=Press+Start+2P" -O $vdir/ps2p.css
wget "https://unpkg.com/nes.css/css/nes.min.css" -O $vdir/nes.min.css
wget "https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" -O $vdir/bootstrap.min.css
wget "https://fonts.googleapis.com/css?family=Press+Start+2P" -O ps2p.css
wget "https://unpkg.com/nes.css/css/nes.min.css" -O nes.min.css
wget "https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" -O bootstrap.min.css )
( cd src/js
flow main.js )
echo "Done !"
)

View File

@ -22,6 +22,11 @@ const snd = document.getElementById("audioplayer");
if (!snd) {
throw "invalid audio player";
}
if (!(snd instanceof HTMLAudioElement)) {
throw "invalid audio player";
}
snd.volume = 0.3;
// get the json file `file_name` and call `callback` with the result
const get_json_callback = function(file_name, callback) {
@ -125,8 +130,6 @@ const new_game = function (multi) {
get_json_callback("lvl_01.json", game);
}
snd.volume = 0.3;
const snd_start = function() {
snd.currentTime = 0.0;
snd.play();