My Hero is Running slowly but at the end he runs a short time to fast and every Cannon is shooting him away. I dont know how to solve that Problem
This is my Code:
def mod30(n):
if n >= 30:
return n - 30
else:
return n
def mod40(n):
if n >= 40:
return n
else:
return n
while True:
time = hero.time
x = mod30(time) + 25
y = mod40(time) + 10
hero.moveXY(x, y)
Hi @paddok, you haven’t quite formatted your code right.
Please put three ``` on two lines on your post, the make a line inbetween them and paste in your code directly from codecombat.
Thanks
Danny
The def mod30(n) is fine, but for the def mod40(n) just copy and paste the mod30(n) to where the mod40(n) should be and change all of the 30 to 40 in def mod40(n)
Lydia