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 local r
if n then if n then
if m then if m then
r = R(n, m)
r = math.floor(R() * (m - n) + n)
else else
r = R(n)
r = math.floor(R() * n)
end end
else else
r = R() r = R()

2
src/mob.lua

@ -283,7 +283,7 @@ local function update_mob_spooder(mob, mob_index)
-- passive animation -- passive animation
if math.random() < 0.1 then 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
end end

Loading…
Cancel
Save