Indroduce new Piece on board #75
-
I want to add new type of piece on board other than P,N,B,R,Q,K. I want to introduce S. It will be static on board opponent pieces can capture S but S can't move to capture anyone. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Well that's an easy one! You just need So your variant probably looks something like this: final govindChess = Variant.standard().withPieces({
'S': PieceType.fromBetza('', promoOptions: PiecePromoOptions.none),
}).copyWith(
name: 'Your Variant Name',
startPosition:
'rnbqkbnr/pppppppp/8/2ssss2/2SSSS2/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1',
); Just included the start position as an example to show you how to do it. |
Beta Was this translation helpful? Give feedback.
Well that's an easy one! You just need
PieceType.fromBetza('')
(actually you could do it with the basic constructor but for a number of reasons I recommend sticking withfromBetza
). You probably also don't want to promote to this piece I guess.So your variant probably looks something like this:
Just included the start position as an example to show you how to do it.
Another thing you might want is to set
materialConditio…