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