Posted By

AlfonsoSalinas on 07/07/10


Tagged


Versions (?)

python


 / Published in: Delphi
 

  1. import pygame
  2. import sys
  3. from pygame.locals import *
  4. import random
  5.  
  6. izquierda=0
  7. arriba=0
  8. ancho=0
  9. alto=0
  10.  
  11. pygame.init()
  12.  
  13. ancho=800
  14. alto=800
  15. ventana = pygame.display.set_mode((ancho, alto))
  16. pygame.display.set_caption("mola")
  17.  
  18. for variable in range(80):
  19. izquierda=izquierda+5
  20. arriba=arriba+5
  21. ancho=ancho-10
  22. alto=alto-10
  23. r=random.randint(20,255)
  24. g=random.randint(20,255)
  25. b=random.randint(1,255)
  26. pygame.draw.rect(ventana,[r,g,b],(izquierda, arriba, ancho, alto))
  27. pygame.display.flip()
  28.  
  29.  
  30.  
  31. while True:
  32. for event in pygame.event.get():
  33. if event.type==QUIT:
  34. pygame.quit()
  35. sys.exit()

Report this snippet  

You need to login to post a comment.