# -*- coding: utf-8 -*-
import pygame
from pygame import K_ESCAPE
pygame.init()
#creacion de ventana
window = pygame.display.set_mode( (500, 400) ) #tamaño de la ventana
pygame.display.set_caption("Figuras y fondo, de colores") #sirve paraq poner titulo en la ventana que emerge
#color = (0,128,128) #definimos el color
window.fill(color= (0,128,128)) #la ventana agrara el valor del color
#figuras
pygame.draw.rect(window, (251, 0, 204), (100, 100, 100, 50), 2)
pygame.draw.ellipse(window, (251, 0, 204), (100, 100, 100, 50))
pygame.draw.rect(window, (56, 199, 0), (100, 150, 80, 40), 2)
pygame.draw.ellipse(window, (56, 199, 0), (100, 150, 80, 40))
pygame.draw.rect(window, (0, 154, 199), (100, 190, 60, 30), 2)
pygame.draw.ellipse(window, (0, 154, 199), (100, 190, 60, 30))
#Círculo
pygame.draw.ellipse(window, (255, 240, 0), (100, 250, 40, 40))
pygame.display.update()
#para poder terminar el evento o programa
while True:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
keyboard = pygame.key.get_pressed()
if keyboard[K_ESCAPE]:
exit()
Comentarios
Publicar un comentario