Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/python
- import sys
- import pygame
- import time
- blue = ( 36, 162, 202)
- def figure(screen,x,y):
- pygame.init()
- size=width, height = 700,550
- pared=ancho, alto = 50, 100
- screen=pygame.display.set_mode(size)
- speed=[15,15]
- lol=pygame.image.load("puddi.jpeg")
- lolrect=lol.get_rect()
- pygame.display.set_caption("Lawl")
- done=False
- clock=pygame.time.Clock()
- wall=pygame.image.load("puddi.jpeg")
- while done==False:
- for event in pygame.event.get():
- if event.type == pygame.QUIT:
- done=True
- #move = random.randrange(4)
- #time.sleep(1)
- #print move
- lolrect=lolrect.move(speed)
- if lolrect.left < 0 or lolrect.right > width:
- speed[0] = -speed[0]
- #INTENTO DE HACER LIMITES
- #if lolrect.left > 500 or lolrect.right < 300:
- #speed[0] = -speed[0]
- if lolrect.top < 0 or lolrect.bottom > height:
- speed[1] = -speed[1]
- #INTENTO DE HACER LIMITES
- #if lolrect.top > 300 or lolrect.bottom < 200:
- #speed[1] = -speed[1]
- screen.fill(blue)
- screen.blit(lol, lolrect)
- clock.tick(20)
- pygame.quit ()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement