我试图将空值传递给函数但失败了。这是我的设置;
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
我只想传递“种类”并希望构造函数处理其余部分。像;
local dog3 = dog.new("" ,"" , "bonus","" )
或者我只想通过“howFast”;
local dog3 = dog.new( , , , "faster")
我尝试了""
有无,给出了错误:
',' 附近出现意外符号