Search code examples
pythonpygamespritesurface

Surfaces or Sprites in Pygame?


Good evening, I'm making a platformer and would like to know when you should use one of the both. For example for:

1)The player controlled character

2)The textured tiles that make up the level

3)The background

Should/Could you make everything with sprites ?

I just want to know how you would do it if you were to work on a pygame project.

I ask this because I see lots of pygame tutorials that explain adding textures by using surfaces but then in other tutorials, they use sprite objects instead.


Solution

  • Yes you could make everything including the background with sprites. It usually does not make sense for the background though (unless you;re doing layers of some form).

    The rest often make senses as sprite, but that depends on your situation.