[quote name='alvaro' timestamp='1326571040' post='4902740']
That is a bug. Perhaps you are using `int' in some place where you should be using `double'?
Nope. On second thought, I shouldn't have used "double" in the first place. Pixel manipulation don't need to use double, right? I'm using "int" variables to calculate the simple pathing in a one-dimensional array, so it wouldn't be wise to use a double as an array iterator.
I'll try to find my logic errors. I'm pretty sure calculating xVel and yVel are done at the same pace, and not calculating the results separately.
Or better yet, I will upload my source code
here, archived into ZIP, exported from Eclipse. (Hosted at Mediafire)
[/quote]
Tom, you'll screw yourself if you only use int. Just use doubles or else your calculations will never be very precise, and you'll miss badly. Often time, your pixel location during one step will be different from the previous step. For example, a velocity of 1.5, moving from 0,0 to 10,0:
Frame 1: x = 1.5 (draw at 1)
Frame 2: x = 3.0 (draw at 3)
Frame 3: x = 4.5 (draw at 4)
Frame 4: x = 6.0 (draw at 6)
Frame 5: x = 7.5 (draw at 7)
Frame 6: x = 9.0 (draw at 9)
Frame 7: x = 10.0 (draw at 10)
If you use int, then your velocity will be rounded down to 1, and it will take 10 frames when it should take 7.
Again, I prefer the trig method when doing this, but you can use which ever you want.
One other thing. There's obviously a bug in your code if you can't move diagonally. Each frame you should be able to change x and y location.