SDL Movement Failure.

closed account (N36fSL3A)
Hi I have a problem with SDL. I actually made a video, here it is : http://www.youtube.com/watch?v=vt3bD20PlQ8&feature=youtu.be

Alright. Once you watched the video, you will know what the problem is. Here is the source. If you can help me with the problem, that would be cool.
http://www.filedropper.com/power
It looks like when you press left/right etc you are increasing/decreasing both x and y. If you want to just go left for example you need to change x position but leave y as it was.
closed account (N36fSL3A)
I am only affecting the X.
I took a look at the source and didn't notice anything that would be causing the problem. As far as I can tell it looks like it should work.

However I didn't actually build/run/debug because I don't have SDL set up =( and am too lazy to get it. So I can't help you there.
Line 69 and 70 of Draw.cpp (the second overload of DrawGFX), you're setting both Dest.x and Dest.y to X2 ie:

1
2
Dest.x = X2;
Dest.y = X2;

should be
1
2
Dest.x = X2;
Dest.y = Y2;
Last edited on
closed account (N36fSL3A)
Stupid error number 1000000. *puts gun to head*
I love fixing other peoples bugs. <-Not sarcasm I actually get a smug faced kick out of it.
Last edited on
closed account (N36fSL3A)
Thanks. I made a working HUD and everything thanks to you.
Topic archived. No new replies allowed.