diff options
author | orwell96 <mono96.mml@gmail.com> | 2017-01-17 21:54:50 +0100 |
---|---|---|
committer | orwell96 <mono96.mml@gmail.com> | 2017-01-17 21:54:50 +0100 |
commit | b6e2aeea71394431889e9b554f190dda4adb0305 (patch) | |
tree | 498b67dfaa5987143f64bfd9fe63403843758267 /advtrains/advtrains_train_steam/init.lua | |
parent | 9c400f7d435b4b1c303f1dd5ac31a8a52b263355 (diff) | |
download | advtrains-b6e2aeea71394431889e9b554f190dda4adb0305.tar.gz advtrains-b6e2aeea71394431889e9b554f190dda4adb0305.tar.bz2 advtrains-b6e2aeea71394431889e9b554f190dda4adb0305.zip |
Add animation for steam engine
I needed to completely rewrite the animation because irrlicht couldn't handle the animation NathanS created.
Diffstat (limited to 'advtrains/advtrains_train_steam/init.lua')
-rw-r--r-- | advtrains/advtrains_train_steam/init.lua | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/advtrains/advtrains_train_steam/init.lua b/advtrains/advtrains_train_steam/init.lua index 5010902..232ffe1 100644 --- a/advtrains/advtrains_train_steam/init.lua +++ b/advtrains/advtrains_train_steam/init.lua @@ -21,12 +21,13 @@ advtrains.register_wagon("newlocomotive", { visual_size = {x=1, y=1}, wagon_span=1.85, collisionbox = {-1.0,-0.5,-1.0, 1.0,2.5,1.0}, - --update_animation=function(self, velocity) - --if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then - -- self.object:set_animation({x=1,y=60}, 100)--math.floor(velocity)) - --self.old_anim_velocity=advtrains.abs_ceil(velocity) - --end - --end, + update_animation=function(self, velocity) + if self.old_anim_velocity~=advtrains.abs_ceil(velocity) then + atprint("set_anim",advtrains.abs_ceil(velocity)*15) + self.object:set_animation({x=1,y=80}, advtrains.abs_ceil(velocity)*15, 0, true) + self.old_anim_velocity=advtrains.abs_ceil(velocity) + end + end, custom_on_activate = function(self, staticdata_table, dtime_s) minetest.add_particlespawner({ amount = 10, |