Pygame from start 1

Spread the love

Here is a new series of tutorials for pygame starting from the very skratch.

Index of Pygame First Game

Let’s show a simple sprite here.

We first:

  • define a class that create a Surface object (a little piece of rectangle) and we colour it
  • then we create a group from pygame.sprite.Group class to hold all the images or surfaces (1 for now)
  • then we create an istance of Player called player and we add it to group
  • then we draw the group on the surface

The result will be this little square that you can see into this picture below. Nothing fancy, but it all starts from here. Now you are ready to go to the next step: displaying an image and also animate it. That is why we used group.

 

Video

Pygame's Platform Game

Other Pygame's posts