21 lines
419 B
Lua
21 lines
419 B
Lua
|
|
hex = {}
|
|
hex.centerX = 200
|
|
hex.centerY = 200
|
|
hex.size = 45
|
|
function love.draw()
|
|
love.graphics.setColor({255,255,255})
|
|
local lastX = nil
|
|
local lastY = nil
|
|
for i=0,6 do
|
|
local angle = 2 * math.pi / 6 * (i + 0.5)
|
|
local x = hex.centerX + hex.size * math.cos(angle)
|
|
local y = hex.centerY + hex.size * math.sin(angle)
|
|
if i > 0 then
|
|
love.graphics.line(lastX, lastY, x, y)
|
|
end
|
|
lastX = x
|
|
lastY = y
|
|
end
|
|
end
|