/ Published in: Python
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
ancho =500 alto =500 import random import pygame import sys from pygame.locals import * ventana = pygame.display.set_mode((ancho, alto)) pygame.display.set_caption("marcos game !") r =random.randint(0,255) g =random.randint(0,255) b =random.randint(0,255) ar = 5 iz = 5 al = 200 an = 200 for variable in range (50000): ar =ar+5 iz =iz+5 al =al-5 an =an-5 pygame.draw.rect(ventana,(r,g,b),(iz,ar,an,al)) pygame.display.flip() #bucle eventos while True: for event in pygame.event.get(): if event.type == QUIT: pygame.quit() sys.exit()