Help?
Hi, i have a code, imports images, you can read it if you want: import os import pygame from pygame.locals import * pygame.init() WasItX = True Cells = ['', '', '', '', '', '', '', '', ''] screen = pygame.display.set_mode((600, 600),0,32) background = pygame.image.load("bg.png").convert_alpha() imgX = pygame.image.load("x.png").convert_alpha() imgO = pygame.image.load("o.png").convert_alpha() screen.blit(background, (0,0)) pygame.display.update() x, y =500, 300 def cellNum(x,y): if (x<200 and y<200): return 1 if (x>200 and x<400 and y<200): return 2 if (x>400 and y<200): return 3 if (x<200 and y>200 and y<400): return 4 if (x>200 and x<400 and y>200 and y<400): return 5 if (x>400 and x<600 and y>200 and y<400): return 6 if (x<200 and y>400): return 7 if (x>200 and x<400 and y>400 and y<600): return 8 if (x>400 and y>400): return 9 return 0 def getImg(): global WasItX if WasItX == True: WasItX = False return imgO else: WasItX = True return imgX def fillArray(cellNum): if WasItX == True: Cells[cellNum-1] = 'x' else: Cells[cellNum-1] = 'o' print(Cells) while True: for event in pygame.event.get(): if event.type == pygame.MOUSEBUTTONDOWN: x, y = pygame.mouse.get_pos() print(x, y) if cellNum(x,y)==1: screen.blit(getImg(), (0, 0)) pygame.display.update() fillArray(1) elif cellNum(x, y)==2: screen.blit(getImg(), (200, 0)) pygame.display.update() fillArray(2) elif cellNum(x, y)==3: screen.blit(getImg(), (400, 0)) pygame.display