Commit 816305f5 authored by ogomez92's avatar ogomez92

first letter navigation in menus

parent 8ead5082
Version 3.0 September 2018
- Added first letter navigation in the main menu.
- Explained in the main menu that you can use page up and down to control music volume as well as first letter navigation.
- Added a new minigame, react
- Added achievements for react.
- Added explanation for the page up and down keys for the music.
- Moved screen reader option below start game.
- Make new version available menu option launch the oriolgomez.com website.
- Fixed a possible exploit in betting games.
- New minigame, ready set go.
\ No newline at end of file
- New minigame, ready set go.
- fixed scoring in the new ready set go minigame
\ No newline at end of file
......@@ -480,7 +480,7 @@ callback(answer);
}
});
}
export async function checkPack(changeBoot=true,debug=true) {
export async function checkPack(changeBoot=true,debug=false) {
editing=false;
const fs=require('fs');
try {
......
......@@ -98,6 +98,26 @@ class Menu {
this.menuData[this.cursor].addChar(String.fromCharCode(char));
this.sndKeyChar.play();
}
else {
//char navigation code
for (let i=this.cursor+1;i<this.menuData.length;i++) {
if (this.menuData[i].name.toLowerCase().substr(0,1)==String.fromCharCode(char).toLowerCase()) {
this.cursor=i;
this.menuData[this.cursor].speak();
this.first=false;
return;
}
}
for (let i=0;i<this.menuData.length;i++) {
console.log("ran second loop");
if (this.menuData[i].name.toLowerCase().substr(0,1)==String.fromCharCode(char).toLowerCase()) {
this.cursor=i;
this.menuData[this.cursor].speak();
this.first=false;
return;
}
}
}
}
removeCharacter() {
......
......@@ -869,6 +869,9 @@ await going.init();
}
class GoGame {
constructor() {
this.th1=1980;
this.th2=2015;
this.th3=2020;
this.inp=new KeyboardInput();
this.inp.init();
this.combo=0;
......@@ -900,10 +903,10 @@ loop() {
if (this.inp.isJustPressed(KeyEvent.DOM_VK_SPACE)) {
this.pool.playStatic("go_shoot",0);
this.elapsedTime=this.time.elapsed;
if (this.elapsedTime>=2000 && this.elapsedTime<2011) this.elapsedTime=2000;
if (this.elapsedTime>=2000 && this.elapsedTime<2008) this.elapsedTime=2000;
console.log("time "+this.elapsedTime);
if (this.elapsedTime==2000) {
this.curscore=1000;
this.curscore=2000;
this.pool.playStatic("go_exact",0);
this.turns++;
this.maxTurns++;
......@@ -920,9 +923,9 @@ this.score+=this.curscore;
this.newTurn();
});
}
else if (this.elapsedTime<=1950) {
else if (this.elapsedTime<=this.th1) {
let timeDisplay=this.elapsedTime/1000;
timeDisplay=timeDisplay.toFixed(2);
timeDisplay=timeDisplay.toFixed(3);
this.pool.playStatic("go_early",0);
this.combo=0;
this.timer.stop();
......@@ -931,10 +934,10 @@ new ScrollingText(strings.get("goEarly",[timeDisplay,this.turns-1]),"\n",()=> {
this.newTurn();
});
}
else if (this.elapsedTime>1950 && this.elapsedTime<2000) {
else if (this.elapsedTime>this.th1 && this.elapsedTime<this.th2) {
let timeDisplay=this.elapsedTime/1000;
timeDisplay=timeDisplay.toFixed(2);
let scoreFormula=Math.round(100-(2000-this.elapsedTime));
timeDisplay=timeDisplay.toFixed(3);
let scoreFormula=Math.round(100-(2000-this.elapsedTime))*8;
this.curscore=scoreFormula;
this.pool.playStatic("go_ok",0);
this.combo++;
......@@ -950,10 +953,10 @@ this.score+=this.curscore;
this.newTurn();
});
}
else if (this.elapsedTime>2000 && this.elapsedTime<2050) {
else if (this.elapsedTime>this.th2 && this.elapsedTime<this.th3) {
let timeDisplay=this.elapsedTime/1000;
timeDisplay=timeDisplay.toFixed(2);
let scoreFormula=Math.round(100-(this.elapsedTime-2000));
timeDisplay=timeDisplay.toFixed(3);
let scoreFormula=Math.round(100-(this.elapsedTime-2000))*8;
this.combo++;
this.curscore=scoreFormula;
this.pool.playStatic("go_ok",0);
......@@ -977,7 +980,7 @@ else if (this.time.elapsed>=1000 && this.notify==1) {
this.beep2.play();
this.notify++;
}
else if (this.time.elapsed>=2050 && this.notify==2) {
else if (this.time.elapsed>=this.th3 && this.notify==2) {
this.pool.playStatic("go_late",0);
this.combo=0;
this.timer.stop();
......@@ -992,7 +995,7 @@ this.turns--;
this.notify=0;
if (this.turns<1) {
new ScrollingText(strings.get("goOver",[this.score,this.maxTurns]),"\n",()=> {
addCash(this.score,0,()=> {
addCash(Math.ceil(this.score/2),0,()=> {
so.kill(()=> {
st.setState(2);
});
......
......@@ -12,7 +12,7 @@ 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.",
goEarly:"Too early! you pressed enter at %1 seconds. You have %2 turns left.",
goExact:"Very good! You pressed at exactly 3 seconds. 1 extra turn + 1000 points!",
goExact:"Very good! You pressed at exactly 3 seconds. 1 extra turn + 2000 points!",
goOk:"ok, not bad. You pressed enter at %1 seconds. You get %2 points! You have %3 turns left.",
goOver:"Game over! You scored %1 points, in %2 turns. Do you think you can do better next time?",
goIntro:"Are you ready to play ready set go? When you hear the countdown, press space when you think 3 seconds have passed!",
......@@ -242,7 +242,7 @@ mEdit:"Pack Editor",
buygame:"Do you want to buy %1 for %2 beatcoins?",
bet:"Please place your bet with the left and right arrow keys and press enter when you have decided.",
nogame:"You don't have the required %1 beatcoins for this game, you only have %2.",
mainmenu:"main menu: arrow keys to select options, page up and page down raise and lower the music volume.",
mainmenu:"main menu: arrow keys to select options, page up and page down raise and lower the music volume. You can also use the first letter of an option to move to it",
mSelect:"Please select",
mSafeSelect:"Please select, with the right and left arrow keys, how many safeguards you want to buy and press enter.",
level:"Level %1",
......@@ -300,7 +300,7 @@ mEdit:"Pack Editor",
goLater:"Demasiado tarde! Has pulsado enter a los %1 segundos... Te quedan %2 turnos.",
goEarly:"Demasiado pronto! has pulsado enter a los %1 segundos... Te quedan %2 turnos.",
goOk:"Bueno, ok. Has pulsado a los %1 segundos. Ganas %2 puntos! Te quedan %3 turnos.",
goExact:"Bien! Has pulsado a los 3 segundos exactos! Turno extra y 1000 puntos!",
goExact:"Bien! Has pulsado a los 3 segundos exactos! Turno extra y 2000 puntos!",
goIntro:"Preparado para jugar a preparados listos ya? cuando oigas el contador, pulsa espacio a la de tres!",
newUpdate:"Hay una nueva versión disponible! Tienes la %1 y la %2 está disponible.",
macwarning:"Atención: En un mac, por favor pulsa control opción flecha izquierda seguido de control opción derecha o no tendrás voz.",
......@@ -548,7 +548,7 @@ achhpongfail:"Juega a reacciona y consigue 0 teclas correctas y al menos una inc
mBrowseUnlocked: 'Cambiar a otro pack comprado',
mHashes: 'Reconstruir base de datos de packs',
codescracked:"Has podido desbloquear %1 códigos, con %2 acciones diferentes!",
mainmenu:"menú principal: flechas arriba y abajo para seleccionar opciones, avanzar y retroceder página para subir y bajar la música",
mainmenu:"menú principal: flechas arriba y abajo para seleccionar opciones, avanzar y retroceder página para subir y bajar la música. también puedes usar la primera letra de una opción para moverte a ella.",
mSelect:"Por favor selecciona",
mSafeSelect:"Por favor selecciona, con las flechas izquierda y derecha, cuántos antifallos quieres y pulsa enter.",
mSafeguards:"Comprar antifallos (ahora %1)",
......
Make tutorial for react and gogame
achievements for goGame
fix the scoring mechanism.
\ No newline at end of file
achievements for goGame
\ No newline at end of file
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