#103853 - TheWopr - Sun Sep 24, 2006 11:56 pm
Alright here is my next problem, in my game i'm working on, its a tron/surround type of game. My problem is that it even at the slowest possible movement of the player, assuming that i'm using integers, is 1 pixel an update. With a screen thats 256 wide and 192 tall, at 60 fps, thats only 4.26 seconds the long way across and only 3.2 vertically. Anyone have any ideas on how to solve this? I was thinking of using a C++ equivalent of getCurrentTimeMillis() from Java to regulate it somehow, but i'm not really sure, feedback would be great. Thanks in advance
#103854 - kusma - Mon Sep 25, 2006 12:00 am
how about just fixed point position?
#103860 - TheWopr - Mon Sep 25, 2006 12:38 am
I did consider this, but i was thinking this might actually make it go too slow as a result. I don't have too much experience with this so, if anyone does can you let me know if this is a good solution?
#103861 - kusma - Mon Sep 25, 2006 12:44 am
TheWopr wrote: |
I did consider this, but i was thinking this might actually make it go too slow as a result. I don't have too much experience with this so, if anyone does can you let me know if this is a good solution? |
with fixed point, you can basically decide the speed much more acurately.
#103865 - TheWopr - Mon Sep 25, 2006 1:08 am
Alright changed to fixed point and its working much better, it's at a controllable speed and now i don't have to worry about drawing lines anymore because it never really goes more than 1 pixel at a time. Thanks kusma