The sprites are drawn by moving their center of rotation form top left to sprite center in the Sprite class draw method. However the sprites are not properly translated to their centers, consider the code used in Sprite class refreshMatrix method:
...
this.matrix.translate(p.x, p.y);
...
Should not it be like:
this.matrix.translate(p.x + p.w/2, p.y + p.h/2);
The sprites are drawn by moving their center of rotation form top left to sprite center in the Sprite class draw method. However the sprites are not properly translated to their centers, consider the code used in Sprite class refreshMatrix method: ... this.matrix.translate(p.x, p.y); ... Should not it be like: this.matrix.translate(p.x + p.w/2, p.y + p.h/2);