How to save and load a non-attribute?
On my game the aim is to complete the test as fast as possible. i have a timer in the corner which displays minutes, seconds and milliseconds, once the game is completed, how do i save the time it took the player to complete the game, then display that number later on, e.g. main menu highscore.
im using "floor(floor(( self.Time %3600)/60)/10)..floor((floor( self.Time %3600)/60)%10)..":"..floor(( self.Time %60)/10)..floor( self.Time %10)..":"..(floor( self.Time *10)%10)..floor(floor( self.Time *100)%10)" to display my timer, incase your wondering.
Thanks
im using "floor(floor(( self.Time %3600)/60)/10)..floor((floor( self.Time %3600)/60)%10)..":"..floor(( self.Time %60)/10)..floor( self.Time %10)..":"..(floor( self.Time *10)%10)..floor(floor( self.Time *100)%10)" to display my timer, incase your wondering.
Thanks
Comments
every0.1
change attribute self.playtime to self.playtime+0.1
i fixed it by making a global attribute instead of a self attribute.
also when using +0.1, the value doesnt change. it says on 0 and doesnt go up. to fix this issue i made it every 0.1 seconds, increase the value by +1 instead of 0.1.
then when displaying the final figure at the end, i did display: game.timetracker/10 so it returned the number to its appropriate value.