I have a single GameManager
created in the main.lua
.
local pd <const> = playdate
local gfx <const> = pd.graphics
GameManager()
function pd.update()
gfx.clear()
gfx.sprite.update()
end
I think it's being garbage collected as I invoke garbagecollection()
when the menu screen closes and levels finish and, when I do, I get this error:
Update error: main.lua:16: Sprite doesn't have a lua proxy!
stack traceback:
[C]: in field 'update'
main.lua:16: in function <main.lua:14>
I'm assuming that this is due to GC, and that it's telling me that the GameManager
isn't there anymore.