Help: Levels in Glacier

Whst do you mean???w

You’ve put an if witch and friend.type == ā€œpaladinā€, but after that you run the code:
hero.command(friend, ā€œattackā€, enemy) without any else or elif. You need to put something in so that the paladin doesn’t always attack the enemy afterwards.

3 Likes

I get a bug when I do something like

so try to do is instead of == better safe than sorry :grinning:

So yeah, now I’ve destroyed both ogres, but paladin isn’t ā€œescapingā€. @milton.jinich or @Eric_Tang or @Falcons118 plz help?

# What eldritch artifacts are these? Don't let them blast you!
# The ice gate will open when both ogres are defeated.
points = 0
while True:
    flag = hero.findFlag("green")
    friends = hero.findFriends()
    enemy = hero.findNearestEnemy()
    for friend in friends:
        enemy = friend.findNearestEnemy()
        witch = hero.findNearest(hero.findByType("witch"))
        if witch:
            hero.command(friend, "attack", witch)
        elif enemy and enemy.type != "ice-yak":
            hero.command(friend, "attack", enemy)
        elif points == 0:
            hero.command(friend, "move", {'x': 26, 'y': 50})
        elif points == 1:
            hero.command(friend, "move", {'x': 54, 'y': 38})
            points += 1
        else:
            hero.command(friend, "move", {'x': 78, 'y': 40})
    if flag:
        hero.pickUpFlag(flag)

I’ve said it to you already try to use flags.

I don’t think it’ll work; the paladins not moving after defeating chieftain. Edit: never mind, I think I found the problem.

So can you send us a screenshot of what happens.

No, it will work, you do eg,

bflag = hero.findFlag("black")
if bflag:
#command your friends to move to flag pos in a for loop

I also did flags do something like

friends = hero.findFriends()
for friend in friends:
FlagB = hero.findFlag("black")
FlagG = hero.findFlag("green")
if FlagG:
      hero.command(friend, "move", FlagG.pos)
if FlagB:
    hero.command(friend, "move", FlagG.pos)

You need to define a lo of thing and command your hero but this is just a general structure.

you dont really need to use flags
I just commanded the pladin to move to the x and I passed the level

But if you forget your hero needs to move how do you defeat the witch(I chained lightninged them(of course)) and the chieftain. I think listen to what I have to say and what @Eric_Tang has to say.

I’m sending from gmail. is this working.

Yes it is now can you try to do what we say

@Eric_Tang trigonometry is an advanced math concept where you use triangles to find exact position of something. By having two points of the triangle, you can calculate the third point which is the object you’re trying to know the position of. I don’t know how to do trig, I just know the concept. :frowning: I’m just afraid you have to know trig to do glacier.

Yea, I know what trigonometry is, but you said it like trig and it confused me.

so do you need to know it in glacier?

Just nevermind.
20 cjarac

No, i seriously want to know if I need to know trig to do glacier.

For some levels, ex bombing run.

2 Likes

So since i don’t know trig yet, i can’t do glacier?

1 Like