Code: Select all
local cubes = {}
for i = 1, 20 do
local c = {}
c.x = math.random(0,800)
c.y = math.random(0,600)
c.z = math.random(0,255)
tinsert(cubes, c)
end
function love.draw()
for i = 1, #cubes do
love.graphics.setColor(255,255,255,255-cubes[i].z)
love.graphics.rectangle("fill", cubes[i].x, cubes[i].y,10,10)
end
end
I'm guessing i need to add in a camera object and then work out the angles from there, but i'm not really sure how to do it.
Has anyone got a link to a decent tutorial on this kind of thing?