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),
|
||||
"E4": (-200,-100),
|
||||
"E5": (-200,-200),
|
||||
"QUIT": (1000, 1000),
|
||||
}
|
||||
|
||||
#funções
|
||||
|
@ -90,17 +91,17 @@ if gmode == "single":
|
|||
#Player 1
|
||||
p1 = tl.Turtle()
|
||||
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])
|
||||
|
||||
p2 = tl.Turtle()
|
||||
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])
|
||||
|
||||
p3 = tl.Turtle()
|
||||
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])
|
||||
#pass
|
||||
|
||||
|
@ -127,17 +128,11 @@ if gmode == "single":
|
|||
e3.goto(random.choice(posx), random.choice(posy))
|
||||
if e2.pos() == e3.pos():
|
||||
e3.goto(random.choice(posx), random.choice(posy))
|
||||
#pass
|
||||
#vencer
|
||||
if win == True:
|
||||
tl.Terminator()
|
||||
|
||||
|
||||
#pass
|
||||
while win == False:
|
||||
tiro = tl.textinput("linha X do disparo","Em qual quadrante X devemos disparar a artilharia")
|
||||
#vencer
|
||||
if win == True:
|
||||
break
|
||||
tiro = tl.textinput("Onde Devemos Disparar?","Em Qual Intersecão Devemos Disparar?\nDigite (quit) Para Sair").upper()
|
||||
while tiro not in tiro_pos:
|
||||
tiro = tl.textinput("linha X do disparo","Em qual quadrante X devemos disparar a artilharia")
|
||||
#acerto Submarino
|
||||
if (tiro_pos[tiro]) == e1.pos():
|
||||
bullet.showturtle()
|
||||
|
@ -169,12 +164,13 @@ if gmode == "single":
|
|||
print("errou!")
|
||||
bullet.write("Erramos o alvo\n Capitão!",False,align="center")
|
||||
bullet.hideturtle()
|
||||
|
||||
#erro
|
||||
if e1.pos() not in tiro_pos and e2.pos() not in tiro_pos and e3.pos() not in tiro_pos:
|
||||
win = True
|
||||
#vencer
|
||||
if (e1.pos() == (-1000, -1000)) and (e2.pos() == (-1000, -1000)) and (e3.pos() == (-1000, -1000)):
|
||||
print("voçe ganhou")
|
||||
|
||||
break
|
||||
#sair
|
||||
if bullet.pos() == (1000, 1000):
|
||||
break
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue