Code: Select all
entdata = {1,0,6,3}
-- a is the room number, b and c are the x and y coordinates for the next room, d is the direction (3 is right)
local a,b,c,d = entdata[transport][1],entdata[transport][2],entdata[transport][3],entdata[transport][4]
tempd = d
loadMap(a,b,c,d) -- i use local variables because the entdata table is cleared upon loading the next room
-- later in the code --
autoMove(3) -- works
-- v.s. --
autoMove(tempd) -- doesn't work
-- autoMove function --
function autoMove(dire)
moving = true
pl.d = dire
if pl.d == 0 then
sprY = 51
elseif pl.d == 1 then
sprY = 102
elseif pl.d == 2 then
sprY = 0
elseif pl.d == 3 then
sprY = 153
end
end
i went ahead and attached a .love file if what i provided isn't enough information for you