【御剑行】可以读取剧本移动了

dev_chengFeng
ZhangBiao 2021-10-09 10:56:49 +08:00
parent 21bdecb465
commit 09bb4fc688
1 changed files with 4 additions and 7 deletions

View File

@ -58,22 +58,19 @@ end
--upDate
function RiceSinglePlayerView:OnUpdate()
if self.isRunning then
if self.index == 1 then
LogYellow("self.speed:"..tostring(self.speed))
end
--暂定8500结束游戏
if self.curPosX >= 8500 then
YuJianXingManager.FinishResetGame()
else
self.curPosX = self.curPosX + self.speed
self.player.transform.localPosition = Vector2.New(self.curPosX,100)
-- for k,v in pairs(self.keyFrameList) do
--事件
for i,v in ipairs(self.keyFrameList) do
if self.curPosX >= v.pos then
if v == 1 then
if v.value == 1 then--加速
self.speed = self.speed*1.2
table.remove( self.keyFrameList,i)
elseif v == 2 then
elseif v.value == 2 then--减速
self.speed = self.speed*0.9
table.remove( self.keyFrameList,i)
end