Browse Source

fix flow, add it to the build script

master
zapashcanon 3 years ago
parent
commit
0e5212287d
Signed by: zapashcanon GPG Key ID: 8981C3C62D1D28F1
  1. 12
      scripts/build.sh
  2. 7
      src/js/main.js

12
scripts/build.sh

@ -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 !"
)

7
src/js/main.js

@ -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();

Loading…
Cancel
Save