0
for event in pygame.event.get():
インスタンスが2つあります。それは第二のものの中では機能しません。私は関数を2回呼び出すことはできないと思います。ここで何をすべきか?ところで、ボードゲームでは、これを正方形から正方形に移動する機能です。通常は動作しません前の呼び出しからのイベントを処理しながら、複数インスタンスのpygame.event.get()
def movement_one(blit1,charac1,screen,squareblitter,boardcoord,placecheck_True):
global mouse1, mouse1_des
run1=True
while run1:
for event in pygame.event.get():
if event.type == pygame.QUIT:
exit()
elif event.type == pygame.MOUSEBUTTONDOWN:
mouse1 = pygame.mouse.get_pos()
for i in range(80):
if squareblitter[i].collidepoint(mouse1):
collided = i
break
print "wow"
print i
print collided in placecheck_True
if collided in placecheck_True:
#checks if the square is occupied or not
print "wiw"
for event in pygame.event.get():
print "wtf"
if event.type == pygame.QUIT:
exit()
elif event.type == pygame.MOUSEBUTTONDOWN:
mouse1_des = pygame.mouse.get_pos()
print "omg"
squareblitter[i]
pygame.display.update()
for i in range(80):
if squareblitter[i].collidepoint(mouse1_des):
screen.blit(placecheck_True[collided], squareblitter[i])
placecheck_True.update[i]=placecheck_True[collided]
pygame.display.update()
run1=False
break
else:
break