Added a mini snakes and ladders

master
DonBatman 2015-10-19 19:21:39 -07:00
parent 47166597be
commit de7319356a
40 changed files with 154 additions and 0 deletions

View File

@ -125,6 +125,7 @@ minetest.register_node("mys_n_l:board_block"..num,{
end
minetest.register_node("mys_n_l:placer",{
description = "Snakes and Ladders",
inventory_image = "mys_n_l_base.png^mys_n_l_edge.png^mys_n_l_ladmid.png",
tiles = {
"mys_n_l_base.png^mys_n_l_edge.png^mys_n_l_ladmid.png"
},

48
mys_n_l_mini/dice.lua Normal file
View File

@ -0,0 +1,48 @@
local dice = {
{"mys_n_l_mini:1",{"mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png"},"1"},
{"mys_n_l_mini:2",{"mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png"},"2"},
{"mys_n_l_mini:3",{"mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png"},"3"},
{"mys_n_l_mini:4",{"mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png"},"4"},
{"mys_n_l_mini:5",{"mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png"},"5"},
{"mys_n_l_mini:6",{"mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png"},"6"},
}
for i in ipairs (dice) do
local d1 = dice [i][1]
local d2 = dice [i][2]
local d3 = dice [i][3]
minetest.register_node(d1,{
description = d3,
tiles = d2,
drawtype = "normal",
paramtype = "light",
groups = {cracky = 1, not_in_creative_inventory=1},
on_punch = function(pos, node, puncher, pointed_thing)
local timer = minetest.get_node_timer(pos)
local ran = math.random(1,6)
minetest.set_node(pos,{name="mys_n_l:roll"})
timer:start(2)
end,
})
end
minetest.register_node("mys_n_l_mini:roll",{
description = "roll",
tiles = {
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
},
drawtype = "normal",
paramtype = "light",
groups = {cracky = 3, not_in_creative_inventory=1},
on_timer = function(pos, elapsed)
local ran = math.random(1,6)
minetest.set_node(pos,{name="mys_n_l_mini:"..ran})
end
})

105
mys_n_l_mini/init.lua Normal file
View File

@ -0,0 +1,105 @@
local board_parts = {
{"1","[colorize:red:200","mys_n_l_1.png",""},
{"2","[colorize:blue:200","mys_n_l_2.png",""},
{"3","[colorize:yellow:200","mys_n_l_3.png","mys_n_l_stail.png"},
{"4","[colorize:green:200","mys_n_l_4.png",""},
{"5","[colorize:red:200","mys_n_l_5.png",""},
{"6","[colorize:blue:200","mys_n_l_6.png",""},
{"7","[colorize:yellow:200","mys_n_l_7.png","mys_n_l_ladbot.png"},
{"8","[colorize:green:200","mys_n_l_8.png",""},
{"9","[colorize:red:200","mys_n_l_9.png",""},
{"10","[colorize:blue:200","mys_n_l_1.png^mys_n_l_10.png","mys_n_l_smid.png"},
{"11","[colorize:yellow:200","mys_n_l_1.png^mys_n_l_11.png","mys_n_l_ladbot.png"},
{"12","[colorize:green:200","mys_n_l_1.png^mys_n_l_12.png",""},
{"13","[colorize:red:200","mys_n_l_1.png^mys_n_l_13.png",""},
{"14","[colorize:blue:200","mys_n_l_1.png^mys_n_l_14.png","mys_n_l_ladmid.png"},
{"15","[colorize:yellow:200","mys_n_l_1.png^mys_n_l_15.png","mys_n_l_shead.png"},
{"16","[colorize:green:200","mys_n_l_1.png^mys_n_l_16.png",""},
{"17","[colorize:red:200","mys_n_l_1.png^mys_n_l_17.png","mys_n_l_stail.png"},
{"18","[colorize:blue:200","mys_n_l_1.png^mys_n_l_18.png","mys_n_l_ladtop.png"},
{"19","[colorize:yellow:200","mys_n_l_1.png^mys_n_l_19.png",""},
{"20","[colorize:green:200","mys_n_l_2.png^mys_n_l_10.png","mys_n_l_smid.png"},
{"21","[colorize:red:200","mys_n_l_2.png^mys_n_l_11.png",""},
{"22","[colorize:blue:200","mys_n_l_2.png^mys_n_l_12.png",""},
{"23","[colorize:yellow:200","mys_n_l_2.png^mys_n_l_13.png","mys_n_l_ladtop.png"},
{"24","[colorize:green:200","mys_n_l_2.png^mys_n_l_14.png",""},
{"25","[colorize:red:200","mys_n_l_2.png^mys_n_l_15.png",""},
{"26","[colorize:blue:200","mys_n_l_2.png^mys_n_l_16.png","mys_n_l_ladbot.png"},
{"27","[colorize:yellow:200","mys_n_l_2.png^mys_n_l_17.png","mys_n_l_stail.png"},
{"28","[colorize:green:200","mys_n_l_2.png^mys_n_l_18.png",""},
{"29","[colorize:red:200","mys_n_l_2.png^mys_n_l_19.png","mys_n_l_shead.png"},
{"30","[colorize:blue:200","mys_n_l_3.png^mys_n_l_10.png",""},
{"31","[colorize:red:200","mys_n_l_3.png^mys_n_l_11.png",""},
{"32","[colorize:blue:200","mys_n_l_3.png^mys_n_l_12.png",""},
{"33","[colorize:yellow:200","mys_n_l_3.png^mys_n_l_13.png",""},
{"34","[colorize:green:200","mys_n_l_3.png^mys_n_l_14.png","mys_n_l_shead.png"},
{"35","[colorize:red:200","mys_n_l_3.png^mys_n_l_15.png","mys_n_l_ladtop.png"},
{"36","[colorize:blue:200","mys_n_l_3.png^mys_n_l_16.png",""},
}
for i in ipairs(board_parts) do
local num = board_parts[i][1]
local col = board_parts[i][2]
local number = board_parts[i][3]
local sorl = board_parts[i][4]
minetest.register_node("mys_n_l_mini:board_block"..num,{
description = "Block "..num,
tiles = {
"mys_n_l_base.png^"..col.."^mys_n_l_edge.png^"..sorl.."^"..number,
"mys_n_l_base.png^"..col.."mys_n_l_edge.png",
"mys_n_l_base.png^"..col.."mys_n_l_edge.png",
"mys_n_l_base.png^"..col.."mys_n_l_edge.png",
"mys_n_l_base.png^"..col.."mys_n_l_edge.png",
"mys_n_l_base.png^"..col.."mys_n_l_edge.png"
},
drawtype = "normal",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=1,not_in_creative_inventory = 1},
})
end
minetest.register_node("mys_n_l_mini:placer",{
description = "Snakes and Ladders Mini",
inventory_image = "mys_n_l_base.png^mys_n_l_ladmid.png^mys_n_l_edgem.png",
tiles = {
"mys_n_l_base.png^mys_n_l_ladmid.png^mys_n_l_edgem.png"
},
drawtype = "normal",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=3},
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local schem = minetest.get_modpath("mys_n_l_mini").."/schems/mys_n_l_mini.mts"
minetest.place_schematic({x=pos.x,y=pos.y,z=pos.z},schem,0, "air", true)
end,
})
local pieces = {
{"Red","red","^[colorize:red:120"},
{"Green","green","^[colorize:green:120"},
{"Yellow","yellow","^[colorize:yellow:120"},
{"Blue","blue","^[colorize:blue:120"},
}
for i in ipairs (pieces) do
local desc = pieces[i][1]
local item = pieces[i][2]
local col = pieces[i][3]
minetest.register_node("mys_n_l_mini:"..item,{
description = desc.." Player",
tiles = {"default_gravel.png"..col},
drawtype = "nodebox",
paramtype = "light",
light_source = 11,
groups = {cracky = 1, dig_immediate=3, not_in_creative_inventory=1},
node_box = {
type = "fixed",
fixed = {
{-0.3125, -0.5, -0.3125, 0.3125, -0.3125, 0.3125},
{-0.125, -0.3125, -0.125, 0.125, 0.125, 0.125},
{-0.1875, 0.125, -0.1875, 0.1875, 0.3125, 0.1875},
}
}
})
end
dofile(minetest.get_modpath("mys_n_l_mini").."/dice.lua")

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 162 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 178 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 160 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 172 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 166 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 165 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 163 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 167 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 168 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 159 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 170 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 230 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 218 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 211 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 864 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 843 B