From fadb973205f3ad378db409c32f0ecd93b7df73ee Mon Sep 17 00:00:00 2001 From: Vanessa Ezekowitz Date: Fri, 3 Nov 2017 23:05:36 -0400 Subject: update boost_cart, currency, mesecons, pipeworks, and technic --- boost_cart/cart_entity.lua | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'boost_cart/cart_entity.lua') diff --git a/boost_cart/cart_entity.lua b/boost_cart/cart_entity.lua index 0105cf5..69f45fb 100644 --- a/boost_cart/cart_entity.lua +++ b/boost_cart/cart_entity.lua @@ -307,6 +307,7 @@ function cart_entity:on_step(dtime) self.object:set_acceleration(new_acc) self.old_pos = vector.round(pos) + local old_y_dir = self.old_dir.y if not vector.equals(dir, {x=0, y=0, z=0}) and not stop_wiggle then self.old_dir = dir end @@ -351,6 +352,25 @@ function cart_entity:on_step(dtime) anim = {x=2, y=2} end self.object:set_animation(anim, 1, 0) + if player and dir.y ~= old_y_dir then + local feet = {x=0, y=0, z=0} + local eye = {x=0, y=-4, z=0} + feet.y = boost_cart.old_player_model and 6 or -4.2 + if dir.y ~= 0 then + -- TODO: Find a better way to calculate this + if boost_cart.old_player_model then + feet.y = 6 + 1.5 + feet.z = -dir.y * 7 + else + feet.y = -4.2 + 3 + feet.z = -dir.y + end + eye.z = -dir.y * 10 + end + player:set_attach(self.object, "", feet, + {x=dir.y * -45, y=0, z=0}) + player:set_eye_offset(eye, eye) + end self.object:set_velocity(vel) if update.pos then -- cgit v1.2.3