diff --git a/api.lua b/api.lua index 3dbc0ea..530a852 100644 --- a/api.lua +++ b/api.lua @@ -904,6 +904,7 @@ function mob_class:check_for_death(cmi_cause) local frames = self.animation.die_end - self.animation.die_start local speed = self.animation.die_speed or 15 local length = max((frames / speed), 0) + local rot = self.animation.die_rotate and 5 self.attack = nil self.v_start = false @@ -912,7 +913,8 @@ function mob_class:check_for_death(cmi_cause) self.passive = true self.state = "die" self.object:set_properties({ - pointable = false, collide_with_objects = false + pointable = false, collide_with_objects = false, + automatic_rotate = rot, }) self:set_velocity(0) self:set_animation("die") diff --git a/api.txt b/api.txt index 6c09a1f..e8014ed 100644 --- a/api.txt +++ b/api.txt @@ -226,6 +226,7 @@ functions needed for the mob to work properly which contains the following: 'die_end' 'die_speed' 'die_loop' when set to false stops the animation looping. + 'die_rotate' if true mob spins during death animation. Using '_loop = false' setting will stop any of the above animations from looping.