|
|
|
@ -81,14 +81,54 @@ def print_text(WIN,font,x,y,text,fcolor=WHITE):
|
|
|
|
|
WIN.blit(imgText,(x,y))
|
|
|
|
|
|
|
|
|
|
######################################
|
|
|
|
|
def draw_left_animals(l_elephant,l_eagle,l_wolf,l_lion,l_leopard,l_mouse,l_fox):
|
|
|
|
|
WIN.blit(L_elephant,(l_elephant.x,l_elephant.y))
|
|
|
|
|
WIN.blit(L_eagle, (l_eagle.x, l_eagle.y))
|
|
|
|
|
WIN.blit(L_wolf, (l_wolf.x, l_wolf.y))
|
|
|
|
|
WIN.blit(L_lion, (l_lion.x, l_lion.y))
|
|
|
|
|
WIN.blit(L_leopard, (l_leopard.x, l_leopard.y))
|
|
|
|
|
WIN.blit(L_mouse, (l_mouse.x, l_mouse.y))
|
|
|
|
|
WIN.blit(L_fox, (l_fox.x, l_fox.y))
|
|
|
|
|
|
|
|
|
|
def draw_window(fox):
|
|
|
|
|
def draw_right_animals(r_elephant,r_eagle,r_wolf,r_lion,r_leopard,r_mouse,r_fox):
|
|
|
|
|
WIN.blit(R_elephant, (r_elephant.x, r_elephant.y))
|
|
|
|
|
WIN.blit(R_eagle, (r_eagle.x, r_eagle.y))
|
|
|
|
|
WIN.blit(R_wolf, (r_wolf.x,r_wolf.y))
|
|
|
|
|
WIN.blit(R_lion, (r_lion.x, r_lion.y))
|
|
|
|
|
WIN.blit(R_leopard, (r_leopard.x, r_leopard.y))
|
|
|
|
|
WIN.blit(R_mouse, (r_mouse.x, r_mouse.y))
|
|
|
|
|
WIN.blit(R_fox, (r_fox.x, r_fox.y))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def draw_window(l_elephant,l_eagle,l_wolf,l_lion,l_leopard,l_mouse,l_fox,r_elephant,r_eagle,r_wolf,r_lion,r_leopard,r_mouse,r_fox):
|
|
|
|
|
WIN.blit(SPACE,(0,0))
|
|
|
|
|
WIN.blit(L_fox,(fox.x,fox.y))
|
|
|
|
|
draw_left_animals(l_elephant,l_eagle,l_wolf,l_lion,l_leopard,l_mouse,l_fox)
|
|
|
|
|
draw_right_animals(r_elephant,r_eagle,r_wolf,r_lion,r_leopard,r_mouse,r_fox)
|
|
|
|
|
#WIN.blit(L_fox,(fox.x,fox.y))
|
|
|
|
|
pygame.display.update()
|
|
|
|
|
|
|
|
|
|
def main():
|
|
|
|
|
fox = pygame.Rect(155,130,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
|
|
|
|
|
#animals rect
|
|
|
|
|
l_elephant = pygame.Rect(281,10,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
l_eagle = pygame.Rect(157,120,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
l_wolf = pygame.Rect(284,229,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
l_lion = pygame.Rect(292,343,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
l_leopard = pygame.Rect(285,450,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
l_mouse = pygame.Rect(285,665,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
l_fox = pygame.Rect(157,557,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
|
|
|
|
|
r_elephant = pygame.Rect(795,673,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
r_eagle = pygame.Rect(925,570,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
r_wolf = pygame.Rect(803,458,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
r_lion = pygame.Rect(802,347,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
r_leopard = pygame.Rect(796,232,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
r_fox = pygame.Rect(920,123,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
r_mouse = pygame.Rect(793,16,CHESSSIZE_Y,CHESSSIZE_Y)
|
|
|
|
|
#############################################
|
|
|
|
|
run = True
|
|
|
|
|
clock = pygame.time.Clock()
|
|
|
|
|
font1 = pygame.font.SysFont('kaiti',40)
|
|
|
|
@ -99,12 +139,13 @@ def main():
|
|
|
|
|
if event.type == pygame.QUIT:
|
|
|
|
|
run = False
|
|
|
|
|
elif event.type == pygame.MOUSEBUTTONDOWN:
|
|
|
|
|
b1, b2, b3 = pygame.mouse.get_pressed()
|
|
|
|
|
if b1 and not b3:
|
|
|
|
|
mouse_x , mouse_y= event.pos
|
|
|
|
|
x = int(mouse_x / WIDTH * 9) + 1
|
|
|
|
|
y = int(mouse_y / HEIGHT * 7) + 1
|
|
|
|
|
b1,b2,b3 = pygame.mouse.get_pressed()
|
|
|
|
|
print(mouse_x,mouse_y)
|
|
|
|
|
if status == 1:
|
|
|
|
|
'''if status == 1:
|
|
|
|
|
if mouse_x >=800:
|
|
|
|
|
fox.x = int((x-1) / 9 * WIDTH) - 10
|
|
|
|
|
fox.y = int((y-1) / 7 * HEIGHT)
|
|
|
|
@ -118,12 +159,12 @@ def main():
|
|
|
|
|
fox.y -= 15
|
|
|
|
|
status = 0
|
|
|
|
|
else :
|
|
|
|
|
status = 1
|
|
|
|
|
status = 1'''
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#fox.x+=1
|
|
|
|
|
draw_window(fox)
|
|
|
|
|
draw_window(l_elephant,l_eagle,l_wolf,l_lion,l_leopard,l_mouse,l_fox,r_elephant,r_eagle,r_wolf,r_lion,r_leopard,r_mouse,r_fox)
|
|
|
|
|
pygame.quit()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|