Siege of stonehold [HELP]


#1

Hello I am a but confused with this level. My character will not respond to any code I put in front of him.
As you can see in this screenshot I tried using flags to get him to respond but it still wont work…


I have even tried stuff as simple as hero.move(x, y);


#2

it should be

loop {


#3

You must first assign hero.findFlag to a variable. Perhaps write something like:

var flag = [insert findflag function]
if(hero.findFlag){
   [insert moveXY to flog]
   hero.pickUpflag( [insert variable's name]);
}

As for the rest of the level, it will take much more than moving to flags.


#4

You must also do

loop {
    var flag = hero.find flag()
    if flag {
            hero.pickUpFlag(flag)

#5

You should also attack enemies


#6

@CHECHA1232 *findFlag, not find flag.


#7

Oops, My computer messed up


#8

I am not great at javascript. Im more of a python coder:slight_smile:


#9

Still will not work. @_TD_RodYT @CHECHA1232


#10

I am only seeing why my character will not move. I am not trying to complete the whole level at the moment.


#11

Nooo. Listen carefully.

hero.findFlag is a FUNCTION. It means nothing.

You should use if (flag) instead because flag has already been assigned to a value when you called the findFlag function.


#12

You also must indent correctly


#13

OH stupid me, Thanks.


#14

Indent proper areas.


#15

I’m having a similar issue. I assigned a variable for flags:

flag = hero.findFlag()

Then used a loop for moving and picking it up:

while True:
    if flag:
        hero.moveXY(flag.pos.x, flag.pos.y)
        hero.pickUpFlag(flag)

But for some reason my hero will not move to the flag. Any thoughts?


#16

You can just pickUpFlag(flag) instead of having to move to it. Using this method, your hero automatically moves to it and picks it up. No move statement required :wink:
Also define flag in the loop.