heli wrote:It inreases until 10, then it set back to 0, and count 1 more for the next number.
If you compare it to itoa :
itoa does all numbers all the time,
my function dont, it is possible, when the score is 9999999999999999999, it will take compute all the characters for 1 point increase, just like itoa does all the time, only itoa cant handle this big scores.
+ if it take all characters it is still faster.
Seems like a pain to deal with, but you do you. Of course itoa has limitations, but there's nothing wrong with it if it fits the bill. If the extra couple hundred cycles (again, exaggeration for making the point) are the breaking point between running full speed and not, there's something seriously slow elsewhere that's more worthwhile to optimize.
heli wrote:You always need to keep your frames the same speed, without peaks,
you better waste some time on things all the time then more slowdown for 1 frame.
So i was thinking, i could try if i could compute only 1 number per frame, and increase the rest when no scoring is done, maybe it will slowdown things per frame, the slowest frame will be almost equal to the fastest frame.
So I take it you don't know about the concept of a frame limiter or something then. Spending more or less time per frame doesn't matter as long as your total time in the frame is less than a frame's length, because your frame beginning and ending is quantized to the frame rate. If you had to make sure every frame's code lasted the same exact length to avoid slowdown or speedups, I don't think modern software could ever exist.
heli wrote:So you are saying you using all sine cosine and other math functions to make a game for a 1999 PC ?
How do you aim the tanks ?, with atanf function ?
It's for a handheld console, not PC. As a result, I don't have these math library functions anyways, but they're not that different. Yes I use arctangent for aiming, but yes I wrote my own implementation. Because I need to, because my platform only lets me run 50 thousand cycles per frame.