blob: cf811302ef9eeeb9eef2b5e828c37cc0d6bf41f2 (
plain)
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
|
register_comp("Speck_System", function(ent)
ent.speck_sys = Speck_Sys.new()
end)
function speck_update_sys(ent, dt)
ent.speck_sys.x = ent.x
ent.speck_sys.y = ent.y
ent.speck_sys:update(dt)
end
function speck_draw_sys(ent)
ent.speck_sys:draw()
end
function new_speck_entity(x, y, filepath)
local ent = new_entity()
add_comp(ent, "Position", x, y)
add_comp(ent, "Speck_System")
ent.speck_sys = load_speck_sys(filepath)
ent.speck_sys.oneshot = true
add_comp(ent, "Speck_Entity")
end
register_comp("Speck_Entity", TAGCOMP)
function speck_entity_system(ent, dt)
local sys = ent.speck_sys
if not sys.emitting and sys:is_empty() then
queue_entity_kill(ent)
end
end
|