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: http://www.pouet.net/prod.php?which=64962
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.
Nice game, I had fun playing it with my kid.
One minor annoyance is the screen going black immediately after a checkmate, I didn't have time to explain why the board position resulted in a checkmate.
@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.
@mrh I would really love to have an article about your Chess game into the next pico8 zine, please contact me to [email protected] if interested.
The lack of castling and the other features is a bit sad, but it's still fun! My one complaint is that the queen and king sprites seem to be flip flopped. The king sprite in standard online chess is represented by this crown.
been struggling with move generation in my own carts. this cart has a very clear, procedural way of doing it that I can follow. thank you.
[Please log in to post a comment]