Jump to content
  • Advertisement
Sign in to follow this  

Moving Things(SDL_C)

This topic is 2773 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Since my English is not the best and I couldn't find answer to my question, I decided to write about this. I would like to create a simple game where you can move footballer and kick or move football.
Recently I encountered a problem with moving a football It looks like this:
I would be greatfull for any help in this, I can walk with my footballer with arrows up, down, left, right.
I had ideas with if( ) but it didn't work ><. Basically If footballer would be in left and I will go on right the footbal should move on right side etc with other sides.
Oh I wrote it in C with help of SDL and SDL_Image.
Thank you in advance, for any help. smile.gif

Share this post

Link to post
Share on other sites
You have the footballer moving, yes? Can you not use similar code to move the football?

What part are you having trouble with:

  • When to move the football?
  • Where to move the football
  • Something else?

    If your code is reasonably small you could post it here too.

Share this post

Link to post
Share on other sites
It's the code http://pastie.org/pr...zgrjd1ffsikppaw
Hope you will understand unsure.gif. This code is totally unefficient - it waste a lot of memory but right now I'm working on mechanic of game, later I'll polish it blink.gif.
Yes I can move my footballer, but It's not that easy with football because I want to move the football with my footballer - for example if right side of my footballer "square" will touch left side of the football "square" it should move football by one point to the right. :P " [ S1 ] touches [ S2 ] from left side = [ S2 ] moved to the right by one "
Implementation of this is a big trouble for me right now, because of complex of condition.
Thank you for response :).

Share this post

Link to post
Share on other sites
Sign in to follow this  

  • Advertisement

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

GameDev.net is your game development community. Create an account for your GameDev Portfolio and participate in the largest developer community in the games industry.

Sign me up!