Phaser 4 Reddit game

I am developing a game for the reddit hackathon and the game will become unresponsive to touch and get a white bar at the bottom whenever the app is minimized. AI has given me a multitude of solutions that don’t work.

Has anyone solved this problem in Phaser 4?

Also, why is there no Phaser 4 category in this forum?

That’s not a common issue I’ve run into in Phaser 4 or any version. Anything in the browser console? Are you running any code that executes when the game loses focus?

I only started trying to run code on blur and focus when I noticed the issue. I do have an on resize event firing an updateLayout function that resizes the game and repositions the display list game objects to match the size change. I’m also developing this for the Reddit hackathon, so it is running in the Devvit context. AI has identified a known webkit glitch on iOS as the culprit, and I’ve resolved this issue before with window.location.reload() forcing an entire game reload when the game is brought back to focus, but it doesn’t seem to work in this case. It’s hard to debug, since I can’t recreate the issue in the chrome inspector on my iPhone. I’ll set up logging to the screen and see if I can get a mismatch between screen sizes and parent containers to trigger a new updateLayout call. I suspect the initial updateLayout runs before the size of the screen has completely resolved on bringing the app to the front again, but without a new resize event, the updateLayout doesn’t get called again to match.

I’ve done more digging and when I swipe up from the bottom of the iPhone screen, I see a Reddit popup saying ‘Joing the conversation’. If I don’t release my swipe and swipe back down, the reddit frame reappears and the game continues to function normally. However, when I swip up and release, the white bar appears and the reddit frame does not. When the game is returned to the front, the reddit frame does not reappear and the game remains non interactive, though it otherwise runs as expected

Thank you for responding to this post! For anyone else having this issue, AI finally gave me the answer. In the devvit.json file provided with the Phaser template, look at the “entrypoints” config and change it like this:

"entrypoints": {
      "default": {
        "inline": true,
        "entry": "splash.html"
      },
      "game": {
        "inline": true,
        "entry": "game.html"
      }
    }


The key is to make the “game.html” entry point use the “inline”: true configuration the same as the “splash.html” entry point does.