does anyone know how to run two if statements at the same time in python?
for i in range(160):
luca.speed = 1
if luca.pos() > nick.pos() and luca.pos() > bob.pos():
luca.backward(luca.speed + 2)
if luca.pos() < nick.pos() and luca.pos() < bob.pos():
luca.forward(luca.speed + 3)
nick.speed = 1
if luca.pos() > nick.pos() and bob.pos() > nick.pos():
nick.forward(nick.speed + 8.5)
if luca.pos() < nick.pos() and bob.pos() < nick.pos():
nick.forward(nick.speed)
I am trying to make these 4 if statements run at the same time instead of one after the other.
Aucun commentaire:
Enregistrer un commentaire