When you give them energy store the time. If the game is ever played and the time is before that stored time then you know that they've put their clock forward and back again. Not sure what you'd want to do to the player though once the game knows the clock has been fiddled with. Blocking them out from the game completely would be a bit harsh.
how would i do that? i could make it so it goes to a scene that says: you time cheater! You deserve a restart of the game! lol jk ill think of something
How would you do what? Store the time or block them out? You can access the device time so you'll be able to save it in a table. And to block them out completely just have one rule that says if game.cheated = true change scene to a "you can't play anymore" scene. I wouldn't recommend that though, you'll be setting yourself up for bad reviews and complaints.
I'm sure you could save the time to multiple attributes instead of a table. I wouldn't store the time as a time though, I'd convert it to seconds so the value would look something like this 65746425363 (fictional timestamp that's probably longer than an actual one) I have a project somewhere where I converted the time and date into a timestamp. I'll dig it out
I couldn't find the project file but I remembered posting the formula in a thread a little while ago. This was the message:
----------------------------------
This will convert a time to a very basic timestamp, but won't take into account that timestamps start from 1970 odd, and not all months containing 31 days which is why the number is much higher than a unix timestamp, but it should give you a basic one to work with for your game.
Basically with this you could tell how many seconds there are between the two dates/times. If it's a negative number then the current date is before the date you last gave them energy, which means they've adjusted the clock to cheat.
Comments
----------------------------------
This will convert a time to a very basic timestamp, but won't take into account that timestamps start from 1970 odd, and not all months containing 31 days which is why the number is much higher than a unix timestamp, but it should give you a basic one to work with for your game.
game.Clock.Second +( game.Clock.Minute *60)+( game.Clock.Hour *60*60)+( game.Clock.Day *60*60*24)+( game.Clock.Month *60*60*24*31)+( game.Clock.Year *60*60*24*31*12)
----------------------------------
Basically with this you could tell how many seconds there are between the two dates/times. If it's a negative number then the current date is before the date you last gave them energy, which means they've adjusted the clock to cheat.