29 Jun PMCA Sunday 14:00 Python Homework 21.06.27.
Posted at 23:50h in Uncategorized 0 Comments
Similar to the code we did in the last class, draw the below pattern using pygame
In the above example, the radius of the circle is 40px. The height of the screen is 480px and the width of the screen is 640px. In your code, please select the appropriate radius so that the screen height and screen width are easily divisible by radius.
import pygame, sys, random pygame.init() screen_height = 480 screen_width = 640 screen=pygame.display.set_mode([screen_width, screen_height]) screen.fill([150,222,232]) pygame.draw.circle(screen, [200,100,80], [180,200], 100) pygame.display.flip() while True: for event in pygame.event.get(): if event.type == pygame.QUIT: pygame.quit() sys.exit()
Sorry, the comment form is closed at this time.