Mar-15-2017, 04:22 PM
1) First of all include your images so we can run your program without tinkering with your code.
2) 99999/100000 times when you call out a bug in the language, its really you created the bug in your code, not a language bug
3) Using global keywords is notorious for bugs to creep in your code
4) use classes more. You have classes but the majority of the meat is outside of them.
5) Your over complicating the rect process
pygame.Rect also has collision detection to identify a collision with another pygame.Rect which you should be using, but are not.
Here is our tutorial in which demonstrates how to use rects
https://python-forum.io/Thread-PyGame-Ba...ing-part-3
2) 99999/100000 times when you call out a bug in the language, its really you created the bug in your code, not a language bug
3) Using global keywords is notorious for bugs to creep in your code
4) use classes more. You have classes but the majority of the meat is outside of them.
5) Your over complicating the rect process
Quote: screen.blit(self.image, Rect(self.x, self.y, self.width, self.height))pygame.Rect has x,y,width, and height attributes, and more. You are just making things redundant by not using them properly. As well as introducing possible bugs into your program. All the getters and setters are not needed as as you are just recreating the wheel by not using Rects to their full potential.
pygame.Rect also has collision detection to identify a collision with another pygame.Rect which you should be using, but are not.
Here is our tutorial in which demonstrates how to use rects
https://python-forum.io/Thread-PyGame-Ba...ing-part-3
Recommended Tutorials: