math.randomseed(os.time())
c = require("radarchart")
function love.load()
love.graphics.setColor(0,255,255)
love.graphics.setFont(love.graphics.newFont(24))
local pokedata = {} for i = 1,math.random(3,10) do table.insert(pokedata,{
label="Test "..i, value=math.random()}) end
poke = c.new( pokedata )
pokedraw = { x=love.graphics.getWidth()/2, y=love.graphics.getHeight()/2, radius=math.random(200,280) }
poke:setTicks(math.random(1,10)) poke:setRadianOffset(0)
local rcolor
rcolor = random_color()
rcolor[4] = 127 poke:setColor("integral",rcolor)
if math.random(0,1) ==1 then rcolor = random_color()
rcolor[4] = 62 poke:setDrawMode("ticks","fill")
poke:setColor("htick",rcolor) end
end
function random_color()
local n,x = 63,255
return {math.random(n,x),math.random(n,x),math.random(n,x)}end
function love.draw()
poke:draw(pokedraw.x,pokedraw.y,pokedraw.radius) love.graphics.print(love.timer.getFPS(),16,16)
end
function love.update(dt)
for i,v in pairs( poke:getData() ) do
v.value = v.value + 0.1*dt
if v.value > 1 then
v.value = v.value - 1
end
end
poke:setRadianOffset( poke:getRadianOffset() + dt*0.25 )
end
function love.keypressed()
love.load()
end