Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

Kelvintaph burgular helpss

#1

hey guys how do i command a griffin rider to attack one of the robot things. im using python

1 Like
#2

Post your code or we can’t help

1 Like
#3
hero.moveXY(15, 22)
hero.wait(3)
hero.moveXY(27, 6)
hero.moveXY(40, 22)
hero.moveXY(56, 23)
hero.buildXY("fence", 57, 19)
hero.summon("griffin-rider")
enemies = hero.findByType("robot-walker")
           

i need help on making the griffin attack the robot and help on making the humans get to the end

1 Like
#4

Iterate over the enemy and each loop, command the griffins to attack the enemy.

1 Like
#5

what say that more simpler please

#6

It seems to me that you need to practice the mountain levels. Review them and post again

1 Like
#7

oh and chaboi i found a glitch in the game

1 Like
#8

PM me about that. Keep posts on topic please.

1 Like
#9

Help on making the griffin attack the robot. Not a successful solution because robots spawn randomly
Something like that ( you write the same yourself in python):

hero.moveXY(15, 22);
hero.wait(3);
hero.moveXY(27, 6);
hero.moveXY(40, 22);
hero.moveXY(56, 23);
hero.buildXY("fence", 57, 19);

while (true){
    var enemies = hero.findByType("robot-walker"),
        griffins = hero.findByType("griffin-rider"),
        len = griffins.length;    
    if ( hero.gold >= hero.costOf("griffin-rider")) 
        hero.summon("griffin-rider");
    for (var i = -1; ++i < len;)
       hero.command(griffins[i], 'attack', enemies[0]); 
}


The first robot got accidentally killed by friendly fire. The clever part in your code is the robots aim but cannot kill flying creatures and I didn’t know that. The hero can escape unnoticed…

1 Like
#13

thx (20 charactersss)

wait how do i do the for (var i = -1; ++i < len;)
hero.command(griffins[i], ‘attack’, enemies[0]);
}
part in python

what did i do wrong

#14

You are trying to command a whole list/array of griffins. Use for loops to iterate over each griffin.

1 Like
#15

so do like for hero,command blah blah blah

#16

or do for i in -1 -i < len:

#17

Do the mountain levels and you’ll understand how to do this.

1 Like
#18

i did… this is one of my last levels

#19

Try reviewing it again. You might have forgotten some important concepts.

#20

heh i used rob_anybodys code XD

#21

By doing that, you are basically learning nothing, and you are not trying to solve it on your own. Do the mountain levels on your own without cheating and post again.

#23

oof ok 20 carrrrrrrrrr

will do that :face_with_monocle::face_with_monocle: @Chaboi_3000

#24

what level is that DaPandaKing