Feedback: Library Tactics (Lua)


#1

Its very-crazy level))) I longely dont understand what i do wrong? In another attempt all it happened by itself. Level better confined to luck than to study …


#2

Why do you think so? My code wins on this level every time.


#3

Then I will try once again to start with a good code option.

Last variant which was victorious :

local angle = (3.14159265359 2 soldierIndex) / numSoldiers
local defendPos = {x= 41, y= 40}
defendPos.x = defendPos.x +7math.cos(angle)
defendPos.y = defendPos.y +7
math.sin(angle)
self:command(soldier, “defend”, defendPos)
if soldier.health<20 then
hero:command(soldier, “move”, {x= 41, y= 40})
end

but now writes cycle error


#4

One code - two result=)