From e8ede9c8c1e519c32de9643cdfc6842e74f6a792 Mon Sep 17 00:00:00 2001 From: Whiskers75 - Date: Sun, 17 Jun 2012 10:36:08 +0100 Subject: [PATCH] 1: Got everything working! --- depends.txt | 1 + init.lua | 56 ++++++++++++++++++++++++++++++++++++++++++++++ init.lua~ | 54 ++++++++++++++++++++++++++++++++++++++++++++ textures/ttto.png | Bin 0 -> 1438 bytes textures/tttx.png | Bin 0 -> 1431 bytes 5 files changed, 111 insertions(+) create mode 100644 depends.txt create mode 100644 init.lua create mode 100644 init.lua~ create mode 100644 textures/ttto.png create mode 100644 textures/tttx.png 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 0000000000000000000000000000000000000000..3c0ba3424708303889fd6a9d47bd3dac6bded079 GIT binary patch literal 1438 zcmV;P1!4M$P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyh` z2@3|xi}c?B000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000E}Nkl6-B1#Rq1omJ^0vU}%1cY3P_7?fB)s&TTYABN z&Zpkzob&6G=RVIl&jn)CL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xVRpjN}mSu(G7)%`ZXI9pZq@*~vQ|sFij>|oAq|oI;e?KA- sEWZ>PjVLX>v32X)KHsH#_u|C*58-mXD#>i9>;M1&07*qoM6N<$g6`jsB>(^b literal 0 HcmV?d00001 diff --git a/textures/tttx.png b/textures/tttx.png new file mode 100644 index 0000000000000000000000000000000000000000..33877e212f5f626002db5f653b065eda7867295b GIT binary patch literal 1431 zcmV;I1!($-P)Px#24YJ`L;(K){{a7>y{D4^000SaNLh0L01FcU01FcV0GgZ_00007bV*G`2iyh` z2@EMO8(%>H000?uMObu0Z*6U5Zgc=ca%Ew3Wn>_CX>@2HM@dakSAh-}000E?NklVbS8h5Nm3Se@ zG7~ZucQp+$n(bywcCi7Q7fqH;w;@r==EY_J4VV<-1<<&1(}A8{$QG5Bp0^+4$+>*b z^ZefDJYVMk6swn=+Rw$#9X)mwxfkLjxU`BPAr>eM)X*F0Z3;AT9G6?JUBGY5SfCK8 zxZ}nSx6hqJCOdEmh^oN?g%}r|A*ajh$`#YciI`GifdX-uL+0{bRWWsv1qS$?9ciS6nJkO`W)bd`7 zbH>S0j>#5Jd3G`#)g4|q9DFyZHa+z&y*wqWa6vO|R`E3jC=N{?YIvoAos39?yTGyQ z7pTA=a30V@Kdv1Ib3k7=U$1|ze(|Tp=t7hsynz7d5eg&QKY#=ffGo>4r)|rTE&7{! z_8&4(L&xQgVry|~J04&}#ZhdfTgT|w%3h5|<9N~GxalC2Fz%NYrP|(FonE&VlTRH} zek{Lxs5=-8KB1(fti*QG#{J4+hDnRKAa3|@Lt-)kXi>uyg<-(p_9y8ml13_hwUqDV z8Og{3v3_PP@s!B2{73_@Y2aH3p9ss5Wi{2N9hguN83nX}wF=Gv7r?pFo=rT! zK=RI&#)<SeVuxJBCJD{Xh z{K|m8fIqVy?{&a15YM2fjssO$1d@Qgz?BS`{#%!_@_NA$Q~_s!+0;yhv@kW+6wsOh z5XW<3g@`WTPAZ^LpbvcUO0bGS5ko*M`S*VSF9D)@CRvfSd$qXAFg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