oasalonen / RealityPacman

Other
2 stars 0 forks source link

Prevent cheating by turning screen off #4

Open omahlama opened 13 years ago

omahlama commented 13 years ago

Turning screen off stops the ghosts but keeps the timer running. Possible fix:

oasalonen commented 13 years ago

Duration is incremented now during every engine tick event. This should at least stop the accumulation of time while the app is dormant.

However, it is not the best way since it assumes that the game tick is fired off at exact intervals. Better would be a way to detect when app is dormant and accumulate a pause time, then subtract the pause time from the duration calculated from the difference of the game stop and start time.

I also disabled application idle mode detection while game is running. Not sure if this does what I intend, need a device to verify.