From 58b579854a007f33d49f3dd2574927743836e9e4 Mon Sep 17 00:00:00 2001 From: HybridDog Date: Fri, 23 Aug 2013 15:44:44 +0200 Subject: [PATCH] generate texture --- tnt/init.lua | 19 +++++++++++++++++-- tnt/rest/tnt_top_burning_animated.png | Bin 0 -> 256 bytes tnt/textures/tnt_top_burning_animated.png | Bin 256 -> 177 bytes 3 files changed, 17 insertions(+), 2 deletions(-) create mode 100644 tnt/rest/tnt_top_burning_animated.png diff --git a/tnt/init.lua b/tnt/init.lua index 3eacb63..d817f92 100644 --- a/tnt/init.lua +++ b/tnt/init.lua @@ -55,7 +55,7 @@ local destroy = function(pos) drop_item(pos, nodename) end -boom = function(pos, time) +function boom(pos, time) minetest.after(time, function(pos) if minetest.env:get_node(pos).name ~= "tnt:tnt_burning" then return @@ -172,8 +172,23 @@ minetest.register_node("tnt:tnt", { }, }) +local tnt_frame_count = 4 +local tnt_frame_size = 16 + +local l = tnt_frame_count +local px = 0 +local combine_textures = ":0,"..px.."=default_tnt_top.png" +while l ~= 0 do + combine_textures = combine_textures..":0,"..px.."=default_tnt_top.png" + px = px+tnt_frame_size + l = l-1 +end + +local animated_tnt_texture = "tnt_top_burning_animated.png^[combine:16x64:"..combine_textures.."^tnt_top_burning_animated.png" + minetest.register_node("tnt:tnt_burning", { - tiles = {{name="tnt_top_burning_animated.png", animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}}, "default_tnt_bottom.png", tnt_side},--"default_tnt_top.png^" + tiles = {{name=animated_tnt_texture, animation={type="vertical_frames", aspect_w=16, aspect_h=16, length=1}}, + "default_tnt_bottom.png", tnt_side}, light_source = 5, drop = "", sounds = default.node_sound_wood_defaults(), diff --git a/tnt/rest/tnt_top_burning_animated.png b/tnt/rest/tnt_top_burning_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..baeba8b02f477cc17404bf0443441933d4823dc4 GIT binary patch literal 256 zcmeAS@N?(olHy`uVBq!ia0vp^0zmA*!VDxI2ESSgq!^2X+?^QKos)S9>EaloaenQ@i@b*wcwG9AFbi}tdK_kOJjI}Pw|@CC ziNpTVE3+Q5cV7PdQnEi(f7_bvb`f%?OJ#PleyU$LIczopr E0QsqF8UO$Q literal 0 HcmV?d00001 diff --git a/tnt/textures/tnt_top_burning_animated.png b/tnt/textures/tnt_top_burning_animated.png index baeba8b02f477cc17404bf0443441933d4823dc4..a86554aea6314e085aacb6ce6784a1de221fc7f7 100644 GIT binary patch delta 161 zcmV;S0ABxq0=WEvhV1Lyz%2^4R;-^zJB P00000NkvXXu0mjf`g%Rp delta 240 zcmV&OSpq;m1D14}b8JazgdvhaYg`@W1__`{C~A qY_qx_aNAc=&b2_>m-%_(%RVo;y+9eeXse(A0000