jueves, 15 de octubre de 2015

De acuerdo: no era la imagen de un gato


#Mostrando la pantalla y la imagen asociada
import pygame,time
from pygame.locals import *

class Gato(pygame.sprite.Sprite):
    speed = 5
    bounce = 24
    images = []
    def __init__(self):
        pygame.sprite.Sprite.__init__(self,self.containers)
        self.image=self.images[0]
        self.rect = self.image.get_rect()

    def inf(self):
        print self.speed
        print self.bounce
        print self.images

def main():
    pygame.init()
    clock=pygame.time.Clock()
    disp=pygame.display.set_mode((400,400),0,32)
    background= pygame.Surface((400,400))
    img=pygame.image.load('./DataImgs/car.png')
    all = pygame.sprite.RenderUpdates()
    Gato.containers = all      
    Gato.images=[img]
    gato = Gato()
    gato.inf()
    disp.blit(img,(100,00))
    while True:
        for event in pygame.event.get():
            if event.type==QUIT:
                pygame.quit()
             
        all.clear(disp,background)
        all.update()
        dirty=all.draw(disp)
        pygame.display.update(dirty)
        clock.tick(40)
if __name__=='__main__': main()

No hay comentarios:

Publicar un comentario