Log In  

Cart [#15045#] | Code | 2015-10-06 | No License | Embed

Cart [#14930#] | Code | 2015-10-03 | No License | Embed

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.

P#14931 2015-10-03 14:40 ( Edited 2015-11-02 21:52)

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.

P#14932 2015-10-03 15:09 ( Edited 2015-10-03 19:09)
:: mrh

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.

P#14935 2015-10-03 15:39 ( Edited 2015-10-03 19:39)

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

P#14956 2015-10-04 00:07 ( Edited 2015-10-04 04:07)
:: mrh

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.

P#14957 2015-10-04 06:07 ( Edited 2015-10-04 10:07)
:: mrh

I've just realised I'm missing another feature: pawn promotion.

P#14958 2015-10-04 06:09 ( Edited 2015-10-04 10:09)
:: briac

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.

P#15031 2015-10-06 07:47 ( Edited 2015-10-06 11:48)
:: mrh

@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.

P#15046 2015-10-06 14:10 ( Edited 2015-10-06 18:10)

@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.

P#16126 2015-11-02 16:34 ( Edited 2015-11-02 21:34)

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.

P#16127 2015-11-02 16:52 ( Edited 2015-11-02 21:52)

[Please log in to post a comment]

About | Contact | Updates | Terms of Use
Follow Lexaloffle:        
Generated 2019-08-22 11:36 | 0.045s | 4194k | Q:49