Untitled

mail@pastecode.io avatar
unknown
python
7 months ago
811 B
6
Indexable
Never
import pygame
import random
pygame.init()

screen = pygame.display.set_mode((960,540))
pygame.display.set_caption("Plane in the sky")

Clock = pygame.time.Clock()

running = True
while running:
    for event in pygame.event.get():
        if event.type == pygame.QUIT:
            running = False
        if pygame.mouse.get_pressed()[0]:
            pos = pygame.mouse.get_pos()
            pygame.draw.circle(screen, (255, 0, 0), [pos[0], pos[1]], 25)
        if pygame.mouse.get_pressed()[2]:
            pos = pygame.mouse.get_pos()
            pygame.draw.rect(screen, (0, 255, 0), (pos[0], pos[1], 50, 50))
        if pygame.mouse.get_pressed()[1]:
            screen = pygame.display.set_mode((960,540))

    pygame.display.update()

    Clock.tick(30)

pygame.quit()
quit()
Leave a Comment