Skip to content

Instantly share code, notes, and snippets.

@didicodethat
Created October 7, 2017 16:27
Show Gist options
  • Save didicodethat/de6e8e6877855ecf5b3bf36ba1664f20 to your computer and use it in GitHub Desktop.
Save didicodethat/de6e8e6877855ecf5b3bf36ba1664f20 to your computer and use it in GitHub Desktop.
return function(graphics, x, y, rx, ry, angle, size, distance)
local g = graphics
local i
local size = size or 1
local half = size/2
local distance = distance or 1
for i = 0, 15 do
g.origin()
g.translate(x, y - (i * distance) )
g.rotate(angle)
g.rectangle('fill', -half + rx, -half + ry, size, size)
g.origin()
end
end
local cube = require 'draw_cube'
local angle = 0
local distance = 1
local g = love.graphics
local w = g.getWidth()
local h = g.getHeight()
local x = w/2
local y = h/2
function love.draw()
drawCubeB()
drawCubeA()
end
function drawCubeA()
g.setColor(0x00, 0x00, 0xff)
cube(g, x, y, 30, 0, angle, 30, 1)
end
function drawCubeB()
g.setColor(0xff, 0xff, 0xff)
cube(g, x, y, 0, 0, angle, 30, 1 )
end
function love.update()
-- love.timer.sleep(0.1)
angle = angle + 0.07
-- distance = distance + 0.001
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment