• Resolved iantiu

    (@iantiu)


    Great plugin btw! However, I can’t get it to work on Ipad mini. For some reason it detects it as desktop and will not let me touch the screen for some reason. It will only work when I press spacebar so I have to intentionally click the comment section and play the game. Is there a way around this? Thanks!

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter iantiu

    (@iantiu)

    Never mind. It works on Safari, but not on my web app. Must be a setting thing. Thanks

    Plugin Author Chris David Miles

    (@chrisdavidmiles)

    Hello @iantiu

    I’m glad you are reporting it’s working for you on Safari, but it might not be a problem with your site specifically. I’m seeing the same problem on my iPad as well, and not just on your site. Here’s the game on my site with the same problem: https://chrisdavidmiles.com/dinosaur-game

    I did test the game pretty extensively on iPad when this plugin was first published on wordpress.org so I’m guessing this may be a change to Safari for iPad OS. The actual game code is JavaScript that’s forked from the ‘T-Rex runner’ game in the open source project Chromium which is used for browsers like Chrome and Edge. And this plug-in intentionally doesn’t use the latest version of that JavaScript in an attempt to have the highest compatibility with browsers. But this appears to be a browser compatibility problem with safari on iPad OS. I’m not positive that’s the issue, but based on symptoms that’s currently my best guess.

    I’m going to have to look into this more and see what I can do to make this work on Safari for iPad if it’s possible. It will require some pretty extensive testing since this plugin is now active on lots of sites, so pushing a refactor of JavaScript to that many sites should be done with caution. I don’t expect to have a solution right away, but I’ll look into this and run a lot of tests and probably include refactored game code in the next major version.

    Thanks for reporting the issue.

    Thread Starter iantiu

    (@iantiu)

    Haha okay I really appreciate it. Something about running the game in my app makes it think that it’s in desktop mode and waits for a keyboard input instead of a tap input on the tablet. Are you using a conditional statement to make this happen? Would it be possible to make both inputs working at the same time? What if I’m using a desktop with a touch screen monitor? It would be good to have the option to touch the screen to make the Dino jump, or hit the space key if the user wants. Just my two cents 🙂 Thank you for your response

    Plugin Author Chris David Miles

    (@chrisdavidmiles)

    Yes it should work with both tapping and keyboard input for anything with a touch screen regardless of screen size.

    As for your other question about conditionals, here’s the unminified code: https://plugins.trac.wordpress.org/browser/dinosaur-game/tags/1.0.7/game-logic.js . Just look for if statements evaluating IS_IOS to see how it works.

    If I remember right when I was getting plugin ready to be initially published, I had to modify the code slightly to get it working on Safari because the way the sound effects worked would completely crash the game on Safari, and it hadn’t yet been patched in the actual chromium code. (The Chromium version has changed a lot since then). I found a solution on Github from someone else working on a JavaScript based game with sound effects. I don’t like browser specific code, but it looks like I may have to do some extra Safari specific stuff once again here. Safari just doesn’t want to play nice with the other browsers sometimes.

    Here’s the interesting part. It seems to work on “Chrome for iPad” which isn’t even really Chrome. The browser engine behind Chrome for iPad is still just Safari, it’s just got the Chrome UI. So that’s what makes me think this is probably fixable somehow, it’s just going to take a bit of digging and a lot of testing.

    Cheers!

    Thread Starter iantiu

    (@iantiu)

    It’s always interesting to see how this game works :). Only language I know is VB but I can somehow trace the variables and conditionals.

    I just find it bizarre how it acts differently on my IPAD Mini. Based on what you said, the touch user input should work regardless of screen size, so on my IPAD Mini, I should be able to touch the screen to make the dinosaur jump. Instead, it’ll only work with the spacebar and I would have to tap on the comment section to activate the touch keyboard. The game works, just not registering any of the touch input.

    This game reminds me of flappy bird but easier. I did a 4000+ score earlier. I’m sure people have done a lot better haha

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Playing on Ipad Mini’ is closed to new replies.