Search code examples
lualove2d

Lua requires a } to close a { that is already closed


This issue actually only appears if I a single more line to the "player" class.

Code:

function love.load()
player = {
    x = 0,
    y = 0,
    dky = character
    y_velocity = 0,
    jump_time = 1,
    jump_time_max = 1,
    character = love.graphics.newImage("gfx/character.png")
}
gravity = 400
jump_height = 300
winW, winH = love.graphics.getWidth(), love.graphics.getHeight()

end


Solution

  • You probably forgot to add a comma after

    character = love.graphics.newImage("gfx/character.png")

    when you added another line to player.

    The code you give already has this problem: a missing comma after dky = character.