On the https://warriorjs.com/ website : I was trying your game and I was faced with a problem that I can't solve.
I think it's not from my code but if it is (or anything else that I missed...), sorry for the inconvenience!
Steps to reproduce
Tick, Tick... Boom! campaign, level 2, test the following code. The specific lines that do not work are in the getClosestEnemyDirection function:
Here, when I remove the comments tag from the line
warrior.think(unitAtBlock.isBound());
I should see the returned value from the isBound method but I got an error saying that unitAtBlock is undefined (while just below - see Actual Behavior section - we can see that this object exists and contains functions.).
Environment
On the https://warriorjs.com/ website : I was trying your game and I was faced with a problem that I can't solve. I think it's not from my code but if it is (or anything else that I missed...), sorry for the inconvenience!
Steps to reproduce
Tick, Tick... Boom! campaign, level 2, test the following code. The specific lines that do not work are in the
getClosestEnemyDirection
function:Expected Behavior
Here, when I remove the comments tag from the line
I should see the returned value from the
isBound
method but I got an error saying thatunitAtBlock
is undefined (while just below - see Actual Behavior section - we can see that this object exists and contains functions.).The same thing happens when I try this :
Actual Behavior
unitAtBlock
Unit object is suddenly undefined and I can't access its functions.