kittykatattack / ga

The world's tiniest, cutest and funnest game engine
451 stars 85 forks source link

Incorporating pivotX, pivotY, scaleX and scaleY. #25

Closed qsrahman closed 9 years ago

qsrahman commented 9 years ago

Although I have tested the change but still there may be some side effects. also the hitTestRectangle in plugins.js will need to be changed to: ``javascript if(global) { vx = (r1.worldX + r1.halfWidth) - (r2.worldX + r2.halfWidth); vy = (r1.worldY + r1.halfHeight) - (r2.worldY + r2.halfHeight); vx = (r1.worldX + (r1._width * r1.pivotX) + (1 - 2 * r1.pivotX) * r1.halfWidth) - (r2.worldX + (r2._width * r2.pivotX) + (1 - 2 * r2.pivotX) * r2.halfWidth); vy = (r1.worldY + (r1._height * r1.pivotY) + (1 - 2 * r1.pivotY) * r1.halfHeight) - (r2.worldY + (r2._height * r2.pivotY) + (1 - 2 * r2.pivotY) * r2.halfHeight); } else { vx = r1.centerX - r2.centerX; vy = r1.centerY - r2.centerY; }

kittykatattack commented 9 years ago

Thanks! I will run some test on this and get back to you! :)