Hello,
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:
http://imageshack.us/photo/my-images/38/beztytuuijw.png/
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.
Moving Things(SDL_C)
You have the footballer moving, yes? Can you not use similar code to move the football?
What part are you having trouble with:
If your code is reasonably small you could post it here too.
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.
It's the code http://pastie.org/pr...zgrjd1ffsikppaw
Hope you will understand . 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 .
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. " [ 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 .
Hope you will understand . 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 .
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. " [ 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 .
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement