Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #blue box
- import pygame
- import random
- #variable
- run = True
- #init pygame
- pygame.init()
- #screen
- screen = pygame.display.set_mode((800,600))
- #title
- pygame.display.set_caption("Blue sky")
- #game loop
- while run:
- #handle event
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- run = False
- quit()
- #colo screen
- screen.fill((135,206,235))
- #coordinates
- x = random.randint(10,790)
- y = random.randint(10,590)
- #radius
- r = random.randint(2,18)
- #draw circle
- pygame.draw.circle(screen, (0,0,150),(x,y),r)
- #update the screen
- pygame.display.flip()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement