Thursday, October 19, 2023

Pygame 4

 Updated my code with Codemy pygame #4.



Couldn't resist asking for a female hero character. It was done with Bing Draw; a 

nice image, but too lithe for the job ‽

                                                                   


Aux choses sérieuses; getting clear on the code:

There are two code novelties here. The first is that pygame will automatically

configure a rectangle around our player images with the get_rect() function.

All subsequent interaction of our character with the environment will be with

the boundaries of its rectangle.
                                                                              

The second feature is the blit() function. Without it, nothing shows up on the screen.

But it's once and for al!!! Once our character is thus in the game, one won't need to

call draw at every turn...





No comments: