I am making a nice little space game to draw planets and such.
With the following code:
Code: Select all
--Draw all of our planets
love.graphics.push() -- Save Original
love.graphics.translate(cX-camX*zoomScale, cY+camY*zoomScale)
for k, v in pairs(univ.planets) do
local radScale = clamp(v.radius * zoomScale, 8, 180)
love.graphics.setColor( 198, 241, 255, 255 )
love.graphics.circle("fill", v.x * zoomScale, v.y * zoomScale, v.radius * zoomScale, radScale)
love.graphics.setColor( 255, 0, 0, 255 )
love.graphics.setLineWidth( 1 )
love.graphics.rectangle( "line", (v.x-v.radius)*zoomScale, (v.y-v.radius)*zoomScale, (v.radius*2)*zoomScale, (v.radius*2)*zoomScale )
--love.graphics.circle("line", v.x * zoomScale , v.y * zoomScale, math.max(3, (v.radius+10) * zoomScale),radScale)
end
love.graphics.pop() -- reload original