Aug-05-2019, 01:48 AM
You should read through my series of tutorials. You have bottlenecks (loading your images in the main game loop)
and magic numbers all over the place.
You are not using pygame rects for position and drawing at all making it spaghetti code. So its makes it more time consuming to follow flow, in which time i do not have.
Quote:win.blit(pygame.image.load('BG.png'),(0, 0))
and magic numbers all over the place.
Quote:#ball movement if x1 > 600: score1 += 1 x1 = 305 y1 = 245 xvel *= -1 yvel *= 1 if x1 < 0: score2 += 1 x1 = 305 y1 = 245 xvel *= -1 yvel *= 1 if y1 >= 490: yvel *= -1 if y1 <= 10: yvel *= -1 #paddle collison if x1 >= 560 and (y1 < yp1 +65 and y1 > yp1): x1 == 559 xvel *= -1 yvel *= 1 if x1 <= 25 and (y1 < yp2 +65 and y1 > yp2): x1 == 26 xvel *= -1 yvel *= 1
You are not using pygame rects for position and drawing at all making it spaghetti code. So its makes it more time consuming to follow flow, in which time i do not have.
Recommended Tutorials: