I am a beginner in Python and I am not clear about the function surface.blit(). What does it do? How does it works?
I have come across the following points as to how to create it.
Create a canvas of desired size
Create a surface of smaller size containing the object to be displayed.
Define the Rect value of the surface.
Blit (overlap) the surface on the canvas at the rect position
Syntax: canvas.blit(surface, surfacerect)
Why is only rect used? Can it be any other shape?
解决方案
Putting this in real terms may help, although as simply put as possible -> blitting is drawing
Going through each of the steps you have mentioned:
Create a canvas of a desired size
This is our window, created by screen = pygame.display.set_mode((width,height)). Where screen is the canvas name. Eventually everything will n