i’m kinda new to code combat but on this level i’m very confused on how to survive.
if the problem is that I don’t have enough armor or health then please let me know.
this is my code so far; (with all of the help things poping up this is what my code came too.)
loop:
if enemy:
enemy = self.findNearestEnemy()
self.attack(enemy)
if self.isReady("cleave")
self.cleave(enemy)
ok, I tried to run from the enemies and keep some distance away from them but, the munchkin ogres caught up to me quickly or the archers rapidly shot at me and took down tons of health.
this is the code I used;
please edit your code snippet post and put three backticks on a line before and after the code so that it indents the way you wrote it, so we can make sure it is indented properly.
```
loop:
enemy = …
```
will become: (assuming you have 4 spaces in front of enemy =… )
sounds like you aren’t fast enough to out run them, not armored enough to just run and let them beat on you occasionally, and not armed/armored enough to stand and fight.
I looked back at your first snippet and you need a “:” at the end of the isReady if and an indent in front of the cleave command to make it be inside the if. (you’ve already moved the enemy= in your later code)
loop:
enemy = self.findNearestEnemy()
if enemy:
self.attack(enemy)
if self.isReady("cleave"):
self.cleave(enemy)
otherwise it will always try to cleave.
It would also be better to ask the cleave question before the attack.
loop:
enemy = self.findNearestEnemy()
if enemy:
if self.isReady("cleave"):
self.cleave(enemy)
else:
self.attack(enemy)
try combining the two ideas “attack” and run" by adding the distance to check to the if enemy line and adding a move command to an else clause to that if (the: if enemy and self.distance…: )
so attack and run at the same time?
seems simple but what code would I use?
I still have no idea HOW to do the code, but know I know WHAT to do in the code.
i’ll try it out and give you the code afterwards.
until then, you don’t have to do (almost) anything.
P.S just a question but where are YOU in code combat? just want to know how far you are.
ok.
I tried it out and guess what?
I FAILED AGAIN!!!
this is the code I used, it’s a mixture of your example code and what I put in.
loop:
if enemy:
enemy = self.findNearestEnemy()
if self.isReady("cleave"):
self.cleave(enemy)
else:
self.attack(enemy)
self.distanceTo(enemy) >2
self.moveXY(60, 51)
if not enemy:
self.moveXY(85, 84)
it doesn’t work at all!
how did you win? can you at least give me some more advice?
i’m really confused on this level right now and for me there is no wat for me to beat it.
there are more levels I can move on to but they’re just as confusing… maybe even MORE confusing!
but this level is more HARD then confusing, but it being confusing makes it hard and even that is confusing!
my brain is in knots because of this level and I need serious help!
help.
for right now i’m going to try helping other people and their levels and maybe I can know/learn more about this and be able to defeat this level. so… just please help me with this level.
thx.
The idea is not running, but rather you have to fight the ogres intelligently.
First I tried to simply make a loop for finding enemies and killing them- didnt work.
The archers stay at a distance and the MC keeps targeting the melee ogres.
What I am currently trying to implement is putting the enemies into an array, then searching it for enemy.type = Thrower and then making the MC kill those as soon as they are detected.
loop {
var enemy = this.findNearestEnemy();
if (enemy) {
if (this.isReady("cleave")) {
this.cleave(enemy);
} else if (enemy) {
this.attack(enemy);
}
} else {
this.shield();
}
}
Hi kewlboy1212!
I am on Javascript. This is my code and it got me pas the first level. I am not really sure how to code python but possibly you could use the same principles I did just in Python mode. I had to buy a really expensive shield for this level, the engraved obsidian shield, so if you have the gems to buy that, definitely do that. So go ahead and tweak this to your heart’s content! Hope this helps!
Okay guys first things first dont use xy boots use the simple boots (up,down,left,right)
You dont have to fight anyone it give clear instructon to walk all the way to the end
the other warriors fight for you try it