Chess

An exercise in the MVC programming pattern.

Controls

SpaceRestart
Left ArrowUndo
1-6Tests

Info

As an exercise in separating data, visuals and input, I wrote Chess in Unity using the MVC pattern.

  • Loads an initial board state, then adds each move to an action stack that can be undone using the Left Arrow button.
  • Implements and visualizes valid moves, check, and check mate.
  • Prevents players from placing their own king in check.
  • Forces players into dealing with check if possible.
  • Does not implement castling, en passant, or stalemate.

Thanks

Thanks to @rhys-vdw for being a tremendous help in figuring out how this stuff works.
Chess font: Cases.

StatusPrototype
PlatformsHTML5
Rating
Rated 4.0 out of 5 stars
(1 total ratings)
AuthorFurl
GenreStrategy
Average sessionA few seconds
InputsKeyboard, Mouse

Comments

Log in with itch.io to leave a comment.

Always nice to play a little chess.
The UI looks aaalright, just that if you're gonna make chess, please don't highlight all possible moves, just the legal ones.
Playing Bullet versus myself went quite well, and the controls are just like any other chess game. I like it.

Thanks for the feedback, and for actually playing a round! Incorporating deeper checks was out of scope for this demo, but I'd like if I said the temptation wasn't there lol.

(1 edit)

Your idea for a development project is quite interesting, I like the adventurous spirit. This demo can go a long way, though, if you're not planning to make your own Stockfish (StockFurl?) or something else really interesting then i wouldn't see much of a reason to go further with it

Yeah I agree, as a jumping off point for something a bit more unique it was fun, but it'd be better to move the learnings over to something new. Really appreciate the input and the encouragement.

Your chess works correctly, except for the cases specified in the description of the game. When I saw the brief description, I first wondered how playing chess would help me master the "Model-View-Controller"? It was only after a while that I realized that the exercise was development and not the process of playing the game:)

(+1)

Haha yeah, I was trying to learn how to separate the state (data) of the game from the visual representation of it. This lets me run simulations on pure data (for AI, etc.), or maybe swap out the front end if I wanted to use a different renderer. Thanks for checking it out!