From 00e000897678a8ecd9e6e1875db508fd98f059cb Mon Sep 17 00:00:00 2001 From: Giov4 Date: Sun, 30 Oct 2022 00:23:47 +0200 Subject: [PATCH] Let's try move_to and a little bit of interpolation --- _classes/mage/skills/ice_spikes.lua | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/_classes/mage/skills/ice_spikes.lua b/_classes/mage/skills/ice_spikes.lua index b3d3821..d19fb59 100644 --- a/_classes/mage/skills/ice_spikes.lua +++ b/_classes/mage/skills/ice_spikes.lua @@ -65,7 +65,7 @@ function ice_spikes:on_activate(pl_name, dtime_s) minetest.sound_play(sound, sound, true) self._pl_name = pl_name - obj:set_velocity({x=0, y=self._speed, z=0}) + self._spike_base = vector.add(self.object:get_pos(), {x=0, y=1.5, z=0}) else obj:remove() end @@ -105,17 +105,14 @@ function ice_spikes:on_step(dtime) local player = minetest.get_player_by_name(self._pl_name) self._time_passed = self._time_passed + dtime self._tick_buffer = self._tick_buffer + dtime - local spike_base = vector.add(self.object:get_pos(), {x=0, y=-0.2, z=0}) - local is_in_place = not fbrawl.are_there_nodes_in_area(spike_base, 0.5) if not player then self.object:remove() return end - if is_in_place then - self.object:set_velocity({x=0, y=0, z=0}) - end + self.object:move_to(fbrawl.vec_interpolate(self.object:get_pos(), self._spike_base, 0.3), true) + if self._time_passed >= self._lifetime then self:remove() return