import pygame
import random
from pygame.locals import *
from sys import exit
mouse_image_filename="ojizousan2.png"
pygame.init()
background_image_filename = 'j.jpg'
filename = 'ojizousan2.png'
filename2 = 'ohagi2.png'
screen = pygame.display.set_mode((640,480),0,32)
background = pygame.image.load(background_image_filename).convert()
ohagiconv = pygame.image.load(background_image_filename).convert()
mouse_cursor = pygame.image.load(mouse_image_filename).convert_alpha()
ohagi = pygame.image.load(filename2).convert_alpha()
xx = random.random()*480
yy = 0
x,y = 0, 0
move_x,move_y = 0, 0
mpos = pygame.mouse.get_pos()
dd = 1
ff = 1

while True:
    for event in pygame.event.get():
        if event.type == QUIT:
            exit()

    
    screen.blit(background, (0,0))
    mpos = pygame.mouse.get_pos()
    x, y = pygame.mouse.get_pos()
    x -= mouse_cursor.get_width() /2
    y -= mouse_cursor.get_height() /2
    
    botamoti = 2
    ohagi = 1
    #screen.fill((0,0,0))
    screen.blit(mouse_cursor,(x,y))
    yy = yy + 0.1
    
    print("deta")
    yy = 0
    xx = random.random()*600
        #if x > xx and y > yy and x +100 < xx + 100 and y + 100 < yy + 220: 
    #if xx > 20 and yy > 20:
        #if mpos[0] > 220 and mpos[1] > 100 and mpos[0] < 325 and mpos[1] < 130 and pygame.mouse.get_pressed()[0] == 1 :
    print(xx)
    print("test")
    print(mpos)
    font  = pygame.font.Font(None,33)
    text = font.render("SCORE",False,(0,0,0))
    
    jj = 22.4454
    ss = int(jj)
    print(ss)
    screen.blit(ohagi,(333,333) )
    screen.blit(text,(1,1)) 
    pygame.display.update()



