Commit 30628cbb authored by Oriol Gómez's avatar Oriol Gómez

quizz minigame

parent c9413dc2
......@@ -11,7 +11,7 @@ let achs=[
export var editing=false;
import {OldTimer} from './oldtimer';
import $ from 'jquery';
import {playGo,playPong,playFootball,playDouble,playDeck,playCode,playSlots} from './minis.js';
import {playQuestions,playGo,playPong,playFootball,playDouble,playDeck,playCode,playSlots} from './minis.js';
//import {SoundPool} from './soundPool';
import Cryptr from 'cryptr';
let boot=false;
......@@ -480,7 +480,7 @@ callback(answer);
}
});
}
export async function checkPack(changeBoot=true,debug=false) {
export async function checkPack(changeBoot=true,debug=true) {
editing=false;
const fs=require('fs');
try {
......@@ -544,7 +544,7 @@ downloadPacks(['default']);
}
if (debug) {
//await strings.check(2);
await playGo();
playQuestions();
return;
}
booter();
......
......@@ -1007,4 +1007,23 @@ this.time.restart();
this.timer.start();
}
}
}
\ No newline at end of file
}
export async function playQuestions() {
let q=new QuestionsGame();
}
class QuestionsGame {
constructor() {
this.packs=0;
for (let i in data.unlocks) {
if (data.unlocks[i].level>1) this.packs++;
}
speech.speak(this.packs);
if (this.packs<5) {
new ScrollingText(strings.get("need5"),"\n",()=> {
st.setState(2);
});
}
}
}
......@@ -7,7 +7,8 @@ class Strings {
constructor() {
this.strings = {};
this.strings[1] = {
//new English
//new English
need5:"Sorry but you need to have unlocked at least 5 packs before you can play this game.",
combo:"Combo x%1! + %2 points!",
goLate:"Too late! You have %1 turns left.",
goLater:"Too late, you pressed enter at %1 seconds. You have %2 turns left.",
......@@ -293,7 +294,8 @@ mEdit:"Pack Editor",
mDownload: 'Download new packs'
};
this.strings[2] = {
//new Spanish
//new Spanish
need5:"Vaya, necesitarás desbloquear al menos 5 packs para poder jugar a este juego.",
combo:"Combo x%1! +%2 puntos!",
goOver:"Has terminado! Has conseguido %1 puntos, en %2 turnos. Lo harás mejor la próxima vez?",
goLate:"Demasiado tarde! Te quedan %1 turnos.",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment