Advertisement

SDL Simple game - Ball won't move

Started by August 07, 2011 09:24 PM
0 comments, last by Wooh 13 years, 6 months ago
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.
The problem is on line 529
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