[NEW] Moguts els dialegs a trigger per event

This commit is contained in:
2026-04-26 19:57:53 +02:00
parent ca4169f2f1
commit 90fd942d84
4 changed files with 68 additions and 64 deletions

View File

@@ -2,29 +2,29 @@ dialeg={
list = {},
}
dialegs = {}
-- dialegs = {}
function dialeg.update()
for i,d in ipairs(dialegs) do
if distancia(d.actor1, d.actor2, d.direccio)<=d.distancia and d.enabled then
dialeg.new(d.text, d.actor1)
d.enabled=false
end
end
end
-- function dialeg.update()
-- for i,d in ipairs(dialegs) do
-- if distancia(d.actor1, d.actor2, d.direccio)<=d.distancia and d.enabled then
-- dialeg.new(d.text, d.actor1)
-- d.enabled=false
-- end
-- end
-- end
function dialeg.new( _text, _actor )
print(_text)
table.insert(
dialeg.list,
{
actor= _actor,
text=_text,
time = 120,
w = math.floor(4.6*#_text),
h = 20,
} )
end
-- function dialeg.new( _text, _actor )
-- print(_text)
-- table.insert(
-- dialeg.list,
-- {
-- actor= _actor,
-- text=_text,
-- time = 120,
-- w = math.floor(4.6*#_text),
-- h = 20,
-- } )
-- end
function dialeg.draw( )
local i = 1