Untitled

 avatar
Anindo
python
3 years ago
620 B
8
Indexable
# import
import pygame
import sys

pygame.init()

screen = pygame.display.set_mode((800, 600))  # display surface

pygame.display.set_caption('Drawing')

clock = pygame.time.Clock()
# set up the colors
black = (0, 0, 0)
white = (255, 255, 255)
red = (255, 0, 0)
green = (0, 255, 0)
blue = (0, 0, 255)

screen.fill(white)


# the main game loop
while True:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            pygame.quit()
            sys.exit()

    pygame.draw.line(screen, blue, (60, 60), (120, 60), 8)

    pygame.display.update()
    clock.tick(30)
Editor is loading...