Watch out there! That code isn't good!!!
stevenp wrote:if(damage >= 0 || damage <= 5) { MoveTo("enemy", -10.000000, 0.000000, 999.000000, "enemy", "");}
if(damage >= 6 || damage <= 10) { MoveTo("enemy", -20.000000, 0.000000, 999.000000, "enemy", "");}
if(damage >= 11 || damage <= 16) { MoveTo("enemy", -30.000000, 0.000000, 999.000000, "enemy", "")}
Instead of || you should use &&.
Why? I'll try and make this clear.
What stevenp is teling your game there is:
If damage variable is greater/equal 0 OR the same variable's smaller than or equal 5 then etc...
If damage variable is greater/equal 6 OR the same variable's smaller than or equal 10 then etc...
If damage variable is greater/equal 10 OR the same variable's smaller than or equal 16 then etc...
ok, with && it won't be OR it'll be AND. Why is this good? The code will always do the third line last, so that's what you'll see.
afterall 0, 5, 10, 11 are all smaller than 16, and any number after that can be higher than 11...