From 22f5bf7d76c2d71ed2f2c6e9e4d084727accbca9 Mon Sep 17 00:00:00 2001 From: cheapie Date: Mon, 7 Aug 2023 17:56:31 -0500 Subject: Initial car prototype No textures yet and all of the nodes have to be placed manually at the moment --- car.lua | 200 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ init.lua | 1 + 2 files changed, 201 insertions(+) create mode 100644 car.lua diff --git a/car.lua b/car.lua new file mode 100644 index 0000000..e2202b5 --- /dev/null +++ b/car.lua @@ -0,0 +1,200 @@ +local pieces = { + { + _position = "000", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.6,-0.5,0.5,-0.5,0.5}, + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + {-0.5,-1.5,-0.5,0.5,-0.6,-0.45}, + }, + }, + }, + { + _position = "001", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.6,-0.5,0.5,-0.5,0.5}, + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + }, + }, + }, + { + _position = "002", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.6,-0.5,0.5,-0.5,0.5}, + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + {-0.45,-0.5,0.45,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "100", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.6,-0.5,0.5,-0.5,0.5}, + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + {-0.5,-1.5,-0.5,0.5,-0.6,-0.45}, + }, + }, + }, + { + _position = "101", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.6,-0.5,0.5,-0.5,0.5}, + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "102", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.6,-0.5,0.5,-0.5,0.5}, + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + {-0.5,-0.5,0.45,0.45,0.5,0.5}, + }, + }, + }, + { + _position = "010", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + }, + }, + }, + { + _position = "011", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + }, + }, + }, + { + _position = "012", + node_box = { + type = "fixed", + fixed = { + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + {-0.45,-0.5,0.45,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "110", + node_box = { + type = "fixed", + fixed = { + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "111", + node_box = { + type = "fixed", + fixed = { + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "112", + node_box = { + type = "fixed", + fixed = { + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + {-0.5,-0.5,0.45,0.45,0.5,0.5}, + }, + }, + }, + { + _position = "020", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.5,-0.5,0.5,0.6,0.5}, + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + {-0.5,0.6,-0.4,0.5,1,-0.1}, + }, + }, + }, + { + _position = "021", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.5,-0.5,0.5,0.6,0.5}, + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + }, + }, + }, + { + _position = "022", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.5,-0.5,0.5,0.6,0.5}, + {-0.5,-0.5,-0.5,-0.45,0.5,0.5}, + {-0.45,-0.5,0.45,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "120", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.5,-0.5,0.5,0.6,0.5}, + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + {-0.5,0.6,-0.4,0.5,1,-0.1}, + }, + }, + }, + { + _position = "121", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.5,-0.5,0.5,0.6,0.5}, + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + }, + }, + }, + { + _position = "122", + node_box = { + type = "fixed", + fixed = { + {-0.5,0.5,-0.5,0.5,0.6,0.5}, + {0.45,-0.5,-0.5,0.5,0.5,0.5}, + {-0.5,-0.5,0.45,0.45,0.5,0.5}, + }, + }, + }, +} + +for _,def in ipairs(pieces) do + def.groups = { + dig_immediate = 2, + } + def.tiles = { + "celevator_cabinet_sides.png", + } + def.paramtype = "light" + def.paramtype2 = "4dir" + def.drawtype = "nodebox" + def.description = "Car "..def._position + minetest.register_node("celevator:car_"..def._position,def) +end diff --git a/init.lua b/init.lua index eb7ebdc..3c42808 100644 --- a/init.lua +++ b/init.lua @@ -1,5 +1,6 @@ local components = { "framework", + "car", "drive_null", "controller", "callbuttons", -- cgit v1.2.3