Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Game wont refresh #50

Closed
GritPixel opened this issue May 15, 2017 · 3 comments
Closed

Game wont refresh #50

GritPixel opened this issue May 15, 2017 · 3 comments

Comments

@GritPixel
Copy link

I got the program to run on Ubuntu. It opens, detects the game, I press "s" then it brings chrome to focus and the Dino runs. The Dino hits the cactus but the program does not recognise this. It just sits on the game over screen. Even in the terminal "GameStatus: PLAYING". It does not change to "OVER". Help would be appreciated : /

@huan
Copy link
Contributor

huan commented Jun 9, 2017

Yes, I also have this issue.

After looking the code, it seems the following code gameOverOffset is not right anymore:

// Read Game state
// (If game is ended or is playing)
GameManipulator.readGameState = function () {
  // Read GameOver
  var found = Scanner.scanUntil(
    [
      GameManipulator.offset[0] + GameManipulator.gameOverOffset[0],
      GameManipulator.offset[1] + GameManipulator.gameOverOffset[1]
    ],

    [2, 0], COLOR_DINOSAUR, false, 20
  );

I guess it's because the position of the GAME OVER is changed in the new version of Chrome?

My system is:

  • Ubuntu 17.04
  • Chrome 59.0.3071.86 (Official Build) (64-bit)

@huan
Copy link
Contributor

huan commented Jun 9, 2017

@GritPixel I changed

--- a/GameManipulator.js
+++ b/GameManipulator.js
@@ -28,8 +28,9 @@ var GameManipulator = {
   gamestate: 'OVER',
 
   // GameOver Position
-  gameOverOffset: [190, -82],
+  gameOverOffset: [190, -75], 

The above change fixes this issue for me.

Will send a PR later to make it compatible with different Chrome Browsers.

ivanseidel added a commit that referenced this issue Jun 9, 2017
compatible(chrome): v59 changed the `GAME OVER` position. (fix #50)
@himahuja
Copy link

himahuja commented Jul 7, 2017

Sir, I had to change back the coordinates to [190, -82] for it to work for me. I am on a mac, and maybe this is system dependent. Great job with this though.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants