Java Chess Programming Video #31 The GUI (Part III)

preview_player
Показать описание

Chess Code Repository :

IDE:

Reading Material:
Рекомендации по теме
Комментарии
Автор

Hi guys, I think the following implementation of assignTileColour() also works:

private void assignTileColour() {
boolean isLight = ((tileId + tileId / 8) % 2 == 0);
setBackground(isLight ? lightTileColor : darkTileColor);
}

hazzsin
Автор

At the top of the file I've declared the lightTileColor and darkTile color as such:

private final Color lightTileColor = Color.decode("#FFFACD");
private final Color darkTileColor = Color.decode("#593E1A");

amir
Автор

Personally I like little bit longer videos 15-20min

RUFFRIDE
Автор

I have a little gap underneath the chess board, similar to a tile row dimension. I've looked through the code again and again. Do you have any ideas what it could be? Could be from different screen sizes?

TheKmert
Автор

Thanks Amir. I'm fairly new to java. but love chess and would love to build an engine. Also want to improve my developer skills and would love to develop a variation of chess i love. Good place to start :D which is why my searches found this.

Few questions I have;

For Gui, Episode#31, you went to BoardUtils and defined the Rows as:
public static final boolean[] FIRST_ROW = initRow(0); ... public static final boolean[] EIGTHT_ROW = initRow(56);
Shouldnt that be the other way round like this?
public static final boolean[] FIRST_ROW = initRow(56); ... public static final boolean[] EIGTHT_ROW = initRow(0);

For Moves, I can wait till we complete the GUI and start testing, but the questions i have waiting

The Board execute for AttackMove has not been overwritten? We will end up writing 2 pieces to the attacked piece square?

PawnEnPassantAttackMovt. I'm struggling to see how this is going to work unless we are just planning on flushing it out at a later date. The Attacking Pawn doesnt end up on the same square as the EnPasssant Pawn. Again Board execute needs overwritten? And not seeing exactly how enPassant enters legalMoves collection.

As mentioned queenside castling through check.

cant wait to have the test board up and running and then to see how the hashCodes get implemented. 1 million games makes a great place to see how that logic gets implemented..

keep up the good work.

iansweeney
Автор

So im trying to write parts of your tutorial in javaFX. I don`t understand that the validate() method does and what the javaFX equivalent is. Any idea`s? On stackoverflow it was hard to find.

BoudieBatsnikov
Автор

How do we limit the size ratio so it doesn't stretch when we drag to resize the window?

shekinahstarkey
Автор

1) In board panel, what is the point of creating an arrayList of tiles and adding each one to the list. Isn't adding to the the board panel it self what creates GUI board
2) ARE the dimensions for the board and tile non mandatory b/c when I don't include them, the sizing turns out the same as yours.
Im not familiar with swing. But I want to try to understand as there r more libraries associated with swing than FX
3) In assign piece tile icon, why r we removing everything off the board initially

mikhailpalagashvili
Автор

URGENT!! I NEEDED HELP
Firstly, amazing videos man, for some reason idk why my comment isn't getting posted whenever I add the error I'm getting.
So basically after making the table in the first gui video and when I run the jframe
It throws the cannot establish king exception
So i sort of needed help ASAP as this is my college project

AbdulRahman-jpbr
Автор

I dont care about the lenth as long as your typing code even if its 30 mins

Gurdeepsingh-qfis
Автор

I'm having this error and so far couldn't solve it:

Exception in thread "main" java.lang.RuntimeException: Not a valid board.
at
at
at
at
at
at
at

Can someone help me? Thank you.

Cecil_Augus