Added header
parent
543cd1abc0
commit
9aeef43789
153
pieces.lua
153
pieces.lua
|
@ -1,72 +1,81 @@
|
||||||
--This file declares all the pieces for the game
|
-- CHESS MOD
|
||||||
|
-- ======================================
|
||||||
local colors = {"black", "white",}
|
-- chess/pieces.lua
|
||||||
|
-- ======================================
|
||||||
--make a loop which makes the black and white nodes and crafting recipes
|
-- Registers the chess pieces
|
||||||
|
--
|
||||||
for color = 1, 2 do
|
-- Contents:
|
||||||
--Pawn
|
--
|
||||||
minetest.register_node(":chess:pawn_"..colors[color],
|
-- [loop] registers pieces
|
||||||
{
|
-- ======================================
|
||||||
description = 'pawn',
|
|
||||||
groups = {snappy = 2},
|
local colors = {"black", "white",}
|
||||||
tiles = {"chess_piece_"..colors[color]..".png"},
|
|
||||||
drawtype = "nodebox",
|
--make a loop which makes the black and white nodes and crafting recipes
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = 'light',
|
for color = 1, 2 do
|
||||||
paramtype2 = "facedir",
|
--Pawn
|
||||||
light_source = 8, --max light is 18
|
minetest.register_node(":chess:pawn_"..colors[color],
|
||||||
node_box = {
|
{
|
||||||
type = "fixed",
|
description = 'pawn',
|
||||||
fixed = {
|
groups = {snappy = 2},
|
||||||
{-0.3, -0.5, -0.3, 0.2, -0.4, 0.3},
|
tiles = {"chess_piece_"..colors[color]..".png"},
|
||||||
{-0.3, -0.5, -0.3, 0.2, -0.4, 0.3},
|
drawtype = "nodebox",
|
||||||
{-0.1, -0.4, -0.2, 0.1, -0.3, 0.2},
|
sunlight_propagates = true,
|
||||||
{-0.2, -0.4, -0.1, 0.2, -0.3, 0.1},
|
paramtype = 'light',
|
||||||
{-0.1, -0.3, -0.1, 0.1, 0.2, 0.1},
|
paramtype2 = "facedir",
|
||||||
{-0.2, -0.1, -0.1, 0.2, 0.1, 0.1},
|
light_source = 8, --max light is 18
|
||||||
{-0.1, -0.1, -0.2, 0.1, 0.1, 0.2},
|
node_box = {
|
||||||
},
|
type = "fixed",
|
||||||
},
|
fixed = {
|
||||||
selection_box = {
|
{-0.3, -0.5, -0.3, 0.2, -0.4, 0.3},
|
||||||
type = "fixed",
|
{-0.3, -0.5, -0.3, 0.2, -0.4, 0.3},
|
||||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
|
{-0.1, -0.4, -0.2, 0.1, -0.3, 0.2},
|
||||||
},
|
{-0.2, -0.4, -0.1, 0.2, -0.3, 0.1},
|
||||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
{-0.1, -0.3, -0.1, 0.1, 0.2, 0.1},
|
||||||
})
|
{-0.2, -0.1, -0.1, 0.2, 0.1, 0.1},
|
||||||
|
{-0.1, -0.1, -0.2, 0.1, 0.1, 0.2},
|
||||||
--Rook
|
},
|
||||||
|
},
|
||||||
--Knight
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
--Bishop
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
|
||||||
|
},
|
||||||
minetest.register_node(":chess:bishop_"..colors[color],
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
||||||
{
|
})
|
||||||
description = 'bishop',
|
|
||||||
groups = {snappy = 2},
|
--Rook
|
||||||
tiles = {"chess_piece_"..colors[color]..".png"},
|
|
||||||
drawtype = "nodebox",
|
--Knight
|
||||||
sunlight_propagates = true,
|
|
||||||
paramtype = 'light',
|
--Bishop
|
||||||
paramtype2 = "facedir",
|
|
||||||
light_source = 8, --max light is 18
|
minetest.register_node(":chess:bishop_"..colors[color],
|
||||||
node_box = {
|
{
|
||||||
type = "fixed",
|
description = 'bishop',
|
||||||
fixed = {
|
groups = {snappy = 2},
|
||||||
{-0.2, -0.8, -0.3, 0.2, -0.4, 0.3},
|
tiles = {"chess_piece_"..colors[color]..".png"},
|
||||||
|
drawtype = "nodebox",
|
||||||
},
|
sunlight_propagates = true,
|
||||||
},
|
paramtype = 'light',
|
||||||
selection_box = {
|
paramtype2 = "facedir",
|
||||||
type = "fixed",
|
light_source = 8, --max light is 18
|
||||||
fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
|
node_box = {
|
||||||
},
|
type = "fixed",
|
||||||
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
fixed = {
|
||||||
})
|
{-0.2, -0.8, -0.3, 0.2, -0.4, 0.3},
|
||||||
|
|
||||||
--Queen
|
},
|
||||||
|
},
|
||||||
--King
|
selection_box = {
|
||||||
|
type = "fixed",
|
||||||
end
|
fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
|
||||||
|
},
|
||||||
|
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
|
||||||
|
})
|
||||||
|
|
||||||
|
--Queen
|
||||||
|
|
||||||
|
--King
|
||||||
|
|
||||||
|
end
|
||||||
|
|
Loading…
Reference in New Issue