gpt4 book ai didi

android - 降低速度值 LUA

转载 作者:行者123 更新时间:2023-11-28 20:23:32 26 4
gpt4 key购买 nike

如何通过减少 star1.movementSpeed = 10000; 来增加 movementSpeed,每个 -110 秒。

我已经试过了,但不知道我做错了什么

function initStar()
local star1 = {}
star1.imgpath = "Star1.png"; --Set Image Path for Star
star1.movementSpeed = 10000; --Determines the movement speed of star
table.insert(starTable, star1); --Insert Star into starTable
end --END initStar()


local function star1incr() -- increments Speed value every time it is called
movementSpeed = movementSpeed - 1
star1.movementSpeed = "movementSpeed: " .. movementSpeed
end

timer.performWithDelay(10000, star1incr, 0)

最佳答案

通过使用修复

   local function star1incr()
starTable[1].movementSpeed = starTable[1].movementSpeed - 1
print( "- 1" )
end

关于android - 降低速度值 LUA,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14992184/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com