Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Checkers game.

 
Timmy Ryan
Ranch Hand
Posts: 63
IntelliJ IDE Java Redhat
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am creating a checkers/draughts game in swing and am a bit unsure about whether to use MVC or not in the design.
This is a project for college and the main focus of it is the algorithms that decide on the next move for the computer, not the UI.

There will be a main JPanel onto which the board will be drawn. After a move is made by the human a MouseListener method will signal to the computer to compute the next move.
This will be done in a class that extends SwingWorker.

Model : In this case would be game state, number of pieces etc.
View : The UI for the game, would call the controller to calculate the next move.
Controller : The part of the game that decides on the next move.

Do I need to do much more on the design, I don't know where to start?
 
Madhan Sundararajan Devaki
Ranch Hand
Posts: 312
Java MS IE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe, Model will just be your Game State.

I believe, View (UI) needs to be enhanced to display the Checker Board, the different types (Shapes/colours) of Checkers and should handle user events.

You are right about the Controller, however, in addition, it should also prompt View to re-draw the Checker Board after every successful move.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic