-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinit.lua
41 lines (34 loc) · 1006 Bytes
/
init.lua
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
wolf = {}
wolf.lib = {}
wolf.math = {}
function wolf.mobupdate(mob, player)
local mobcpy = mob
mobkit.turn2yaw(mobcpy.mob, mobcpy.yaw, mobcpy.rateofmove)
if (mobcpy.jump == 0) then
mobkit.animate(mobcpy.mob, mobcpy.walk_animation)
mobcpy.mob:set_pos(mobcpy.pos)
mobcpy.lastpos = mobkit.pos_shift(mobcpy.lastpos, mobcpy.pos)
end
if mobcpy.jump == 1 then
mobkit.animate(mobcpy.mob, mobcpy.jump_stand_still)
end
if mobcpy.jump == 2 then
mobkit.animate(mobcpy.mob, mobcpy.jump_moving_ani)
mobcpy.lastpos = mobkit.pos_shift(mobcpy.lastpos, mobcpy.pos)
mobcpy.mob:set_pos(mobcpy.pos)
end
return mobcpy
end
-- Function to clamp a value between a minimum and maximum
function wolf.math.clamp(value, min, max)
if value < min then
return min
elseif value > max then
return max
else
return value
end
end
wolf.lib.jumpstandingstill = 1
wolf.lib.jumpmoving = 2
wolf.lib.nojump = 0