mianScene报错
local Snake = require "app.Snake"
local MainScene = class("MainScene", function()
return display.newScene("MainScene")
end)
local cMoveSpeed = 0.3
function MainScene:onEnter()
self.snake = Snake.new(self)
local tick = function()
self.snake:Update()
end
cc.Director:getInstance():getScheduler():scheduleScriptFunc(tick,cMoveSpeed,false)
end
function MainScene:onExit()
end
return MainScene
***********************************************************************************
一直报self.snake = Snake.new(self)有错
错误信息是attempt to index upvalue "Snake"(a boolean value)