SDL BASIC

I started yesterday learning SDL so i am sorry if my source is bad or i have done stupid errors.

http://pastebin.com/6Lufhc8z

Here is my source.
The program run perfect,but when i click the buttons(right,up,left,down) to move the image(spongebob),the image is not moved,it is in the same place all the time.
Any help?


Look my source i hope help me.
One of the problems is that you are doing
1
2
dst.x=srcX;
dst.y=srcY;

when it should be
1
2
dst.x=dstX;
dst.y=dstY;

in the draw function.

With the parameters you pass to draw, that will only move the upper left corner of SpongeBob. If you want to move the whole SpongeBob you could simply use your apply function as
apply(dstX1,dstY1,bob,screen);
FANTASTIC FANTASTIC FANTASTIC FANTASTICFANTASTICFANTASTICFANTASTICFANTASTICFANTASTICFANTASTICFANTASTICFANTASTIC FANTASTIC FANTASTIC FANTASTIC FANTASTICFANTASTICFANTASTIC.



yOU ARE AMAZING.
thanks so much.


my skype is:
hepic.hepic

you coud add me there if wanna help me.
thanks.
btw, where is the best site to learn SDL?
I am learning from youtube.
search:SDL TUTORIALS
and will find many.
youtube is a bandwith-absorber, i need an article-based web or something like that (or something like this site... haha...)
chipp wrote:
btw, where is the best site to learn SDL?

I used http://lazyfoo.net/SDL_tutorials/index.php to start with. Beyond that, a Google search for answers to specific questions usually yields good results.
I second monad^^^. Lazyfoo is a GREAT place to learn SDL although there will be times, IMO, where you'd have to do some extensive research on your own.
thanks dude...
Topic archived. No new replies allowed.