Hello everyone. I started to use SDL libraries one day ago. Currently I'm making my first game and I'm desperately trying to move the ball (using z, x). I applied the same method that I've used for the 2 players (humans wannabe stick drawing) but the ball won't move. What am I doing wrong? Please help. Thanks in advance.
I've attached the game files + codeblocks project.
SDL Simple game - Ball won't move
The problem is on line 529
I noticed you have a class named Player and another class named Player2. To me it looks like these two classes work the same way so you could probably do fine with just one Player class.
apply_surface(388, 288, ball_sprite, screen);
You need to use ball.x and ball.y instead of fixed positions.I noticed you have a class named Player and another class named Player2. To me it looks like these two classes work the same way so you could probably do fine with just one Player class.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement