cuadrado con cuadrado


/ Published in: Python
Save to your folder(s)



Copy this code and paste it in your HTML
  1. ancho =500
  2. alto =500
  3. import random
  4. import pygame
  5. import sys
  6. from pygame.locals import *
  7. ventana = pygame.display.set_mode((ancho, alto))
  8. pygame.display.set_caption("marcos game !")
  9. r =random.randint(0,255)
  10. g =random.randint(0,255)
  11. b =random.randint(0,255)
  12.  
  13. ar = 5
  14. iz = 5
  15. al = 200
  16. an = 200
  17. for variable in range (50000):
  18. ar =ar+5
  19. iz =iz+5
  20. al =al-5
  21. an =an-5
  22. pygame.draw.rect(ventana,(r,g,b),(iz,ar,an,al))
  23. pygame.display.flip()
  24.  
  25. #bucle eventos
  26. while True:
  27. for event in pygame.event.get():
  28. if event.type == QUIT:
  29. pygame.quit()
  30. sys.exit()

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.