for example, this
player =
{
walkL = loadimage("walk.png"),
kickL = loadimage("kick.png"),
punchL = loadimage("punch.png"),
walkR = fliphorizontal(player.walkL),
kickR = fliphorizontal(player.kickL),
punchR = fliphorizontal(player.punchL),
}
fails with
game.lua:16: attempt to index global 'player' (a nil value)
but this
player ={}
player.walkL = loadimage("walk.png")
player.kickL = loadimage("kick.png")
player.punchL = loadimage("punch.png")
player.walkR = fliphorizontal(player.walkL)
player.kickR = fliphorizontal(player.kickL)
player.punchR = fliphorizontal(player.punchL)
works fine
weird