【发布时间】:2014-06-04 01:01:08
【问题描述】:
我编写了这段代码:
myHero = GetMyHero()
a = math.random()
function OnDraw()
if (myHero.health < 2000) then
DrawText(a, 30, 600, 200, 0xFFFF0000)
end
end
math.random() 给出浮点数,我需要一个整数。我怎样才能得到一个整数?
编辑:
事实证明,math.random(upper) 和 (x, y) 给出整数。
【问题讨论】:
-
请至少做最少的研究。
标签: math random lua floating-point integer