I've tried to pass empty values to a function but failed. Here is my setup;
function gameBonus.new( x, y, kind, howFast ) -- constructor
local newgameBonus = {
x = x or 0,
y = y or 0,
kind = kind or "no kind",
howFast = howFast or "no speed"
}
return setmetatable( newgameBonus, gameBonus_mt )
end
I want only to pass "kind" and want the constructor to handle the rest. Like;
local dog3 = dog.new("" ,"" , "bonus","" )
Or I want only to pass "howFast";
local dog3 = dog.new( , , , "faster")
I tried both with ""
and without, gives error:
unexpected symbol near ','