[NEW] Dialeg funcionant.

This commit is contained in:
2026-04-22 22:30:34 +02:00
parent a811ece34f
commit ea19c43865
4 changed files with 68 additions and 12 deletions

View File

@@ -4,11 +4,18 @@ local shine_pos = 0
local map_backup = {}
local actors_backup = {}
function distancia(a, b)
function distancia(a, b, hv)
local dx = (a.x-b.x)
local dy = (a.y-b.y)
local r = math.sqrt(dx*dx+dy*dy)
return r
local r = 0
if hv==nil then
r = math.sqrt(dx*dx+dy*dy)
elseif hv=="h" then
if math.abs(dy)<=16 then r=dx else r=999999 end
elseif hv=="v" then
if math.abs(dx)<=16 then r=dy else r=999999 end
end
return math.abs(r)
end
function in_table(tabla, valor)