Commit ecbe4964 authored by ogomez92's avatar ogomez92

fix shoot

parent d4349619
......@@ -897,21 +897,11 @@ update() {
}
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;
console.log("time "+this.elapsedTime);
if (this.elapsedTime<=1950) {
let timeDisplay=this.elapsedTime/1000;
timeDisplay=timeDisplay.toFixed(2);
this.pool.playStatic("go_early",0);
this.combo=0;
this.timer.stop();
this.score+=this.curscore;
new ScrollingText(strings.get("goEarly",[timeDisplay,this.turns-1]),"\n",()=> {
this.newTurn();
});
}
else if (this.elapsedTime==2000) {
if (this.elapsedTime==2000) {
this.curscore=1000;
this.pool.playStatic("go_exact",0);
this.turns++;
......@@ -929,6 +919,17 @@ this.score+=this.curscore;
this.newTurn();
});
}
else if (this.elapsedTime<=1950) {
let timeDisplay=this.elapsedTime/1000;
timeDisplay=timeDisplay.toFixed(2);
this.pool.playStatic("go_early",0);
this.combo=0;
this.timer.stop();
this.score+=this.curscore;
new ScrollingText(strings.get("goEarly",[timeDisplay,this.turns-1]),"\n",()=> {
this.newTurn();
});
}
else if (this.elapsedTime>1950 && this.elapsedTime<2000) {
let timeDisplay=this.elapsedTime/1000;
timeDisplay=timeDisplay.toFixed(2);
......
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