summaryrefslogtreecommitdiff
path: root/pong
diff options
context:
space:
mode:
authorFernando Carmona Varo <ferkiwi@gmail.com>2015-10-25 03:00:20 +0100
committerFernando Carmona Varo <ferkiwi@gmail.com>2015-10-25 03:00:20 +0100
commit77e68e591feb6f42020c0c69f1348ac4aa9be6f0 (patch)
tree9aa02d3729f614ed6da84aa500b26b114079cdb4 /pong
parentdddc5a616ab09964f67e3cc3e0f7c55c0fdb402e (diff)
parent4a9d35295a47539ebf9a525f14702f8f73f0776d (diff)
Merge branch 'master' of https://github.com/DonBatman/myarcade
Diffstat (limited to 'pong')
-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