hey guys how do i command a griffin rider to attack one of the robot things. im using python
Post your code or we can’t help
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
Iterate over the enemy and each loop, command the griffins to attack the enemy.
what say that more simpler please
It seems to me that you need to practice the mountain levels. Review them and post again
oh and chaboi i found a glitch in the game
PM me about that. Keep posts on topic please.
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…
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.
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.
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 @Chaboi_3000
what level is that DaPandaKing