I try to do a quite simple class object with no success.
I have this error :
attempt to index local ‘ball’ (a userdata value)
when clicking on ball
My main.lua :
local util = "utilities" local myBall = util.doBall()
My utilities.lua is :
local M = {} -- M.somevars are OK -- M.somefunctions are OK M.doBall = function ( ) local ball = display.newCircle ( 0, 0, 100 ) local function mask:tap( event ) self:removeEventListener( 'tap' ) self:removeSelf() end ball:addEventListener("tap") return ball end return M