I'm very new to Lua so its possible that I am just doing something wrong, but I am getting the following error:
pellet.lua:13: field 'fillCircleAtPoint' is not callable (a nil value)
stack traceback:
pellet.lua:13: in method 'render'
main.lua:26: in function <main.lua:22>
for the following file:
local geometry = playdate.geometry
local gfx = playdate.graphics
function makePellet(type, xPos, yPos)
local pellet = {
type = type,
position = geometry.point.new(xPos, yPos),
radius = 10
}
function pellet:render()
setDrawStyleFor(type)
gfx.fillCircleAtPoint(self.position, self.radius)
end
return pellet
end
which, based on Inside Playdate, should be a valid function call (unless I am doing something wrong, which I might be)
I'm curious why this method requires importing the library and gfx.fillEllipseInRect(self.position.x, self.position.y, self.diameter, self.diameter) does not though