#-*- coding: utf-8 -*-
import pygame,sys
from pygame.locals import *

pygame.init()
HORIZ = 800
VERT = 600
my_screen=pygame.display.set_mode((HORIZ,VERT),0,32)
pygame.display.set_caption('hello')

WHITE=(255,255,255)
PINK=(255,204,204)
color=WHITE
rec_col=PINK
my_screen.fill(color)

#image
img=pygame.image.load('city.jpg')
img=pygame.transform.scale(img,(650,450))
my_screen.blit(img,(50,50))
pygame.display.update()

#button
#btn=Button('btn1','Ready!',20,40,100,700)
#btn.draw(my_screen)
#pygame.display.update()

my_rect=pygame.Rect(110,530,300,40)
pygame.draw.rect(my_screen,rec_col,my_rect,0)
font = pygame.font.SysFont("monospace", 15)

label = font.render("Ready, give me the challenge!", 1, (0,0,0))
my_screen.blit(label,(114,533))
pygame.display.update()

while True:
	
	for ev in pygame.event.get():
		if ev.type==QUIT:
			pygame.quit()
			sys.exit()
		if ev.type == KEYDOWN:		
			if ev.key == K_ESCAPE:
				pygame.quit()
				sys.exit()

		if ev.type==pygame.MOUSEBUTTONDOWN:
			click=my_rect.collidepoint(pygame.mouse.get_pos())
			if click==1:
				my_screen=pygame.display.set_mode((HORIZ,VERT),0,32)
				pygame.display.set_caption('question')
				my_screen.fill(color)

				font = pygame.font.SysFont("monospace", 15)
				lbl = font.render("Whata  is the color of the second boat from left side?", 1, (0,0,0))
				my_screen.blit(lbl,(50,50))

				ans1=pygame.Rect(60,80,200,30)
				pygame.draw.rect(my_screen,rec_col,ans1,0)
				lbl1 = font.render("Green", 1, (0,0,0))
				my_screen.blit(lbl1,(65,80))

				ans2=pygame.Rect(60,150,200,30)
				pygame.draw.rect(my_screen,rec_col,ans2,0)
				lbl2 = font.render("Black", 1, (0,0,0))
				my_screen.blit(lbl2,(65,155))

				ans3=pygame.Rect(60,220,200,30)
				pygame.draw.rect(my_screen,rec_col,ans3,0)
				lbl3 = font.render("Orange", 1, (0,0,0))
				my_screen.blit(lbl3,(65,225))

				ans4=pygame.Rect(60,290,200,30)
				pygame.draw.rect(my_screen,rec_col,ans4,0)
				lbl4 = font.render("Blue", 1, (0,0,0))
				my_screen.blit(lbl4,(65,295))


				pygame.display.update()
				
			click1=ans1.collidepoint(pygame.mouse.get_pos())
			click2=ans2.collidepoint(pygame.mouse.get_pos())
			click3=ans3.collidepoint(pygame.mouse.get_pos())
			click4=ans4.collidepoint(pygame.mouse.get_pos())
			if click3==1:
				right=pygame.image.load('r.jpeg')
				my_screen.blit(right,(300,70))
				pygame.display.update()
			if click1==1:
				wrong=pygame.image.load('w.jpeg')
				my_screen.blit(wrong,(300,70))
				pygame.display.update()
							
			if click2==1:
				wrong=pygame.image.load('w.jpeg')
				my_screen.blit(wrong,(300,70))
				pygame.display.update()
			if click4==1:
				wrong=pygame.image.load('w.jpeg')
				my_screen.blit(wrong,(300,70))
				pygame.display.update()
				
my_scree.fill(rec_col,my_rect)	
pygame.display.update()

