Posted By

AlfonsoSalinas on 07/07/10


Tagged


Versions (?)

python circle


 / Published in: ActionScript
 

  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. #Pintar circulo en la ventana
  19. xcentro=400
  20. ycentro=400
  21. radio=400
  22. linea=0
  23. for variable in range (80):
  24. r=random.randint(0,255)
  25. g=random.randint(0,255)
  26. b=random.randint(0,255)
  27. radio=radio-5
  28. pygame.draw.circle(ventana,[r,g,b],(xcentro,ycentro),radio,linea)
  29. pygame.display.flip()
  30.  
  31.  
  32.  
  33. while True:
  34. for event in pygame.event.get():
  35. if event.type==QUIT:
  36. pygame.quit()
  37. sys.exit()

Report this snippet  

You need to login to post a comment.