import pygame
import random
import math
pygame.init()
win = pygame.display.set_mode((500,500))
pygame.display.set_caption("")
run = True
click = 1
while run:
for event in pygame.event.get():
if event.type == pygame.QUIT:
run = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(win, "image.jpg")
if event.type == pygame.MOUSEBUTTONDOWN:
if event.button == 1:
click = click + 1
if click == 2:
click = 1
pygame.draw.circle(win,(255,0,0), event.pos, 20)
pos = pygame.mouse.get_pos()
pygame.draw.circle(win,(255,0,0),pos, 1)
pygame.display.update()
pygame.quit()
|