commit e8ede9c8c1e519c32de9643cdfc6842e74f6a792 Author: Whiskers75 - Date: Sun Jun 17 10:36:08 2012 +0100 1: Got everything working! diff --git a/depends.txt b/depends.txt new file mode 100644 index 0000000..acaa924 --- /dev/null +++ b/depends.txt @@ -0,0 +1 @@ +mesecons diff --git a/init.lua b/init.lua new file mode 100644 index 0000000..b51eaf9 --- /dev/null +++ b/init.lua @@ -0,0 +1,56 @@ +-- TIC-TAC-TOE BOARD MOD +-- by whiskers75 + +minetest.register_node ("tictactoe:x_on", { + drawtype = signlike, + description = "TicTacToe X", + tile_images = {"tttx.png"}, + inventory_image = {"tttx.png"}, + sunlight_propagates = true, + paramtype = 'light', + walkable = true, + groups = {dig_immediate=2}, + material = minetest.digprop_constanttime(1.0), + }) + +minetest.register_node ("tictactoe:o_on", { + drawtype = signlike, + description = "TicTacToe O", + tile_images = {"ttto.png"}, + inventory_image = {"ttto.png"}, + sunlight_propagates = true, + paramtype = 'light', + walkable = true, + groups = {dig_immediate=2}, + material = minetest.digprop_constanttime(1.0), + }) + +mesecon:add_receptor_node("tictactoe:x_on") +mesecon:add_receptor_node("tictactoe:o_on") + +minetest.register_on_dignode( + function(pos, oldnode, digger) + if oldnode.name == "tictactoe:x_on" then + mesecon:receptor_off(pos) + end + end +) +minetest.register_on_dignode( + function(pos, oldnode, digger) + if oldnode.name == "tictactoe:o_on" then + mesecon:receptor_off(pos) + end + end +) + +minetest.register_on_punchnode(function(pos, node, puncher) + if node.name == "tictactoe:x_on" then + mesecon:receptor_on(pos) + end +end) + +minetest.register_on_punchnode(function(pos, node, puncher) + if node.name == "tictactoe:o_on" then + mesecon:receptor_on(pos) + end +end) diff --git a/init.lua~ b/init.lua~ new file mode 100644 index 0000000..b7cab04 --- /dev/null +++ b/init.lua~ @@ -0,0 +1,54 @@ +-- TIC-TAC-TOE BOARD MOD +-- by whiskers75 + +minetest.register_node ("tictactoe:x_on", { + drawtype = signlike, + description = "TicTacToe X", + tile_images = {"tttx.png"}, + inventory_image = {"tttx.png"}, + sunlight_propagates = true, + paramtype = 'light', + walkable = true, + material = minetest.digprop_constanttime(1.0), + }) + +minetest.register_node ("tictactoe:o_on", { + drawtype = signlike, + description = "TicTacToe O", + tile_images = {"ttto.png"}, + inventory_image = {"ttto.png"}, + sunlight_propagates = true, + paramtype = 'light', + walkable = true, + material = minetest.digprop_constanttime(1.0), + }) + +mesecon:add_receptor_node("tictactoe:x_on") +mesecon:add_receptor_node("tictactoe:o_on") + +minetest.register_on_dignode( + function(pos, oldnode, digger) + if oldnode.name == "tictactoe:x_on" then + mesecon:receptor_off(pos) + end + end +) +minetest.register_on_dignode( + function(pos, oldnode, digger) + if oldnode.name == "tictactoe:o_on" then + mesecon:receptor_off(pos) + end + end +) + +minetest.register_on_punchnode(function(pos, node, puncher) + if node.name == "tictactoe:x_on" then + mesecon:receptor_on(pos) + end +end) + +minetest.register_on_punchnode(function(pos, node, puncher) + if node.name == "tictactoe:o_on" then + mesecon:receptor_on(pos) + end +end) diff --git a/textures/ttto.png b/textures/ttto.png new file mode 100644 index 0000000..3c0ba34 Binary files /dev/null and b/textures/ttto.png differ diff --git a/textures/tttx.png b/textures/tttx.png new file mode 100644 index 0000000..33877e2 Binary files /dev/null and b/textures/tttx.png differ