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

Kelvintaph burgular helpss


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

1 Like

Post your code or we can’t help

1 Like
hero.moveXY(15, 22)
hero.moveXY(27, 6)
hero.moveXY(40, 22)
hero.moveXY(56, 23)
hero.buildXY("fence", 57, 19)
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

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

1 Like

what say that more simpler please


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

1 Like

oh and chaboi i found a glitch in the game

1 Like

PM me about that. Keep posts on topic please.

1 Like

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.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.costOf("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

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


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

1 Like

so do like for hero,command blah blah blah


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


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

1 Like

i did… this is one of my last levels


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


heh i used rob_anybodys code XD


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.


oof ok 20 carrrrrrrrrr

will do that :face_with_monocle::face_with_monocle: @Chaboi_3000


what level is that DaPandaKing