lordmauve / pgzero

A zero-boilerplate games programming framework for Python 3, based on Pygame.
https://pygame-zero.readthedocs.io/
GNU Lesser General Public License v3.0
527 stars 191 forks source link

pygame to pygame zero transition with classes #282

Closed ghost closed 2 years ago

ghost commented 2 years ago

Hi

I'm an autistc girl trying to make games. I first learned python and used pygame. Then i made 2 example games i found on youtube: pong and snake Both were made using classes.

I didn't know about pygame zero and I now want to use this. But i'm having some problems to understand how i can uses classes with pygame zero. Am i supposed to use actors inside my classes as member variables? And what about the draw and update function? How to use that in combination with my classes? For exzmple the snake game had a snake and apple class which each have a draw function (for pygame) that called pygame draw functions

. Is it maybe possible to give an example of the game snake programmed in pygame zero with 2 classes 'snake' and 'apple' so I can see how to do this in combination with actors (and also the draw and update function)? That would help me a lot! I don't find any example that's using classes.

I hope you understand me!

Ps: I also have sent an email so you can answer there maybe? I used the email found on your website when clicking on your name.

Thx Greetings from London, UK Jessica

ghost commented 2 years ago

I found somebody wanting to help me. I closed the issue.