Merge pull request #40 from tiagosomda/master

Fixed page reload bug for windows OS
Esse commit está contido em:
Ivan Seidel
2016-12-17 03:23:01 -02:00
commit de GitHub
+14 -1
Ver Arquivo
@@ -208,7 +208,7 @@ GameManipulator.startNewGame = function (next) {
// Press space to begin game (repetidelly)
_startKeyInterval = setInterval(function (){
// Due to dino slowly gliding over the screen after multiple restarts, its better to just reload the page
robot.keyTap('r','command');
GameManipulator.reloadPage();
setTimeout(function() {
// Once reloaded we wait 0.5sec for it to let us start the game with a space.
robot.keyTap(' ');
@@ -228,6 +228,19 @@ GameManipulator.startNewGame = function (next) {
}
// reload the page
GameManipulator.reloadPage = function ()
{
// retrieves platform
var platform = process.platform;
if(/^win/.test(process.platform)) {
robot.keyTap('r','control');
} else if(/^darwin/.test(process.platform)) {
robot.keyTap('r','command');
}
}
// Compute points based on sensors
//