Thread: Trying to make a checkers game..

  1. #1
    Registered User
    Join Date
    May 2011
    Posts
    19

    Trying to make a checkers game..

    Hi, I'm trying to make a checkers game and at the moment I have all the pieces shown on the board and you can move them around freely, but I'm having trouble thinking of how to get it to A) make the players take turns (they're both human players) and B)restrict the movement to 2 diagonal blocks left our right.

    So if anyone could tell me how to proceed or point me in the direction of a good site explaining how it would be much appreciated.

    It would probably help to post some of my code but I'm that stuck I don't have a clue which part to show you!

    Thanks if anyone can help.

  2. #2
    Registered User
    Join Date
    May 2011
    Posts
    19
    Can nobody shed any light on this?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,659
    Well a very simple alternating player loop is this, which simply toggles 0,1,0,1,0,1 ad nauseum
    Code:
    int player = 0;
    do {
      play(player);
      player ^= 1;
    } while ( 1 );
    As for diagonals, you only have 4 directions from a given point
    -2,-2
    -2,+2
    +2,+2
    +2,-2

    The sooner you figure out there isn't always going to be "a site to explain.....", the better you'll be.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

  4. #4
    Algorithm Dissector iMalc's Avatar
    Join Date
    Dec 2005
    Location
    New Zealand
    Posts
    6,318
    Those sound like the same kind of issues I solved when making a checkers Starcraft2 map.
    What are you using to make your version?
    My homepage
    Advice: Take only as directed - If symptoms persist, please see your debugger

    Linus Torvalds: "But it clearly is the only right way. The fact that everybody else does it some other way only means that they are wrong"

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. omg i need help using c++ to make a game
    By zenchiX in forum Game Programming
    Replies: 18
    Last Post: 06-10-2006, 06:48 AM
  2. C++ Checkers Game
    By SnS CEO in forum C++ Programming
    Replies: 9
    Last Post: 09-07-2005, 01:21 AM
  3. Jump moves in Checkers Game
    By Reb0270 in forum C++ Programming
    Replies: 2
    Last Post: 04-08-2004, 01:06 PM
  4. What do you need to make a game?
    By makveli in forum Game Programming
    Replies: 13
    Last Post: 11-12-2003, 07:02 PM
  5. IDEA: Checkers game
    By confuted in forum Contests Board
    Replies: 0
    Last Post: 06-28-2003, 03:25 PM