Rename can_talk_to to can_trigger
This commit is contained in:
parent
053de00c3c
commit
531cc5de4f
|
@ -24,7 +24,7 @@ A puzzle game, for the PICO-8.
|
|||
|
||||
`change_map(n)` - purely descriptive function, sets `mapn` to `n`
|
||||
|
||||
`can_talk_to(tx,ty,tf)` - checks if there is a trigger in front of the player, assuming `x=tx,y=ty,f=tf`.
|
||||
`can_trigger(tx,ty,tf)` - checks if there is a trigger in front of the player, assuming `x=tx,y=ty,f=tf`.
|
||||
|
||||
`activate(tx,ty,tf)` - activates the trigger in front of the player, assuming `x=tx,y=ty,f=tf`.
|
||||
|
||||
|
|
4
main.lua
4
main.lua
|
@ -36,7 +36,7 @@ function change_map(n)
|
|||
if mapdata[n].onload then mapdata[n].onload(mapdata[n]) end
|
||||
end
|
||||
|
||||
function can_talk_to(tx,ty,tf)
|
||||
function can_trigger(tx,ty,tf)
|
||||
tx = tx+(tf==2 and 8 or (tf==3 and -8 or 0))
|
||||
ty = ty+(tf==1 and 8 or (tf==0 and -8 or 0))
|
||||
t = mapdata[mapn].triggers
|
||||
|
@ -133,7 +133,7 @@ function _update()
|
|||
textbox.open = false
|
||||
textbox.cb()
|
||||
else
|
||||
if can_talk_to(x,y,f) then
|
||||
if can_trigger(x,y,f) then
|
||||
activate(x,y,f)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue