import pygame
import random
import math
WIDTH = 500
HEIGHT = 500
pygame.init()
screen = pygame.display.set_mode((WIDTH, HEIGHT))
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if event.type == pygame.KEYDOWN:
if event.key == pygame.K_RETURN:
pygame.image.save(screen, "image.jpg")
screen.fill((0, 0, 0))
pygame.draw.line(screen, (255, 255, 255), [250, 0], [250, 500], 5)
for i in range(0,10):
pygame.draw.line(screen, (255, 255, 255), [250, 50+i*100], [200, 150+i*100], 5)
pygame.draw.line(screen, (255, 255, 255), [250, 50+i*100], [300, 150+i*100], 5)
pygame.display.flip()
pygame.quit()
|