config turnos

This commit is contained in:
Kaio Henrique Lopes Teixeira 2024-11-28 17:07:23 -03:00
parent 6387992312
commit 1e6459eece
1 changed files with 49 additions and 0 deletions

View File

@ -172,6 +172,53 @@ if gmode == "single":
if bullet.pos() == (1000, 1000):
break
#tiro inimigo
tiro_e = tl.Turtle()
tiro_e.hideturtle()
#acerto Submarino
if (tiro_pos[tiro_e]) == p1.pos():
bullet.showturtle()
bullet.goto(tiro_pos[tiro_e])
print("Acerto!")
bullet.write("U-boat Afundado\n Capitão!",False,align="center")
bullet.hideturtle()
e1.goto(-1000,-1000)
#acerto Crusador
elif (tiro_pos[tiro]) == p2.pos():
bullet.showturtle()
bullet.goto(tiro_pos[tiro])
print("Acerto!")
bullet.write("Crusador Afundado\n Capitão!",False,align="center")
bullet.hideturtle()
e2.goto(-1000,-1000)
#acerto Destroyer
elif(tiro_pos[tiro_e]) == p3.pos():
bullet.showturtle()
bullet.goto(tiro_pos[tiro_e])
print("Acerto!")
bullet.write("Destroyer Afundado\n Capitão!",False,align="center")
bullet.hideturtle()
e3.goto(-1000,-1000)
#erro
elif (tiro_pos[tiro_e]) != p1.pos() and (tiro_pos[tiro_e]) != p2.pos() and (tiro_pos[tiro_e]) != p3.pos():
bullet.showturtle()
bullet.goto(tiro_pos[tiro_e])
print("errou!")
bullet.write("Erramos o alvo\n Capitão!",False,align="center")
bullet.hideturtle()
#vencer
if (p1.pos() == (-1000, -1000)) and (p2.pos() == (-1000, -1000)) and (p3.pos() == (-1000, -1000)):
print("voçe ganhou")
break
#sair
if tiro_e.pos() == (1000, 1000):
break
@ -249,6 +296,8 @@ elif gmode == "multi":
continue
#partidas
#TELA DE VITORIA
#Execução
tl.mainloop()
tl.exitonclick()