

import pygame 
from pygame.locals import *
from sys import exit
import random
import datetime
import time
def jizouanime():
    #!/usr/bin/env python
    # -*-coding:utf8-*-
    #background_image_filename = 'j.jpg'
    sprite_image_filename= 'o.png'
    sprite_image_filename4 = 'Balotteli.png'
    sprite_image_filename5 = 'empty.png'
    
    a = 0
    b = 0
    c = 0
    
    
    
    #background = pygame.image.load(background_image_filename).convert()
    pygame.init()
    screen = pygame.display.set_mode((640,480))



    sprite = pygame.image.load(sprite_image_filename).convert_alpha()
    #sprite5 = pygame.image.load(sprite_image_filename).convert_alpha()
    #sprite6 = pygame.image.load(sprite_image_filename).convert_alpha()
    clock = pygame.time.Clock()
    
    x = 0.
    i = 0.
    l = 0
    s = 0
    speed = 51.
    while True:
        for event in pygame.event.get():
            if event.type == QUIT:
                    main()
            if event.type == KEYDOWN:
                    main()

        screen.blit(sprite,(s,150))
        time_passed = clock.tick()
        time_passed_seconds = time_passed / 1000.0

        distance_moved = time_passed_seconds * speed
        s += distance_moved
        #screen.blit(sprite3,(s,150))
        #print str(x) + "x"
        #print "time_passed" + str(time_passed )
        #print distance_moved
        #print str(s) + "s"
        #print x
        #if s > 120:
        #   screen.blit(sprite2,(x-s,150))
            
        #x+= 1 
      
        if s > 1240.:
          s = 0.
        pygame.display.update()
    
            
    
jizouanime()
