1
stage:addEventListener(Event.ENTER_FRAME,
function()
Graphic:setRotation(Graphic:getRotation()+ (Timer.delayedCall(math.random(4, 8) ,
function() speed = math.random(1, 30)
return speed
end)
))
end)
Basicallu,我所試圖做的是,隨意改變轉速,但因爲我不希望它改變在每一秒,我想使用Timer.delayedCall在Gideros,但它給了,說attempt to perform arithmetic on a table value: Lua error message
錯誤。我怎樣才能解決這個問題?試圖對錶值進行算術:Lua的錯誤信息
非常感謝。有效!萬分感謝! –
我得到了你的觀點,但你不覺得timerpending只會增加一個額外的條件檢查,因爲上面的代碼延遲旋轉隨機或可能是我不能夠理解timerpending的罰款目的是什麼? –