• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Checkers game.

 
Ranch Hand
Posts: 63
IntelliJ IDE Redhat Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Ranch Hand
Posts: 312
MS IE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
reply
    Bookmark Topic Watch Topic
  • New Topic