From 89a83c38abfc082bef723e3ad3dac5747d473e0c Mon Sep 17 00:00:00 2001 From: webdesigner97 Date: Wed, 16 Apr 2014 18:25:32 +0200 Subject: [PATCH] start improving trafficlight --- .../streets_trafficlight_template.png | Bin 0 -> 470 bytes trafficlight/init.lua | 139 ++---------------- 2 files changed, 14 insertions(+), 125 deletions(-) create mode 100644 streetsmod/textures/streets_trafficlight_template.png diff --git a/streetsmod/textures/streets_trafficlight_template.png b/streetsmod/textures/streets_trafficlight_template.png new file mode 100644 index 0000000000000000000000000000000000000000..72b6b0262a4e0a686c5eee36d1a234c3c184d1a4 GIT binary patch literal 470 zcmeAS@N?(olHy`uVBq!ia0vp^4j|0I1|(Ny7TyC=Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmPqi-3TLhMUW;dIko@WKS2zkcwMxXT|olCqSuRtJWNl^lb@!htKPNWxV6se#n)jMp z#@W0A42)3JkmfvZffvx93E{l;uQ`nbd?MFYHW~bQk#$ly< to the top node of the trafficlight - pos.y = pos.y + 4 - -- - if msg == "red" and state ~= "red" then - minetest.set_node(pos,{name = "streets:trafficlight_top_yellow",param2=facedir}) - minetest.after(3,function(param) - minetest.set_node(pos,{name = "streets:trafficlight_top_red",param2=facedir}) - end) - end - -- - if msg == "green" and state ~= "green" then - minetest.set_node(pos,{name = "streets:trafficlight_top_redyellow",param2=facedir}) - minetest.after(3,function(param) - minetest.set_node(pos,{name = "streets:trafficlight_top_green",param2=facedir}) - end) - end - -- - if msg == "off" and state ~= "off" then - minetest.set_node(pos,{name = "streets:trafficlight_top_off",param2=facedir}) - end - -- - if msg == "warn" and state ~= "warn" then - minetest.set_node(pos,{name = "streets:trafficlight_top_warn",param2=facedir}) - end - end - end - end - } - } -}) - minetest.register_node(":streets:trafficlight_top_off",{ - description = S("U cheater U"), - drop = "", - groups = {cracky = 1, not_in_creative_inventory = 1}, + description = S("Trafficlight"), + drawtype="nodebox", paramtype = "light", paramtype2 = "facedir", - sunlight_propagates = true, - drawtype = "nodebox", - tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_off.png"}, + groups = {cracky = 1}, node_box = { type = "fixed", fixed = { - {-0.25,-0.5,-0.25,0.25,0.5,0.25} + {-0.1875,-0.5,0.5,0.1875,0.5,0.75}, --nodebox1 + {-0.05,0.375,0.32,0.05,0.429368,0.51}, --nodebox2 + {-0.05,0.0625,0.32,0.05,0.125,0.51}, --nodebox3 + {-0.05,-0.25,0.32,0.05,-0.1875,0.51}, --nodebox4 + {0.05,0.32,0.32,0.1,0.38,0.5}, --nodebox5 + {-0.1,0.32,0.32,-0.05,0.38,0.5}, --nodebox6 + {0.05,0.001,0.32,0.1,0.06,0.5}, --nodebox7 + {-0.1,0.001,0.32,-0.05,0.06,0.5}, --nodebox8 + {0.05,-0.31,0.32,0.1,-0.25,0.5}, --nodebox9 + {-0.1,-0.31,0.32,-0.05,-0.25,0.5}, --nodebox10 } }, - pointable = false, + tiles = {"streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_tl_bg.png","streets_trafficlight_template.png"}, }) minetest.register_node(":streets:trafficlight_top_red",{