This is for Jon and the gang.
With the
"half-width of Self" and
"half-height of Self" blocks, Stencyl pastes in
actor.getWidth()/2 and
actor.getHeight()/2 into the code, but doesn't put parenthesis around them. Most cases are ok except when used with another division where operator precedence gives the wrong answer. Here's some examples:
(5 * 5) / 2 = 12.5 (Precedence will force this to happen, luckily equalling the intended one)
5 * (5 / 2) = 12.5 (Intended precedence)
(5 / 5) / 2 = 0.5 (Precedence groups them left to right, so this is the answer given instead of the intended one)
5 / (5 / 2) = 2.0 (Intended precedence)
5 + (5 / 2) = 7.5 (Precedence will force this to match the intended one)
5 + (5 / 2) = 7.5 (Intended precedence)
5 - (5 / 2) = 2.5 (Precedence will force this to match the intended one)
5 - (5 / 2) = 2.5 (Intended precedence)
Operator precedence:
http://haxe.org/manual/operatorsSo, can Stencyl put parenthesis around them? ex: (actor.getWidth()/2)