lucasnlm/antimine-android

Go back to menu when screen turned off

Opened this issue · 2 comments

Is your feature request related to a problem? Please describe.
Was in the middle of a game and turned the screen off to go do something, when I came back to it later I found I'd lost. I'm guessing either the screen came back on and I tapped a mine or maybe when I messed with my phone later, when I first unlocked it maybe I accidentally tapped a mine.

Describe the solution you'd like
If the game automatically paused (went back to menu) when the screen turns off (not when the phone locks, as it doesn't always lock when turning the screen off), it would prevent this.

Describe alternatives you've considered
N/A

Additional context
N/A

I think I can do something to avoid this problem. The screen can't screen off (or shouldn't) because the app keeps the screen on when in game. But if you turn your screen off during the game, I can get it back to menu if it takes more than X seconds to return to the game.
What do you think?

That would probably work, though I'm not sure it's necessary to wait at all. If the screen turns off, it should just immediately go to the menu, or pause the game and block the screen, so it has to be unpaused to unblock it and continue playing.