Advertisement
richigarza

puddi.py

Sep 13th, 2012
2,427
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 1.18 KB | None | 0 0
  1. #!/usr/bin/python
  2. import sys  
  3. import pygame
  4. import time
  5.  
  6. blue = ( 36, 162, 202)
  7.  
  8. def figure(screen,x,y):
  9. pygame.init()
  10.    
  11. size=width, height = 700,550
  12. pared=ancho, alto = 50, 100
  13. screen=pygame.display.set_mode(size)
  14. speed=[15,15]
  15. lol=pygame.image.load("puddi.jpeg")
  16. lolrect=lol.get_rect()
  17.  
  18.  
  19. pygame.display.set_caption("Lawl")
  20. done=False
  21. clock=pygame.time.Clock()
  22. wall=pygame.image.load("puddi.jpeg")
  23.  
  24. while done==False:
  25.     for event in pygame.event.get():
  26.         if event.type == pygame.QUIT:
  27.             done=True
  28.        
  29.         #move = random.randrange(4)
  30.         #time.sleep(1)
  31.         #print move
  32.  
  33.     lolrect=lolrect.move(speed)
  34.     if lolrect.left < 0 or lolrect.right > width:
  35.         speed[0] = -speed[0]
  36.        
  37.     #INTENTO DE HACER LIMITES
  38.     #if lolrect.left > 500 or lolrect.right < 300:
  39.         #speed[0] = -speed[0]
  40.        
  41.     if lolrect.top < 0 or lolrect.bottom > height:
  42.         speed[1] = -speed[1]
  43.            
  44.     #INTENTO DE HACER LIMITES
  45.     #if lolrect.top > 300 or lolrect.bottom < 200:
  46.         #speed[1] = -speed[1]
  47.        
  48.  
  49.     screen.fill(blue)
  50.     screen.blit(lol, lolrect)
  51.     clock.tick(20)
  52.      
  53. pygame.quit ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement