ID:79167
 
Keywords: bgc, chess, development
As mentioned in previous comments, I'm frightened of getting into imposition and pinning again because I never mastered it the first time around. So, in an effort to avoid getting to it for as long as possible, I started with castling.



As we can see here, the king's castling moves are highlighted as legal when the (numerous) conditions are met to allow the move. Originally, I was going to mark the rook as the movement target as I did in the previous version, but this would have required working around code I had already established long ago that only allowed a piece to occupy the same space as another if it was capturing it. I figured this worked better in the long run, since the destination squares of the castle move are highlighted instead of the rook pieces and may end up conveying a clearer message of "hey, you can legally castle".

In this next shot, we see the kingside rook has abandoned h1:



...and we see that the king can no longer castle kingside. Then, just as our dashing protagonist is about to castle queenside, the evil queen from yesterday appears!



The evil queen has effectively prevented the king from castling, since he's too chicken to pass through her line of sight. Fortunately, the queen occupies herself elsewhere and allows our hero to castle again:



Without hesitation, the nervous king castles with his queenside rook and retreats behind it:



Now that the king is safe, two pawns appear on the board. The white pawn rushes to c5, as if moving out of turn like he had something to demonstrate:



Using our square highlight-o-vision, we can see that the black pawn indeed has his two-square hop available to him:



And he decided to make the leap, landing on the safety of b5. He snickered to himself, looking upon the white pawn he had just avoided capture from. Little did he know, though, that this pawn was well versed in French:



The black pawn cowered in fear and attempted to beg for his life, but the vindictive white pawn would have his revenge, marching to b6 and spearing his foe along the way. He came to a stop, wiping his weapon in the grass and smirking. "En passant."



The very same pawn progressed to b7 without hesitation, somehow not having to wait like a piece on a chessboard with its' turn-taking rules disabled:



And he stepped upon the wonders of the eighth rank, feeling strange. He felt himself transform, his movements freer, his capturing rules simpler, his mortal coil being shucked away as his essence was deposited into another shell... a female shell. "I like where this is going."



She was no longer a mere pawn, oh no. She was now queen of the white kingdom! She cackled evilly, all remaining black pieces shivering in fear.

...

Random storytelling aside, the player is allowed to choose which piece he wants to promote to, I had just happened to select a queen for the screenshot. I also managed to fit in one more feature before I quit for the day, and that is the highlight of the enemy's last moved piece.



The highlight persists even if disabled in the options, so you could turn it off and back on and still see the proper piece highlighted. It's just a little bit of extra help for the novices like myself. Oh yeah, that larger knight in the corner is the turn indicator. It turns black when it's black's turn.

All in all, I'd call today productive.
Very cool indeed!

So when can we have a game?
Tiberath wrote:
Very cool indeed!

So when can we have a game?

Not too terribly long, I'd imagine. About all that remains is rider imposition and piece pinning (eek) and zipping up the game structure (making sure each player can only select their own pieces in turn, etc.)
If I find bugs do I get points? By the way, will this still have the movement log? You should try to incorporate some form of rating system if ELO is still too complicated. :P
SpikeNeedle wrote:
If I find bugs do I get points? By the way, will this still have the movement log? You should try to incorporate some form of rating system if ELO is still too complicated. :P

There will be a movement log again, though I certainly strung out everything that can generate a movement. One of the largest problems I'm having is that castling counts as a king movement, a rook movement, and a castle, so I end up with something like

Kc1
Rd1
O-O-O

for a single move.

As for ELO, I have yet to demystify even a small portion of that.