我正在开发一款游戏,我想让每500点发生一些事情,并让它无限扩展。
有没有有效的方法可以做到这一点?
感谢任何帮助
答案 0 :(得分:2)
if math.floor(points/500) ~= math.floor(last_points/500) then
-- do something
end
last_points = points
答案 1 :(得分:0)
假设我正确地解释了这个问题,这应该是非常安全的:
if math.floor(points/500) >= math.floor(maximum_points/500) then
maximum_points = points
-- do something
end