diff --git a/pieces.lua b/pieces.lua index 5f46a74..77a50d3 100644 --- a/pieces.lua +++ b/pieces.lua @@ -21,7 +21,9 @@ for color = 1, 2 do { description = 'Pawn', groups = {snappy = 2}, - tiles = {"chess_piece_"..colors[color]..".png"}, + tiles = {"chess_piece_"..colors[color].."_top.png", "chess_piece_"..colors[color].."_top.png", + "chess_piece_"..colors[color]..".png", "chess_piece_"..colors[color]..".png", + "chess_piece_"..colors[color].."_side.png", "chess_piece_"..colors[color].."_side.png"}, drawtype = "nodebox", sunlight_propagates = true, paramtype = 'light', @@ -51,7 +53,9 @@ for color = 1, 2 do { description = 'Rook', groups = {snappy = 2}, - tiles = {"chess_piece_"..colors[color]..".png"}, + tiles = {"chess_piece_"..colors[color].."_top.png", "chess_piece_"..colors[color].."_top.png", + "chess_piece_"..colors[color]..".png", "chess_piece_"..colors[color]..".png", + "chess_piece_"..colors[color].."_side.png", "chess_piece_"..colors[color].."_side.png"}, drawtype = "nodebox", sunlight_propagates = true, paramtype = 'light', @@ -86,14 +90,13 @@ for color = 1, 2 do }) --Knight - - --Bishop - - minetest.register_node("chess:bishop_"..colors[color], + minetest.register_node("chess:knight_"..colors[color], { - description = 'bishop', + description = 'Knight', groups = {snappy = 2}, - tiles = {"chess_piece_"..colors[color]..".png"}, + tiles = {"chess_piece_"..colors[color].."_top.png", "chess_piece_"..colors[color].."_top.png", + "chess_piece_"..colors[color]..".png", "chess_piece_"..colors[color]..".png", + "chess_piece_"..colors[color].."_side.png", "chess_piece_"..colors[color].."_side.png"}, drawtype = "nodebox", sunlight_propagates = true, paramtype = 'light', @@ -102,19 +105,137 @@ for color = 1, 2 do node_box = { type = "fixed", fixed = { - {-0.2, -0.8, -0.3, 0.2, -0.4, 0.3}, - + {-0.2, -0.5, -0.3, 0.2, -0.4, 0.3}, + {-0.3, -0.5, -0.2, 0.3, -0.4, 0.2}, + {-0.1, -0.4, -0.2, 0.1, -0.3, 0.2}, + {-0.2, -0.4, -0.1, 0.2, -0.3, 0.1}, + {-0.1, -0.3, -0.1, 0.1, 0.45, 0.1}, + {-0.1, -0.2, -0.2, 0.1, 0.1, 0.15}, + {-0.15, -0.2, -0.1, 0.15, 0.1, 0.1}, + {-0.1, 0.2, -0.25, 0.1, 0.35, 0.15}, + {-0.1, 0.45, 0.01, -0.07, 0.5, 0.06}, + {0.07, 0.45, 0.01, 0.1, 0.5, 0.06}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + }, + groups = piece_group + }) + + --Bishop + + minetest.register_node("chess:bishop_"..colors[color], + { + description = 'Bishop', + groups = {snappy = 2}, + tiles = {"chess_piece_"..colors[color].."_top.png", "chess_piece_"..colors[color].."_top.png", + "chess_piece_"..colors[color]..".png", "chess_piece_"..colors[color]..".png", + "chess_piece_"..colors[color].."_side.png", "chess_piece_"..colors[color].."_side.png"}, + drawtype = "nodebox", + sunlight_propagates = true, + paramtype = 'light', + paramtype2 = "facedir", + light_source = 8, --max light is 18 + node_box = { + type = "fixed", + fixed = { + {-0.2, -0.5, -0.3, 0.2, -0.4, 0.3}, + {-0.3, -0.5, -0.2, 0.3, -0.4, 0.2}, + {-0.1, -0.4, -0.2, 0.1, -0.3, 0.2}, + {-0.2, -0.4, -0.1, 0.2, -0.3, 0.1}, + {-0.1, -0.3, -0.1, 0.1, 0.4, 0.1}, + {-0.1, 0, -0.2, 0.1, 0.1, 0.2}, + {-0.2, 0, -0.1, 0.2, 0.1, 0.1}, + {-0.1, 0.15, -0.2, 0.1, 0.35, 0.2}, + {-0.2, 0.15, -0.1, 0.2, 0.35, 0.1 }, + {-0.05, 0.4, -0.05, 0.05, 0.5, 0.05}, }, }, selection_box = { type = "fixed", - fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3}, + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, }, groups = piece_group }) --Queen + minetest.register_node("chess:queen_"..colors[color], + { + description = 'Queen', + groups = {snappy = 2}, + tiles = {"chess_piece_"..colors[color].."_top.png", "chess_piece_"..colors[color].."_top.png", + "chess_piece_"..colors[color]..".png", "chess_piece_"..colors[color]..".png", + "chess_piece_"..colors[color].."_side.png", "chess_piece_"..colors[color].."_side.png"}, + drawtype = "nodebox", + sunlight_propagates = true, + paramtype = 'light', + paramtype2 = "facedir", + light_source = 8, --max light is 18 + node_box = { + type = "fixed", + fixed = { + {-0.2, -0.5, -0.3, 0.2, -0.4, 0.3}, + {-0.3, -0.5, -0.2, 0.3, -0.4, 0.2}, + {-0.1, -0.4, -0.2, 0.1, -0.3, 0.2}, + {-0.2, -0.4, -0.1, 0.2, -0.3, 0.1}, + {-0.1, -0.3, -0.1, 0.1, 0.2, 0.1}, + {-0.1, 0, -0.2, 0.1, 0.1, 0.2}, + {-0.2, 0, -0.1, 0.2, 0.1, 0.1}, + {-0.1, 0.2, -0.2, 0.1, 0.4, 0.2}, + {-0.2, 0.2, -0.1, 0.2, 0.4, 0.1}, + {-0.07, 0.4, -0.19, 0.07, 0.44, -0.11}, + {-0.07, 0.4, 0.11, 0.07, 0.44, 0.19}, + {-0.19, 0.4, -0.07, -0.11, 0.44, 0.07}, + {0.11, 0.4, -0.07, 0.19, 0.44, 0.07}, + {-0.04, 0.4, -0.07, 0.04, 0.46, 0.07}, + {-0.07, 0.4, -0.04, 0.07, 0.46, 0.04}, + {-0.04, 0.46, -0.04, 0.04, 0.49, 0.04}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + }, + groups = piece_group + }) --King + minetest.register_node("chess:king_"..colors[color], + { + description = 'King', + groups = {snappy = 2}, + tiles = {"chess_piece_"..colors[color].."_top.png", "chess_piece_"..colors[color].."_top.png", + "chess_piece_"..colors[color]..".png", "chess_piece_"..colors[color]..".png", + "chess_piece_"..colors[color].."_side.png", "chess_piece_"..colors[color].."_side.png"}, + drawtype = "nodebox", + sunlight_propagates = true, + paramtype = 'light', + paramtype2 = "facedir", + light_source = 8, --max light is 18 + node_box = { + type = "fixed", + fixed = { + {-0.2, -0.5, -0.3, 0.2, -0.4, 0.3}, + {-0.3, -0.5, -0.2, 0.3, -0.4, 0.2}, + {-0.1, -0.4, -0.2, 0.1, -0.3, 0.2}, + {-0.2, -0.4, -0.1, 0.2, -0.3, 0.1}, + {-0.1, -0.3, -0.1, 0.1, 0.2, 0.1}, + {-0.1, 0, -0.2, 0.1, 0.1, 0.2}, + {-0.2, 0, -0.1, 0.2, 0.1, 0.1}, + {-0.1, 0.2, -0.2, 0.1, 0.4, 0.2}, + {-0.2, 0.2, -0.1, 0.2, 0.4, 0.1}, + {-0.02, 0.4, -0.02, 0.02, 0.5, 0.02}, + {-0.02, 0.43, -0.05, 0.02, 0.47, 0.05}, + {-0.05, 0.43, -0.02, 0.05, 0.47, 0.02}, + }, + }, + selection_box = { + type = "fixed", + fixed = {-0.3, -0.5, -0.3, 0.3, 0.5, 0.3}, + }, + groups = piece_group + }) end diff --git a/textures/chess_piece_black_side.png b/textures/chess_piece_black_side.png new file mode 100644 index 0000000..981c024 Binary files /dev/null and b/textures/chess_piece_black_side.png differ diff --git a/textures/chess_piece_black_top.png b/textures/chess_piece_black_top.png new file mode 100644 index 0000000..79bf1f2 Binary files /dev/null and b/textures/chess_piece_black_top.png differ diff --git a/textures/chess_piece_white_side.png b/textures/chess_piece_white_side.png new file mode 100644 index 0000000..6b785cc Binary files /dev/null and b/textures/chess_piece_white_side.png differ diff --git a/textures/chess_piece_white_top.png b/textures/chess_piece_white_top.png new file mode 100644 index 0000000..eceb15c Binary files /dev/null and b/textures/chess_piece_white_top.png differ