forked from 20241144010013/20241144010013
Test Single Player
This commit is contained in:
parent
b62d22aa4c
commit
6387992312
|
@ -36,6 +36,7 @@ tiro_pos = {
|
||||||
"E3": (-200,0),
|
"E3": (-200,0),
|
||||||
"E4": (-200,-100),
|
"E4": (-200,-100),
|
||||||
"E5": (-200,-200),
|
"E5": (-200,-200),
|
||||||
|
"QUIT": (1000, 1000),
|
||||||
}
|
}
|
||||||
|
|
||||||
#funções
|
#funções
|
||||||
|
@ -90,17 +91,17 @@ if gmode == "single":
|
||||||
#Player 1
|
#Player 1
|
||||||
p1 = tl.Turtle()
|
p1 = tl.Turtle()
|
||||||
p1.up()
|
p1.up()
|
||||||
spawnp1 = str(input("Senhor, Onde Nosso Submarino Deve Ficar? "))
|
spawnp1 = "A1" #str(input("Senhor, Onde Nosso Submarino Deve Ficar? "))
|
||||||
p1.goto(tiro_pos[spawnp1])
|
p1.goto(tiro_pos[spawnp1])
|
||||||
|
|
||||||
p2 = tl.Turtle()
|
p2 = tl.Turtle()
|
||||||
p2.up()
|
p2.up()
|
||||||
spawnp2 = str(input("Senhor, Onde Nosso Crusador Deve Ficar? "))
|
spawnp2 = "A2" #str(input("Senhor, Onde Nosso Crusador Deve Ficar? "))
|
||||||
p2.goto(tiro_pos[spawnp2])
|
p2.goto(tiro_pos[spawnp2])
|
||||||
|
|
||||||
p3 = tl.Turtle()
|
p3 = tl.Turtle()
|
||||||
p3.up()
|
p3.up()
|
||||||
spawnp3 = str(input("Senhor, Onde Nosso Destroyer Deve Ficar? "))
|
spawnp3 = "A3" #str(input("Senhor, Onde Nosso Destroyer Deve Ficar? "))
|
||||||
p3.goto(tiro_pos[spawnp3])
|
p3.goto(tiro_pos[spawnp3])
|
||||||
#pass
|
#pass
|
||||||
|
|
||||||
|
@ -128,16 +129,10 @@ if gmode == "single":
|
||||||
if e2.pos() == e3.pos():
|
if e2.pos() == e3.pos():
|
||||||
e3.goto(random.choice(posx), random.choice(posy))
|
e3.goto(random.choice(posx), random.choice(posy))
|
||||||
#pass
|
#pass
|
||||||
#vencer
|
|
||||||
if win == True:
|
|
||||||
tl.Terminator()
|
|
||||||
|
|
||||||
|
|
||||||
while win == False:
|
while win == False:
|
||||||
tiro = tl.textinput("linha X do disparo","Em qual quadrante X devemos disparar a artilharia")
|
tiro = tl.textinput("Onde Devemos Disparar?","Em Qual Intersecão Devemos Disparar?\nDigite (quit) Para Sair").upper()
|
||||||
#vencer
|
while tiro not in tiro_pos:
|
||||||
if win == True:
|
tiro = tl.textinput("linha X do disparo","Em qual quadrante X devemos disparar a artilharia")
|
||||||
break
|
|
||||||
#acerto Submarino
|
#acerto Submarino
|
||||||
if (tiro_pos[tiro]) == e1.pos():
|
if (tiro_pos[tiro]) == e1.pos():
|
||||||
bullet.showturtle()
|
bullet.showturtle()
|
||||||
|
@ -169,12 +164,13 @@ if gmode == "single":
|
||||||
print("errou!")
|
print("errou!")
|
||||||
bullet.write("Erramos o alvo\n Capitão!",False,align="center")
|
bullet.write("Erramos o alvo\n Capitão!",False,align="center")
|
||||||
bullet.hideturtle()
|
bullet.hideturtle()
|
||||||
|
#vencer
|
||||||
#erro
|
if (e1.pos() == (-1000, -1000)) and (e2.pos() == (-1000, -1000)) and (e3.pos() == (-1000, -1000)):
|
||||||
if e1.pos() not in tiro_pos and e2.pos() not in tiro_pos and e3.pos() not in tiro_pos:
|
|
||||||
win = True
|
|
||||||
print("voçe ganhou")
|
print("voçe ganhou")
|
||||||
|
break
|
||||||
|
#sair
|
||||||
|
if bullet.pos() == (1000, 1000):
|
||||||
|
break
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue