第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

MainScene里用定時(shí)器時(shí)一直報(bào)attempt to call method 'Update' (a nil value) stack traceback:

我的cocos2dx版本是3.1.0、VS2013的,與老師的定時(shí)器寫(xiě)法一樣的,也調(diào)試了多次,當(dāng)運(yùn)行截圖的注釋部分時(shí)蛇是可以移動(dòng)的,就是用定時(shí)器就訪問(wèn)不了update了,這個(gè)怎么解決???困了我兩天http://img1.sycdn.imooc.com//5f016a010001155316120365.jpg

MainScene.lua代碼:

local MainScene = class("MainScene", cc.load("mvc").ViewBase)

local Snake = require "app.views.Snake";

--MainScene.RESOURCE_FILENAME = "MainScene.csb"


local cMoveSpeen = 0.3;

function MainScene:onEnter()

? ? self.snake = Snake.new(self)

? ? --self.snake:Update()

? ? --self.snake:Update()

? ? --self.snake:Update()

? ? --self.snake:Update()

? ? local tick = function()

? ? ? ?self.snake:Update()

? ? end;

? ? cc.Director:getInstance():getScheduler():scheduleScriptFunc(tick,cMoveSpeen,false);

end

return MainScene


Snake.lua代碼:

local Snake = class("Snake",cc.load("mvc").ViewBase);

local Body = require "app.views.Body";


local cInitLen = 3;

function Snake:ctor(node)

? ? self.BodyArray = {}

? ? self.node = node

? ? self.MoveDir = "left"

? ? for i = 1,cInitLen? do

? ? ? ? self:Grow(i == 1)

? ? end

end


function Snake:GetTailGrid()

? ? if #self.BodyArray == 0 then

? ? ? ? return 0,0

? ? end

? ? local tail = self.BodyArray[#self.BodyArray];

? ? return tail.X,tail.Y

end

function Snake:Grow(isHead)

? ? local tailX,tailY = self:GetTailGrid();

? ? local body = Body.new(self,tailX,tailY,self.node,isHead);

? ? table.insert(self.BodyArray,body)

end

local function OffsetGridByDir(x,y,dir)

? ? if dir == "left" then

? ? ? ? return x-1,y

? ? elseif dir == "right" then

? ? ? ? return x+1,y

? ? elseif dir == "up" then

? ? ? ? return x,y-1

? ? elseif dir == "down" then

? ? ? ? return x,y+1

? ? end

? ? print("Unkown dir", dir)

? ? return x,y

end;

function Snake:Update()

? ?if #self.BodyArray == 0 then

? ? ? ? return?

? ? end

? ? for i = #self.BodyArray,1,-1 do

? ? ? ? local body = self.BodyArray[i];

? ? ? ? if i == 1 then

? ? ? ? ? ? body.X,body.Y = OffsetGridByDir(body.X,body.Y,self.MoveDir)

? ? ? ? else

? ? ? ? ? ? local front = self.BodyArray[i-1];

? ? ? ? ? ? body.X,body.Y = front.X,front.Y

? ? ? ? end

? ? ? ? body:Update()

? ? end

end

return Snake


正在回答

2 回答


【蜘蛛俠TG@abin789】-9001
【蜘蛛俠TG@abin789】-9002
【蜘蛛俠TG@abin789】-9003
【蜘蛛俠TG@abin789】-9004
【蜘蛛俠TG@abin789】-9005
【蜘蛛俠TG@abin789】-9006
【蜘蛛俠TG@abin789】-9007
【蜘蛛俠TG@abin789】-9008
【蜘蛛俠TG@abin789】-9009
【蜘蛛俠TG@abin789】-9010
【蜘蛛俠TG@abin789】-9011
【蜘蛛俠TG@abin789】-9012
【蜘蛛俠TG@abin789】-9013
【蜘蛛俠TG@abin789】-9014
【蜘蛛俠TG@abin789】-9015
【蜘蛛俠TG@abin789】-9016
【蜘蛛俠TG@abin789】-9017
【蜘蛛俠TG@abin789】-9018
【蜘蛛俠TG@abin789】-9019
【蜘蛛俠TG@abin789】-9020
【蜘蛛俠TG@abin789】-9021
【蜘蛛俠TG@abin789】-9022
【蜘蛛俠TG@abin789】-9023
【蜘蛛俠TG@abin789】-9024
【蜘蛛俠TG@abin789】-9025
【蜘蛛俠TG@abin789】-9026
【蜘蛛俠TG@abin789】-9027
【蜘蛛俠TG@abin789】-9028
【蜘蛛俠TG@abin789】-9029
【蜘蛛俠TG@abin789】-9030
【蜘蛛俠TG@abin789】-9031
【蜘蛛俠TG@abin789】-9032
【蜘蛛俠TG@abin789】-9033
【蜘蛛俠TG@abin789】-9034
【蜘蛛俠TG@abin789】-9035
【蜘蛛俠TG@abin789】-9036
【蜘蛛俠TG@abin789】-9037
【蜘蛛俠TG@abin789】-9038
【蜘蛛俠TG@abin789】-9039
【蜘蛛俠TG@abin789】-9040
【蜘蛛俠TG@abin789】-9041
【蜘蛛俠TG@abin789】-9042
【蜘蛛俠TG@abin789】-9043
【蜘蛛俠TG@abin789】-9044
【蜘蛛俠TG@abin789】-9045
【蜘蛛俠TG@abin789】-9046
【蜘蛛俠TG@abin789】-9047
【蜘蛛俠TG@abin789】-9048
【蜘蛛俠TG@abin789】-9049
【蜘蛛俠TG@abin789】-9050
【蜘蛛俠TG@abin789】-9051
【蜘蛛俠TG@abin789】-9052
【蜘蛛俠TG@abin789】-9053
【蜘蛛俠TG@abin789】-9054
【蜘蛛俠TG@abin789】-9055
【蜘蛛俠TG@abin789】-9056
【蜘蛛俠TG@abin789】-9057
【蜘蛛俠TG@abin789】-9058
【蜘蛛俠TG@abin789】-9059
【蜘蛛俠TG@abin789】-9060
【蜘蛛俠TG@abin789】-9061
【蜘蛛俠TG@abin789】-9062
【蜘蛛俠TG@abin789】-9063
【蜘蛛俠TG@abin789】-9064
【蜘蛛俠TG@abin789】-9065
【蜘蛛俠TG@abin789】-9066
【蜘蛛俠TG@abin789】-9067
【蜘蛛俠TG@abin789】-9068
【蜘蛛俠TG@abin789】-9069
【蜘蛛俠TG@abin789】-9070
【蜘蛛俠TG@abin789】-9071
【蜘蛛俠TG@abin789】-9072
【蜘蛛俠TG@abin789】-9073
【蜘蛛俠TG@abin789】-9074
【蜘蛛俠TG@abin789】-9075
【蜘蛛俠TG@abin789】-9076
【蜘蛛俠TG@abin789】-9077
【蜘蛛俠TG@abin789】-9078
【蜘蛛俠TG@abin789】-9079
【蜘蛛俠TG@abin789】-9080
【蜘蛛俠TG@abin789】-9081
【蜘蛛俠TG@abin789】-9082
【蜘蛛俠TG@abin789】-9083
【蜘蛛俠TG@abin789】-9084
【蜘蛛俠TG@abin789】-9085
【蜘蛛俠TG@abin789】-9086
【蜘蛛俠TG@abin789】-9087
【蜘蛛俠TG@abin789】-9088
【蜘蛛俠TG@abin789】-9089
【蜘蛛俠TG@abin789】-9090
【蜘蛛俠TG@abin789】-9091
【蜘蛛俠TG@abin789】-9092
【蜘蛛俠TG@abin789】-9093
【蜘蛛俠TG@abin789】-9094
【蜘蛛俠TG@abin789】-9095
【蜘蛛俠TG@abin789】-9096
【蜘蛛俠TG@abin789】-9097
【蜘蛛俠TG@abin789】-9098
【蜘蛛俠TG@abin789】-9099
【蜘蛛俠TG@abin789】-9100
【蜘蛛俠TG@abin789】-9101
【蜘蛛俠TG@abin789】-9102
【蜘蛛俠TG@abin789】-9103
【蜘蛛俠TG@abin789】-9104
【蜘蛛俠TG@abin789】-9105
【蜘蛛俠TG@abin789】-9106
【蜘蛛俠TG@abin789】-9107
【蜘蛛俠TG@abin789】-9108
【蜘蛛俠TG@abin789】-9109
【蜘蛛俠TG@abin789】-9110
【蜘蛛俠TG@abin789】-9111
【蜘蛛俠TG@abin789】-9112
【蜘蛛俠TG@abin789】-9113
【蜘蛛俠TG@abin789】-9114
【蜘蛛俠TG@abin789】-9115
【蜘蛛俠TG@abin789】-9116
【蜘蛛俠TG@abin789】-9117
【蜘蛛俠TG@abin789】-9118
【蜘蛛俠TG@abin789】-9119
【蜘蛛俠TG@abin789】-9120
【蜘蛛俠TG@abin789】-9121
【蜘蛛俠TG@abin789】-9122
【蜘蛛俠TG@abin789】-9123
【蜘蛛俠TG@abin789】-9124
【蜘蛛俠TG@abin789】-9125
【蜘蛛俠TG@abin789】-9126
【蜘蛛俠TG@abin789】-9127
【蜘蛛俠TG@abin789】-9128
【蜘蛛俠TG@abin789】-9129
【蜘蛛俠TG@abin789】-9130
【蜘蛛俠TG@abin789】-9131
【蜘蛛俠TG@abin789】-9132
【蜘蛛俠TG@abin789】-9133
【蜘蛛俠TG@abin789】-9134
【蜘蛛俠TG@abin789】-9135
【蜘蛛俠TG@abin789】-9136
【蜘蛛俠TG@abin789】-9137
【蜘蛛俠TG@abin789】-9138
【蜘蛛俠TG@abin789】-9139
【蜘蛛俠TG@abin789】-9140
【蜘蛛俠TG@abin789】-9141
【蜘蛛俠TG@abin789】-9142
【蜘蛛俠TG@abin789】-9143
【蜘蛛俠TG@abin789】-9144
【蜘蛛俠TG@abin789】-9145
【蜘蛛俠TG@abin789】-9146
【蜘蛛俠TG@abin789】-9147
【蜘蛛俠TG@abin789】-9148
【蜘蛛俠TG@abin789】-9149
【蜘蛛俠TG@abin789】-9150
【蜘蛛俠TG@abin789】-9151
【蜘蛛俠TG@abin789】-9152
【蜘蛛俠TG@abin789】-9153
【蜘蛛俠TG@abin789】-9154
【蜘蛛俠TG@abin789】-9155
【蜘蛛俠TG@abin789】-9156
【蜘蛛俠TG@abin789】-9157
【蜘蛛俠TG@abin789】-9158
【蜘蛛俠TG@abin789】-9159
【蜘蛛俠TG@abin789】-9160
【蜘蛛俠TG@abin789】-9161
【蜘蛛俠TG@abin789】-9162
【蜘蛛俠TG@abin789】-9163
【蜘蛛俠TG@abin789】-9164
【蜘蛛俠TG@abin789】-9165
【蜘蛛俠TG@abin789】-9166
【蜘蛛俠TG@abin789】-9167
【蜘蛛俠TG@abin789】-9168
【蜘蛛俠TG@abin789】-9169
【蜘蛛俠TG@abin789】-9170
【蜘蛛俠TG@abin789】-9171
【蜘蛛俠TG@abin789】-9172
【蜘蛛俠TG@abin789】-9173
【蜘蛛俠TG@abin789】-9174
【蜘蛛俠TG@abin789】-9175
【蜘蛛俠TG@abin789】-9176
【蜘蛛俠TG@abin789】-9177
【蜘蛛俠TG@abin789】-9178
【蜘蛛俠TG@abin789】-9179
【蜘蛛俠TG@abin789】-9180
【蜘蛛俠TG@abin789】-9181
【蜘蛛俠TG@abin789】-9182
【蜘蛛俠TG@abin789】-9183
【蜘蛛俠TG@abin789】-9184
【蜘蛛俠TG@abin789】-9185
【蜘蛛俠TG@abin789】-9186
【蜘蛛俠TG@abin789】-9187
【蜘蛛俠TG@abin789】-9188
【蜘蛛俠TG@abin789】-9189
【蜘蛛俠TG@abin789】-9190
【蜘蛛俠TG@abin789】-9191
【蜘蛛俠TG@abin789】-9192
【蜘蛛俠TG@abin789】-9193
【蜘蛛俠TG@abin789】-9194
【蜘蛛俠TG@abin789】-9195
【蜘蛛俠TG@abin789】-9196
【蜘蛛俠TG@abin789】-9197
【蜘蛛俠TG@abin789】-9198
【蜘蛛俠TG@abin789】-9199
【蜘蛛俠TG@abin789】-9200

0 回復(fù) 有任何疑惑可以回復(fù)我~

棄坑了,我換quick-cocos2dx社區(qū)版去了?

0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消

MainScene里用定時(shí)器時(shí)一直報(bào)attempt to call method 'Update' (a nil value) stack traceback:

我要回答 關(guān)注問(wèn)題
微信客服

購(gòu)課補(bǔ)貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號(hào)