Hi ! I am going to start making a simple checkers game. Could any one give an idea which part to begin with and any good resource that i can learn from? What actually i can do in the initialise and draw functions
Thanks.
Code:#include"ccc_win.h" // main function for the execution of a graphics program int ccc_win_main() { // piece positions on the board const int numRows = 8; const int numCols = 8; int board[8][8]; // rowsxcolumns 8x8 square of a checkers board int new_game ; int exit_program; // result of the game int result ; do { Initialise(board); // calling Initialise function Draw(board); // calling Draw function result = PlayGame(board); // calling play function // wait for new game or exit game button click while (result != new_game && result != exit_program) { // get a mouse Click } } while(result == new_game); return 0 ; } // Function to initialize the board void Initialise(int board) { // to draw a base big 8x8 square with small square drawn alternatively on top of the board PenWidth pen1 = PenWidth(5); PenColour redPen = PenColour(255 , 0,0); PenColour blackPen = PenColour(0,0,0); PenWidth penB = PenWidth(5); BrushColour blackBrush = BrushColour(0,0,0); // Line and points for the line Point origin(0,0); Point p(4 , 3); Point p1(-7,7) , p2(7,7); Line myLine(origin , p); Rectangle square(p1 , p2); // to draw a black border of the board draw rectangle cwin<< penB << blackBrush << square ; } // Function to draw the board void Draw(int board) { } }




Reply With Quote
