Page 2 of 2

Re: moving a polygon

Posted: Thu Feb 20, 2014 10:30 pm
by davisdude
Insert self-promotion here.
This will handle collisions for you, if you'd like.

Re: moving a polygon

Posted: Thu Feb 20, 2014 10:37 pm
by Azhukar
micha wrote:And you can even shorten your code and save one transformation. Replace these lines:

Code: Select all

love.graphics.translate(posX-cx*sx,posY-cy*sx) --first translate to position
love.graphics.scale(sx,sy)
love.graphics.translate(cx,cy) --rotate around center
by these:

Code: Select all

love.graphics.translate(posX,posY) --first translate to position
love.graphics.scale(sx,sy)
Neat, didn't notice that.