Heres my image. I'm trying to get the image to rotate towards the middle of the screen no matter where it comes from.
I already have the ships moving towards the earth and calculate the angle from whatever coords they spawn at using
Code: Select all
local angle = math.atan2((Earth.Y + Earth.Height / 2)- (RaidGroup[i][4] + 32 / 2), (Earth.X + Earth.Width / 2)- (RaidGroup[i][3] + 32 / 2))
I then plug that into
Code: Select all
love.graphics.draw()
Code: Select all
for i = 1,#RaidGroup do
love.graphics.draw(Aliens.FrigateImages[1], RaidGroup[i][3], RaidGroup[i][4], RaidGroup[i][8], 1, 1, 32/2, 32/2)
end
However, without adding
Code: Select all
angle = angle + math.rad(136)