- WIP: Interacció amb els actors
- Levels - Crec que no fa falta el segon layer
This commit is contained in:
@@ -60,6 +60,20 @@ actors={
|
||||
return false
|
||||
end,
|
||||
|
||||
interact=function(x,y,o)
|
||||
for i,actor in ipairs(actors.list) do
|
||||
if o=='d' then
|
||||
if actor.x==x and actor.y==y+1 then if actor.action then actor.action() end end
|
||||
elseif o=='u' then
|
||||
if actor.x==x and actor.y==y-1 then if actor.action then actor.action() end end
|
||||
elseif o=='l' then
|
||||
if actor.y==y and actor.x==x-2 then if actor.action then actor.action() end end
|
||||
elseif o=='r' then
|
||||
if actor.y==y and actor.x==x+2 then if actor.action then actor.action() end end
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
update=function()
|
||||
if actors.updating then return end
|
||||
actors.updating=true
|
||||
|
||||
Reference in New Issue
Block a user