How to do the level be quiet and don't rush

i cant get my hero to not die when all the bombs land in the same spot for the second time

# Dodge the cannons and collect 8 gems.
# Watch out, cannons are ready to fire!
# Move slow along a special pattern to confuse them.

# This function returns a value from 0 to 30 (0 <= n < 30)
def mod30(n):
    if n >= 30:
        return n - 30
    else:
        return n

# This function should return a value from 0 to 40 (0 <= n < 40)
def mod40(n):
    # Use an if-statement to return the correct value.
    
    return n

# You don't need to change the following code:
while True:
    time = hero.time
    gem = hero.findNearestItem()
    if time == 36.2:
        hero.moveXY(40, 56)
        hero.moveXY(45, 60)
        hero.moveXY(40, 56)
        hero.moveXY(45, 45)
    
   
    
    x = mod30(time) + 25
    y = mod40(time) + 10
    hero.moveXY(x, y)

Get rid of this

and you should be good.

ok…
i will try that

yeah you have everything else correct
do what @milton.jinich said.
that should work…

1 Like

if it doesn’t work equip soft leather boots(I know you have them).

umm i still die even without that and I need two more gems after I die too

and ?wha i am not using soft leather boots

Equip Soft Leather boots they should help you win.

1 Like

Then equip them they should do the job

1 Like

you mean lether boots i dont have soft lether boots

1 Like

he means this (I think)

2 Likes

wait nevermind i have them equiped

1 Like

send a screenshot then

2 Likes

1 Like

did it work now man(20 char)

1 Like

A screenshot of what happens

2 Likes

1 Like

wait I figured out the error
@logan_jordan do this

def mod40(n) 
    Use an if-statement to return the correct value.
    if n>=40:
      return n-40  
   
    else: 
      return n
    

2 Likes

Put this in the loop

1 Like

Refresh all your code, then look here, you have to do that in the mod40(n) area, except replace 30 with 40.

1 Like