summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDonBatman <serfdon@gmail.com>2015-10-24 17:50:21 -0700
committerDonBatman <serfdon@gmail.com>2015-10-24 17:50:21 -0700
commitf35d70f55d91c016546f5d569a34b0411a9f1711 (patch)
tree01d195c0cbb73977eaed6b70d228049edbe1cc94
parent158bc2f2b49fbb370afcf8f71ef96f8ecb97527d (diff)
Added pong board
-rw-r--r--pong/init.lua126
-rw-r--r--pong/schems/pong.mtsbin0 -> 196 bytes
-rw-r--r--pong/textures/pong_corner.pngbin0 -> 404 bytes
-rw-r--r--pong/textures/pong_dash.pngbin0 -> 412 bytes
-rw-r--r--pong/textures/pong_door.pngbin0 -> 337 bytes
-rw-r--r--pong/textures/pong_floor.pngbin0 -> 396 bytes
-rw-r--r--pong/textures/pong_side.pngbin0 -> 363 bytes
7 files changed, 126 insertions, 0 deletions
diff --git a/pong/init.lua b/pong/init.lua
new file mode 100644
index 0000000..be72843
--- /dev/null
+++ b/pong/init.lua
@@ -0,0 +1,126 @@
+local blocks = {
+ {"floor","Floor"},
+ {"dash","Dash"},
+ {"side","Side"},
+ {"corner","Corner"},
+ }
+for i in ipairs(blocks) do
+ local itm = blocks[i][1]
+ local des = blocks[i][2]
+
+minetest.register_node("pong:"..itm,{
+ description = des,
+ tiles = {
+ "pong_"..itm..".png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_side.png",
+ "pong_floor.png",
+ },
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky = 3},
+})
+end
+minetest.register_node("pong:doora", {
+ description = "Pong Door",
+ tiles = {
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_door.png",
+ "pong_door.png",
+ },
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky = 3},
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.4375, 0.5, 0.5, -0.3125}
+ }
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.4375, 0.5, 1.5, -0.3125}
+ }
+ },
+
+after_place_node = function(pos, placer, itemstack, pointed_thing)
+ local node = minetest.get_node(pos)
+ minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="pong:doorb",param2=node.param2})
+end,
+
+on_rightclick = function(pos, node, player, itemstack, pointed_thing)
+ local timer = minetest.get_node_timer(pos)
+ local par2 = node.param2 + 1
+ if par2 == 4 then
+ par2 = 0
+ end
+ minetest.set_node(pos,{name="pong:doora",param2 = par2})
+ minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="pong:doorb",param2 = par2})
+ timer:start(3)
+end,
+on_timer = function(pos, elapsed)
+ local node = minetest.get_node(pos)
+ local par2 = node.param2
+ if par2 == 0 then
+ par2 = 3
+ else par2 = node.param2 -1
+ end
+ minetest.set_node(pos,{name="pong:doora",param2 = par2})
+ minetest.set_node({x=pos.x,y=pos.y+1,z=pos.z},{name="pong:doorb",param2 = par2})
+end,
+})
+minetest.register_node("pong:doorb", {
+ --description = "Pong Door",
+ tiles = {
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_door.png",
+ "pong_door.png",
+ },
+ drawtype = "nodebox",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ groups = {cracky = 3},
+ node_box = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.4375, 0.5, 0.5, -0.3125}
+ }
+ },
+ selection_box = {
+ type = "fixed",
+ fixed = {
+ {0, 0, 0, 0, 0, 0}
+ }
+ },
+})
+minetest.register_node("pong:block",{
+ description = "Pong",
+ --inventory_image = "pong_inv.png",
+ tiles = {
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_floor.png",
+ "pong_dash.png",
+ },
+ drawtype = "normal",
+ paramtype = "light",
+ paramtype2 = "facedir",
+ light_source = 8,
+ groups = {cracky = 1},
+ on_rightclick = function(pos, node, player, itemstack, pointed_thing)
+ local schem = minetest.get_modpath("pong").."/schems/pong.mts"
+ minetest.place_schematic(pos,schem,0, "air", true)
+ end,
+})
diff --git a/pong/schems/pong.mts b/pong/schems/pong.mts
new file mode 100644
index 0000000..d0c1a7c
--- /dev/null
+++ b/pong/schems/pong.mts
Binary files differ
diff --git a/pong/textures/pong_corner.png b/pong/textures/pong_corner.png
new file mode 100644
index 0000000..35a71ed
--- /dev/null
+++ b/pong/textures/pong_corner.png
Binary files differ
diff --git a/pong/textures/pong_dash.png b/pong/textures/pong_dash.png
new file mode 100644
index 0000000..fc5ab4d
--- /dev/null
+++ b/pong/textures/pong_dash.png
Binary files differ
diff --git a/pong/textures/pong_door.png b/pong/textures/pong_door.png
new file mode 100644
index 0000000..39fdfa3
--- /dev/null
+++ b/pong/textures/pong_door.png
Binary files differ
diff --git a/pong/textures/pong_floor.png b/pong/textures/pong_floor.png
new file mode 100644
index 0000000..448b41a
--- /dev/null
+++ b/pong/textures/pong_floor.png
Binary files differ
diff --git a/pong/textures/pong_side.png b/pong/textures/pong_side.png
new file mode 100644
index 0000000..5c5fadb
--- /dev/null
+++ b/pong/textures/pong_side.png
Binary files differ