2 player chess. Arrows to move, button 1 to select a piece and confirm a move, button 2 to deselect.
En passant, castling, and pawn promotion don't work. Because they're complicated. I'm going to try and make an improved version soon which will have these rules working properly. This is why it's v0.95.
If you're going to look at the code, be warned: here be dragons. Its messy. Also white and black are swapped in the code from what they actually are in the game. Don't ask.
Nicely done! The basics all seem to be there.
It might be more intuitive to use button 1 on the selected piece to deselect. That might free up button 2 for a menu UI or something for when you add more features.
I could list all the features of a typical chess program as suggestions, but that's probably not useful to you. :) Resetting and undoing would be cool, though. Right now I have to reboot the machine to restart.
Thanks for the feedback. You're definitely right about restarting after checkmate.
Here's my internal list of features for v1.0:
- fix en passant and castling
- sound (nothing too intrusive, a light background tune and some blips for actions)
- menu with some stats about the game in progress, probably accessed by button 2 with nothing selected
- restart after checkmate/game end + a better ending screen with some stats maybe?
Very open to suggestions.
I don't think I'm going to go for a 1 player mode or ai because I'm not smart enough and it might be hard to fit into a cartridge.
If you do decide to take it this far, there are a few famous tiny chess AIs with source that could be ported.
Toledo Nanochess (with JS and C src): http://nanochess.org/chess4.html
Toledo Nanochess Wikipedia page with C src: https://en.wikipedia.org/wiki/Toledo_Nanochess
BootChess src: http://olivier.poudade.free.fr/src/BootChess.asm
The Wikipedia article on Atari 2600 Video Chess suggests that castling and en passant were considered optional features of some very early chess programs, so you're in good company. :) https://en.wikipedia.org/wiki/Video_Chess
Yeah, en passant and castling are kind of a pain because they're more stateful than any other move (you can't just look at the current board, you need to remember past events: whether the king has moved and whether a pawn moved 2 squares last turn).
I've just added highlight of all squares a selected piece can move to which improves usability a lot I think.
@briac: Thanks, that's great to hear.
I've uploaded a slightly updated version with some usability type improvements: highlight of possible moves, click on the selected piece to deselect, check notifications, simple sounds, improved gameover screen where you can view the endgame board.
I'll wade into the logic to fix the remaining mechanics soon.
[Please log in to post a comment]