Thread: My CHESS Game..

  1. #1
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683

    My CHESS Game..

    Hi All,
    Me and my friends are building a console based chess game for an assignment..... Please check it out and give me your coments... you can move around the pawns.... thats it... (note white starts first and then the black..) the other color cannot be moved without moving the proper one...

    TO move left click the pawn you want to move and to place it on a specified block ... right click the mouse button on that particular block...

    Please post your valuable sugestions.. And we are planing to add backtracking algorithms to make the computer play against the user...
    The game is not yet complete...
    You have to first extract all the files to make it run..
    Last edited by vasanth; 12-02-2002 at 08:38 PM.

  2. #2
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    only downloads no coments.. Please post your opinion.. i need opinions to improve my game...

    Thanx in Advance..

  3. #3
    Rambling Man
    Join Date
    Jan 2002
    Posts
    1,050
    hmmm it's pretty good for being in it's beginning stages. You're right that you're images do lose a lot of quality.

  4. #4
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Can you post the code you use to load the bitmaps?

  5. #5
    Registered User
    Join Date
    Dec 2001
    Posts
    126
    I liked it. I thought that it was good for it's beginning stages. But, the image quilty is definetly low. When you add the backtracking algorithms for the single player mode it will greatly improve the game, in my opinion. Over all it was good, so far.

  6. #6
    Its not rocket science vasanth's Avatar
    Join Date
    Jan 2002
    Posts
    1,683
    I changed the color to chades of balck and grey... It looks much better now.. but it would be better if i was able to display the color properly.. Any way i have attached the new chess game with the better apperance.. have a look and sugest please to make it look better.. if yiu can see my present image loading code and correct something you are surely welcome...


    Well the code for loading one of the images is as follows..
    Code:
    void wking(int sx,int sy)
    {
       char a;
       ifstream ifil;
       ifil.open("C:\\project\\image\\wking.bmp", ios::in);
       for(int i=0;i<54;i++)ifil.get(a);
       for(i=0;i<60;i++)
         for(int j=0;j<40;j++)
         {
    	ifil.get(a);
    	ifil.get(a);
    	ifil.get(a);
    	int g=a,k;
    	if(a<0)g+=256;
    	k=g/16;
    	setcolor(k);
    
    	if(colorflag==0)
    	k=wcolor;
    while(k!=WHITE && k!=0 )
    {
     k=k-1;
    }
    if(k==WHITE)
    k=WHITE;
    else
    k=8;
    
    
    	if(a!=0)putpixel(sx+j,sy+200-i,k);
         }
    ifil.close();
    }

  7. #7
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    Code:
    ifil.get(a);
    ifil.get(a);
    ifil.get(a);
    Is it just me or are you discarding two bytes here? As far as I can see, you're only using one color... doing manipulations on it and using it as other colors.

  8. #8
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    I tried out your bitmap loading routine on SDL (I don't have/use Borland) and with a few modifications I was able to load the bitmap perfectly.

    This is my code, you can probably implement it using BGI.
    Code:
    void wking(int sx,int sy,display *screen)
    {
    	char r,g,b;
    	ifstream ifil("wking.bmp", ios::in);
    	ifil.seekg(54, ios::beg);
    
    	for (int i = 0; i < 60; i++)
    	{ 
    		for (int j = 0; j < 40; j++)
    		{
    			ifil.get(b);
    			ifil.get(g);
    			ifil.get(r);
    			DrawPixel(screen,sx+j,sy+200-i,r,g,b);
    		}
    	}
    	ifil.close();
    }
    Here's a screenie of the bitmap it loads (as you can see, flawless):

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. New Project, text game, design stage.
    By Shamino in forum Game Programming
    Replies: 9
    Last Post: 05-23-2007, 06:39 AM
  2. c++ chess game help
    By jdm71488 in forum C++ Programming
    Replies: 6
    Last Post: 04-26-2004, 09:46 AM
  3. Game Programmer's AIM Circle: Join Today
    By KingZoolerius66 in forum A Brief History of Cprogramming.com
    Replies: 28
    Last Post: 12-20-2003, 12:12 PM
  4. Chess is the coolest game
    By Jet_Master in forum A Brief History of Cprogramming.com
    Replies: 74
    Last Post: 06-07-2002, 10:29 AM
  5. My Maze Game --- A Few Questions
    By TechWins in forum Game Programming
    Replies: 18
    Last Post: 04-24-2002, 11:00 PM