Circle
We can draw a circle using the following:
pygame.draw.circle(self.screen, (0,255,0), (400,300), 50)
The first parameter self.screen is the surface on which the circle will be drawn. In this case, it’s self.screen that represents the game window surface stored within the GameWindow class.
The second parameter (0, 255, 0) is the color of the circle specified as an RGB tuple. In this example, (0, 255, 0) represents green, as it has no red intensity (0), maximum green intensity (255), and no blue intensity (0).
The third parameter (400, 300) is the center position of the circle specified as (x, y). In this case, the circle’s center is positioned at (400, 300).
The fourth parameter ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access