rubenwardy wrote:Good idea, the rule coding will be hardest
Also, what is the size?
Solution:
I suggest using a real sized board and
use a "door" spawn like thing so when you place a chess spawner block, the black and white appears around it
No Rules, Players can move the pieces around, but it is not determened if they have won, the players have to notice like in real life.
Maybe if you click the spawn block all the pieces go back to the original.
minetest.register_node("chess:pawn",
{description = 'pawn',
tiles = {"default_wood.png"},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
light_source = 15, --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.2, -0.4, 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},
{-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},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
}),
tonyka wrote:this is the minimum version for the shape of pawn
Nodebox pawn:Your phone or window isn't wide enough to display the code box. If it's a phone, try rotating it to landscape mode.
- Code: Select all
minetest.register_node("chess:pawn",
{description = 'pawn',
tiles = {"default_wood.png"},
drawtype = "nodebox",
sunlight_propagates = true,
paramtype = 'light',
paramtype2 = "facedir",
light_source = 15, --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.2, -0.4, 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},
{-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},
},
},
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, 0.2, 0.3},
},
groups = {snappy=2,choppy=2,oddly_breakable_by_hand=2}
}),
other textures that suggest:
white pieces: default_lava.png
black pieces: default_water.png
not promise anything, but if I have some time, I'll do the rest of figures ...
rubenwardy wrote:
You have two light_source properties there.
minetest.env:add_node( pos, { name = 'doors:door_wood_a_c', param2 = newparam } )
minetest.register_on_placenode( on_door_placed ) --Used to setup chess board
minetest.register_on_punchnode( on_door_punched ) --Used to reset board
--In a function called on chess:spawn's placing
local x=0
local z=0
local color=0
for (x=1;x<9;x++) --To make 8 rows (9-1)
for (z=0;z<8;z++) --To make 8 cols (8-0)
pos=new position(x, -- , z)
if color==0
minetest.env:add_node(pos , chess:board_black )
else
minetest.env:add_node(pos , chess:board_white )
end if
color=1-color --Toggles color between 1 and 0.
next
next
chesspiece, chesspiece, chesspiece
chesspiece, chesspiece, chesspiece
chesspiece, chesspiece, chesspiece
bwool, wwool, bwool
wwool, mese, wwool
bwool, wwool, bwool
rubenwardy wrote:Here we are https://github.com/rubenwardy/Minetest-Chess-Mod.
If you want me to add you as an admin / transfer ownership, tell me
Bas080 wrote:rubenwardy wrote:Here we are https://github.com/rubenwardy/Minetest-Chess-Mod.
If you want me to add you as an admin / transfer ownership, tell me
I'm happy to see that you and others are excited about this idea.
Rubenwardy, i don't mind not being the owner. I would however like to push code to the git.
My github name is also bas080. Please add me when you get the chance :)
rubenwardy wrote:
I think we should make it a collect able,
So it should have a long make process.
What do you think?
Bas080 wrote:rubenwardy wrote:
I think we should make it a collect able,
So it should have a long make process.
What do you think?
I'm sorry... I made my own git... the way i did it makes it easier to test the mod. It works right away. I used the template you setup. The code that has been implemented is checkers board maker. Now the pieces... and later the rules to avoid illegal moves.
I like the co-op idea. Will make separate LUA file for pieces and later for rules and interaction.
Bas080 wrote:Was thinking, should the chessboard spawn box check if the chessboard fits in the area before it it placed or should it carve out enough space(remove nodes that are in the way of the chessboard spawning).
I'm pro checking if enough place, if not do not spawn chessboard and display chat message "Not enough space to place chessboard and pieces." Then you should mine the box again and try it somewhere else.
tonyka wrote:still not very well use github, so I created a fork .. in mine ...
and I have added the rook ...
& my nick in github is "tony-ka"
Jordach wrote:I am great at playing chess, I'd love to help out.
tonyka wrote:when i finish all the pieces, could also create a frame decorated with nodebox ...
you like this idea?
tonyka wrote:ok, first I will focus on making the pieces, then think of the framework ...
to me it is very easy to draw nodebox ..
if you want something specific, give me a drawing or photograph and I reproduce it easily ...
when i finish all the pieces, could also create a frame decorated with nodebox ...
Users browsing this forum: No registered users and 18 guests