more stuff wipped
This commit is contained in:
12
ideas.txt
Normal file
12
ideas.txt
Normal file
@@ -0,0 +1,12 @@
|
||||
1-4 on first dial, main dial
|
||||
5-8 on second dial
|
||||
|
||||
1 Time orange
|
||||
2 Ammo red
|
||||
3 Fuel yellow
|
||||
4 Supplies blue ?
|
||||
|
||||
5 Water teal ?
|
||||
6 Food green
|
||||
7 Metal silver
|
||||
8 Ore brown
|
@@ -73,6 +73,8 @@ local function drawClock(x, y, r)
|
||||
lg.setColor(255, 255, 255)
|
||||
end
|
||||
|
||||
local drawWheel = require "wheel";
|
||||
|
||||
function love.draw()
|
||||
lg.translate(hx, hy)
|
||||
|
||||
@@ -86,7 +88,8 @@ function love.draw()
|
||||
lg.setColor(255, 255, 255)
|
||||
end
|
||||
|
||||
drawClock(-355, -145, 120)
|
||||
--drawClock(-355, -145, 120)
|
||||
drawWheel(-355, -145, 120, timer)
|
||||
end
|
||||
|
||||
function love.keypressed(key, unicode)
|
||||
|
42
src/wheel.lua
Normal file
42
src/wheel.lua
Normal file
@@ -0,0 +1,42 @@
|
||||
local verticalOffset = math.pi/2
|
||||
local maxTime = 60
|
||||
|
||||
local segments = 60
|
||||
local segmentRadius = math.pi*2 / segments
|
||||
|
||||
local dividerRadius = segmentRadius / 2
|
||||
|
||||
local lg = love.graphics
|
||||
|
||||
local function drawWheel(x, y, r, time)
|
||||
time = math.floor(33 - time)
|
||||
if time == 0 then time = 33 end
|
||||
|
||||
lg.setColor(255, 102, 0)
|
||||
for i=1,time do
|
||||
lg.arc("fill", x, y, r, (i-1)*segmentRadius - verticalOffset, i*segmentRadius - dividerRadius - verticalOffset)
|
||||
end
|
||||
lg.setColor(0, 0, 0)
|
||||
lg.circle("fill", x, y, r/1.15)
|
||||
|
||||
-- this looks cool and all, but it is the same function as the outer ring
|
||||
-- instead, use this internal space for displaying things like fuel and water and supplies
|
||||
--[[
|
||||
segments = 12
|
||||
segmentRadius = math.pi*2 / segments
|
||||
dividerRadius = segmentRadius / segments * 2
|
||||
time = math.floor(time/maxTime * segments) --33 -> 12 percentage = time/maxTime..multiply this by 12
|
||||
|
||||
lg.setColor(255, 102, 0)
|
||||
for i=1,time do
|
||||
lg.arc("fill", x, y, r/1.5, (i-1)*segmentRadius - verticalOffset, i*segmentRadius - dividerRadius - verticalOffset)
|
||||
end
|
||||
lg.setColor(0, 0, 0)
|
||||
lg.circle("fill", x, y, r/2)
|
||||
--]]
|
||||
|
||||
--tmp, really each color-dependent section should do this itself!
|
||||
lg.setColor(255, 255, 255)
|
||||
end
|
||||
|
||||
return drawWheel
|
Reference in New Issue
Block a user