Step counter/tick!
JOELwindows7 - Custom level - Jun 4, 2015 from AndroidGuys! On a function 'step(count)', the count is ticks the level played!
Check the Lua out! It is useful rather than using timer=timer+.008! Efficiently use time=count/125
Look at the new function, now it uses 'count' variable to base the timer than the old one that uses equation (x=x+.008) which is deemed inefficient. Older one has weakness: sometime the plus will bit miss/inaccurate due to the Principia system uses float type. So sometime it come out e.g. "10.35199999999998" (whoah many nine so I don't know how many the count is) while we only want 10.351. As well this cause some message to messed up and always, the timer will be put on a one new line because of that float miss bug that result many nine decimals occurs.
So well, this function will fix it. Proof found on occasional ticks, about 8 second later the bug will appear for the first time and so on.
zardOz criticize that using x=count*.008 is too simple changes. Supposedly it should be:
------------------------
function time()
return count/125
end
------------------------
So you can bring this stopwatch or I mean timer commonly everywhere you want and easier e.g. to put this you can do
------------------------
function step()
game:show_numfeed(time())
end
------------------------
It does the same and super easy, thx zardOz
Downloads: 143 - Level ID: 16177