my code-
while True:
skeleton = hero.findNearest(hero.findByType(‘skeleton’))
if skeleton:
hero.forcePush(skeleton, Vector(0, 1), 1)
Hi @mckong21, welcome to the Discourse! This is a friendly place to chat and ask for help on CodeCombat levels (remember to format your code correctly). Before you continue, don’t forget to read the guidelines here if you haven’t already.
We hope you enjoy your time here!
Could you please format your code correctly using the link above?
Thanks,
-Marmite
while True:
skeleton = hero.findNearest(hero.findByType(‘skeleton’))
if skeleton:
hero.forcePush(skeleton, Vector(0, 1), 1)
before you continue this is a bit off topic but plz put this in the level help category please
Thanks!
(sorry for the late response)
It appears your code isn’t indented properly, you need to press the tab key on your keyboard (or insert 4 spaces) before the code that’s supposed to be in the while
loop, and again before the code that’s supposed to be in the if
loop.
Hopefully this helps, just ping me @MarmiteOnToast if you need any further assistance on the level,
Thanks,
-Marmite
sorry but can u plz help me
Unfrotenly I haven’t played this level
MarmiteOnToast is saying that it should look like this:
while True:
skeleton = hero.findNearest(hero.findByType(‘skeleton’))
if skeleton:
hero.forcePush(skeleton, Vector(0, 1), 1)
See how you indent before you type after you say while True? Your code has to be indented properly in order for it to work.
I don’t know much after that because I haven’t played this level yet either
could u plz help me for some reason my hero keeps pushing all the skeletons into one cage
and my code-
while True:
skeleton = hero.findNearest(hero.findByType(‘skeleton’))
if skeleton:
hero.forcePush(skeleton, Vector(0, 1), 1)
can someone please respond ive been trying for 3 months noow and I still cant get it