equal
deleted
inserted
replaced
615 } |
615 } |
616 var tsTo = new Date().getTime(); |
616 var tsTo = new Date().getTime(); |
617 ui.game.finishStep(); |
617 ui.game.finishStep(); |
618 ui.score.speed(parseFloat((step*1000.0/(tsTo-tsFrom)).toPrecision(3)), step); |
618 ui.score.speed(parseFloat((step*1000.0/(tsTo-tsFrom)).toPrecision(3)), step); |
619 ui.game.setMessage("Game over!"); |
619 ui.game.setMessage("Game over!"); |
620 ui.ai.current && ui.ai.current.cleanup(); |
620 ui.ai.current.cleanup(); |
621 } |
621 } |
622 document.getElementById("finish").addEventListener("click", ui.action.finish, false); |
622 document.getElementById("finish").addEventListener("click", ui.action.finish, false); |
623 |
623 |
624 ui.action.until = function() { |
624 ui.action.until = function() { |
625 if ( ! ui.ai.current) { |
625 if ( ! ui.ai.current) { |
668 step++; |
668 step++; |
669 } |
669 } |
670 var tsTo = new Date().getTime(); |
670 var tsTo = new Date().getTime(); |
671 ui.game.refresh(); |
671 ui.game.refresh(); |
672 ui.score.speed(parseFloat((step*1000.0/(tsTo-tsFrom)).toPrecision(3)), step); |
672 ui.score.speed(parseFloat((step*1000.0/(tsTo-tsFrom)).toPrecision(3)), step); |
673 ui.ai.current && ui.ai.current.cleanup(); |
673 ui.ai.current.cleanup(); |
674 } |
674 } |
675 document.getElementById("until").addEventListener("click", ui.action.until, false); |
675 document.getElementById("until").addEventListener("click", ui.action.until, false); |
676 |
676 |
677 //////////////////////////////////////////////////////////////// |
677 //////////////////////////////////////////////////////////////// |
678 // Register AIs. |
678 // Register AIs. |