    
import pygame
from pygame.locals import *
from sys import exit
def main():
    pygame.init()
    screen = pygame.display.set_mode((640,480))
    while True:
        for event in pygame.event.get():
            print(event)
            if event.type == QUIT:
                exit()
            if event.type == KEYDOWN:
                exit() 

        screen.fill((25,25,0))
        sprite_image_filename3= 'ojizousan3.png'
        pressed_mouse = pygame.mouse.get_pressed()
    #sprite = pygame.image.load(sprite_image_filename3)
    #sprite = pygame.image.load(sprite_image_filename3).convert_alpha()
        #text = font.render('kasajizou1', False, (55,255,255))
        #screen.blit(text,(220,50))
        #text = font.render('kasajizou2',  False, (55,255,255))
        font = pygame.font.Font(None, 32)
        text = font.render('kasajizou1', False, (55,255,255))
        screen.blit(text,(220,100))
        text = font.render('kasajizou2', False, (55,255,255))
        screen.blit(text,(220,150))
        text = font.render('jizoumove', False, (55,255,255))
        screen.blit(text,(233,200))
        text = font.render('Quit', False, (55,255,255))
        screen.blit(text,(233,250))
        #pygame.mouse.set_visible(False)
        #pygame.event.set_grab(True)
        rotation_direction = pygame.mouse.get_rel()[0] / 5.
        mpos = pygame.mouse.get_pos()
        print(mpos)
        pygame.display.update()
        if mpos[0] > 400:
            a()
        #pygame.draw.rect(screen, (255,0,0), Rect(10,10,300,200))
def a():
    #!/usr/bin/env python
	# -*-coding:utf8-*-
	background_image_filename = 'j.jpg'
	sprite_image_filename= 'ojizousan3.png'
	sprite_image_filename4 = 'ojizousan4.png'
	sprite_image_filename5 = 'empty.png'
	sprite_image_filename6 = 'ojizousan4.png'
	sprite_image_filename3= 'ojizousan3.png'
	
	a = 0
	b = 0
	c = 0
	
	
	
	background = pygame.image.load(background_image_filename).convert()
	sprite = pygame.image.load(sprite_image_filename3).convert_alpha()
	sprite2 = pygame.image.load(sprite_image_filename4).convert_alpha()
	sprite3 = pygame.image.load(sprite_image_filename5).convert_alpha()
	sprite4 = pygame.image.load(sprite_image_filename6).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:
                   menu()
	        if event.type == KEYDOWN:
                    exit()

        screen = pygame.display.set_mode((640,480))
        screen.blit(background,(0,0))
        screen.blit(sprite,(s,150))
        screen.blit(sprite,(s-120,150))
        screen.blit(sprite,(s-220,150))
        screen.blit(sprite,(s-320,150))
        screen.blit(sprite,(s-420,150))
        screen.blit(sprite4,(s-520,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()
	
	        
	
def b():	    
	#!/usr/bin/env python
	# -*-coding:utf8-*-
	background_image_filename = 'j.jpg'
	#sprite_image_filename= 'ojizousan3.png'
	sprite_image_filename3= 'ojizousan3.png'
	sprite_image_filename4 = 'ojizousan4.png'
	sprite_image_filename5 = 'empty.png'
	sprite_image_filename6 = 'ojizousan4.png'
	
	a = 0
	b = 0
	c = 0
	#jjimport pygame
	#from pygame.locals import *
	#from sys import exit
	
	pygame.init()
	
	screen = pygame.display.set_mode((640,480),0,32)
	
	background = pygame.image.load(background_image_filename).convert()
	sprite = pygame.image.load(sprite_image_filename3).convert_alpha()
	sprite2 = pygame.image.load(sprite_image_filename4).convert_alpha()
	sprite3 = pygame.image.load(sprite_image_filename5).convert_alpha()
	sprite4 = pygame.image.load(sprite_image_filename6).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:
	            exit()
	        if event.type == KEYDOWN:
	            exit()
	    screen.blit(background,(0,0))
	    screen.blit(sprite,(s,150))
	    screen.blit(sprite,(s-120,150))
	    screen.blit(sprite,(s-220,150))
	    screen.blit(sprite,(s-320,150))
	    screen.blit(sprite,(s-420,150))
	    screen.blit(sprite4,(s-520,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()
	
	        
	
def c():
	#!/usr/bin/env python
	# -*-coding:utf8-*-
	background_image_filename = 'j.jpg'
	#sprite_image_filename= 'ojizousan3.png'
	sprite_image_filename3= 'ojizousan3.png'
	sprite_image_filename4 = 'ojizousan4.png'
	sprite_image_filename5 = 'empty.png'
	sprite_image_filename6 = 'ojizousan4.png'
	
	a = 0
	b = 0
	c = 0
	#import pygame
	#from pygame.locals import 
	#from sys import exit
	
	
	screen = pygame.display.set_mode((640,480),0,32)
	
	background = pygame.image.load(background_image_filename).convert()
	sprite = pygame.image.load(sprite_image_filename3).convert_alpha()
	sprite2 = pygame.image.load(sprite_image_filename4).convert_alpha()
	sprite3 = pygame.image.load(sprite_image_filename5).convert_alpha()
	sprite4 = pygame.image.load(sprite_image_filename6).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:
                     exit()
                 if event.type == KEYDOWN:
                     exit()

	    screen.blit(background,(0,0))
	    screen.blit(sprite,(s,150))
	    screen.blit(sprite,(s-120,150))
	    screen.blit(sprite,(s-220,150))
	    screen.blit(sprite,(s-320,150))
	    screen.blit(sprite,(s-420,150))
	    screen.blit(sprite4,(s-520,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()
	
	        
	
main()
