fixed page reload bug for windows OS
Esse commit está contido em:
+14
-1
@@ -208,7 +208,7 @@ GameManipulator.startNewGame = function (next) {
|
|||||||
// Press space to begin game (repetidelly)
|
// Press space to begin game (repetidelly)
|
||||||
_startKeyInterval = setInterval(function (){
|
_startKeyInterval = setInterval(function (){
|
||||||
// Due to dino slowly gliding over the screen after multiple restarts, its better to just reload the page
|
// 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() {
|
setTimeout(function() {
|
||||||
// Once reloaded we wait 0.5sec for it to let us start the game with a space.
|
// Once reloaded we wait 0.5sec for it to let us start the game with a space.
|
||||||
robot.keyTap(' ');
|
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
|
// Compute points based on sensors
|
||||||
//
|
//
|
||||||
|
|||||||
Referência em uma Nova Issue
Bloquear um usuário