Hobby Programmer Pygame

Tips

  • Pygame has over 400 built in colors. pygame.Color('string_name')
  • Python time.sleep in mainloop can cause flickering and make program unresponesive.
  • Have only one pygame.display.flip or pygame.display.update in program. Calling more than once per loop. Can cause flickering.
  • Remember to convert loaded images. For pygame doesn't have to do it every loop.
  • Use pygame.Rect and pygame.Vector2. They will save you alot of math work.
  • Use pygame.sprite.Sprites. They will save you alot of work. Once you learn framework.