Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import pygame
- from pygame.colordict import THECOLORS
- pygame.init()
- # Screen Size
- size = (700, 600)
- screen = pygame.display.set_mode(size)
- # Window Caption
- pygame.display.set_caption("Squares")
- # Background Color
- screen.fill(THECOLORS['ivory'])
- # Rectangles
- pygame.draw.rect(screen, THECOLORS['cornflowerblue'], (0, 0, 100, 100))
- pygame.draw.rect(screen, THECOLORS['seagreen2'], (600, 0, 100, 100))
- pygame.draw.rect(screen, THECOLORS['orangered1'], (0, 500, 100, 100))
- pygame.draw.rect(screen, THECOLORS['darkorchid2'], (600, 500, 100, 100))
- # Lines
- pygame.draw.line(screen, THECOLORS['maroon1'], (348, 0), (348, 600), 4)
- pygame.draw.line(screen, THECOLORS['deeppink1'], (0, 298), (700, 298), 4)
- # Center Circle
- pygame.draw.circle(screen, THECOLORS['yellow1'], (350, 300), 100)
- # Game Loop
- pygame.display.flip()
- clock = pygame.time.Clock()
- keepGoing = True
- while keepGoing:
- clock.tick(30)
- for ev in pygame.event.get():
- if ev.type == 12:
- keepGoing = False
- pygame.quit()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement