При клике должны изменятся лист и словарь, не изменяются
remainUnits = {'yellow':0, 'red':0, 'blue':0, 'green':0, }
gameList = [[[yellowPlayerPlaceImg, 6], [redPlayerPlaceImg, 6], [greenPlayerPlaceImg, 6], [bluePlayerPlaceImg, 6]], \
[[yellowPlayerPlaceImg, 6], [redPlayerPlaceImg, 6], [greenPlayerPlaceImg, 6], [bluePlayerPlaceImg, 6]], \
[[yellowPlayerPlaceImg, 6], [redPlayerPlaceImg, 6], [greenPlayerPlaceImg, 6], [bluePlayerPlaceImg, 6]], \
[[yellowPlayerPlaceImg, 6], [redPlayerPlaceImg, 6], [greenPlayerPlaceImg, 6], [bluePlayerPlaceImg, 6]]]
def placeClick(remainUnits, gameList):
events = pygame.event.get()
for event in events:
if event.type == pygame.MOUSEBUTTONDOWN:
for rect in range(0,len(placeCoords)):
for place in placeCoords[rect]:
if mouseX >= place[0] and mouseX <= place[0] + placeWidth and \
mouseY >= place[1] and mouseY <= place[1] + placeHeight:
checked = checking()
if gameList[rect][place][0] == checked:
if remainUnits[turn] != 0:
remainUnits[turn] -= 1
gameList[rect][place][1] += 1
return remainUnits, gameList