This whole thread still seems way overcomplicated to me.
There were two questions at the start:
1. How to display the collision boxes, which was answered by the getRect method.
2. How to change the collision boxes, which was answered by the update method.
Bump internally stores rects as {left, top, width, height}, and not as {centerx, centery, halfwidth, halfheight} or whatever else.
Converting between those two representations is easy:
Code: Select all
function corner2center(l,t,w,h) return l+w/2, t+h/2, w/2, h/2 end
function center2corner(x,y,v,n) return x-v, y-n, v*2, n*2 end
But precisely because of that, it's pointless to overwrite the internal behaviour, in my opinion.
(The move method moves a collision box a set amount; moving is shape-definition-agnostic, i.e. it doesn't care how the rect is defined; moving a {-1,-1,2,2} and a {0,0,2,2} rect the same amount results in the same distance travelled.)