The error says i'm missing a } but i'm closing the {}. I'm coding a 2D game using Lua and TIC-80. I've been trying to solve this issue but I don't have any ideia of what is the problem here. Can anyone please help me? The error says that the problem is in the "inferiorRight" object and that I'm not closing the '{'
function tryToMoveTo(myDisplacementY)
superiorLeft = {
x = player.x - 8,
y = player.y - 8 - 1
}
superiorRight = {
x = player.x + 4,
y = player.y - 8 - 1
}
inferiorRight = {
x = player.x + 7,
y = player.y + 7,
player.y = player.y + 7 + myDisplacementY
}
inferiorLeft = {
x = player.x - 8,
y = player.y + 7 + myDisplacementY
}
if collidesWithMap(inferiorRight) or
collidesWithMap(inferiorLeft) or
collidesWithMap(superiorRight) or
collidesWithMap(superiorRight) then
-- collides
else
player.y = player.y + myDisplacementY
end
end
function update()
-- up
if btn(0) then
tryToMoveTo(-1)
end
-- down
if btn(1) then
tryToMoveTo(1)
end
-- left
if btn(2) then
player.x = player.x - 1
end
-- right
if btn(3) then
player.x = player.x + 1
end
end
player.y = player.y + 7 + myDisplacementY- Mike V.