Browse Source

use am.rand

master
Nicholas Hayashi 3 years ago
parent
commit
2b191a1421
  1. 4
      lib/random.lua
  2. 2
      src/mob.lua

4
lib/random.lua

@ -48,9 +48,9 @@ local function random(n, m)
local r
if n then
if m then
r = R(n, m)
r = math.floor(R() * (m - n) + n)
else
r = R(n)
r = math.floor(R() * n)
end
else
r = R()

2
src/mob.lua

@ -283,7 +283,7 @@ local function update_mob_spooder(mob, mob_index)
-- passive animation
if math.random() < 0.1 then
mob.node"rotate":action(am.tween(0.3, { angle = math.random(math.rad(0, -180))}))
mob.node"rotate":action(am.tween(0.3, { angle = math.random() * math.rad(0, -180)}))
end
end

Loading…
Cancel
Save