-
Notifications
You must be signed in to change notification settings - Fork 0
/
blip.lua
48 lines (41 loc) · 1.14 KB
/
blip.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
require 'constants'
function Blip(x, y, state, biome, slider, flag)
local blip = {
x = x,
y = y,
biome = biome,
state = state,
condition_slider = slider,
condition_flag = flag,
active = false,
}
function blip:draw()
if self.active == false then
return
end
love.graphics.setLineWidth(3)
love.graphics.setBlendMode('additive')
local alpha = 0xff * state.blipTimer
if alpha < 0 then alpha = 0 end
love.graphics.setColor({0, 0xff, 0, alpha/2})
love.graphics.circle('line', self.x*TW + TW/2, self.y*TH + TH/2, TW/4)
love.graphics.setColor({0, 0xff, 0, alpha})
love.graphics.circle('line', self.x*TW + TW/2, self.y*TH + TH/2, TW/8)
love.graphics.setColor({0xff, 0xff, 0xff, 0xff})
love.graphics.setBlendMode('alpha')
end
function blip:testConditions()
if self.condition_slider then
if(sliders[self.condition_slider.type] < self.condition_slider.amount) then
self.active = false
return
end
end
if self.condition_flag then
self.active = false
return
end
self.active = true
end
return blip
end