Skip to content

Commit 2e47465

Browse files
Another Bug Fix
fixed timer not reseting bug, fixed the larger temperature being equil bug, and fixed a typo in an alert message.
1 parent baa7dab commit 2e47465

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

JS/MainLoop.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ function mainLoop(particlesLeft, particlesRight, translation) {
5959
if(isStopwatchRunning){
6060
stopwatchTime += 1;
6161
$('#time').html(Math.round(stopwatchTime/fps));
62-
if(roundedTempLeft-roundedTempRight <= 0.01){
62+
if(Math.abs(roundedTempLeft-roundedTempRight) <= 0.01){
6363
$('[type=checkbox]').click();
64-
alert('You have reached a thermal temperature of '+ roundedTempLeft + "in " + Math.round(stopwatchTime/fps) + " seconds");
64+
alert('You have reached a thermal temperature of '+ roundedTempLeft + " in " + Math.round(stopwatchTime/fps) + " seconds");
65+
stopwatchTime = 0;
66+
$('#time').html(0);
6567
}
6668
}
6769
}

JS/Start.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,9 +53,9 @@ function resetLoop(){
5353
//allowCrossOver = false;
5454
if(allowCrossOver){
5555
$('[type=checkbox]').click();
56-
stopwatchTime = 0;
57-
$('#time').html(0);
5856
}
57+
stopwatchTime = 0;
58+
$('#time').html(0);
5959
clearInterval(gameLoop);
6060
init(ctx);
6161
}

0 commit comments

Comments
 (0)