Like I said before, you need to read the function reference which is inbuilt in Turbo C to find it out since I have never worked with such things. Read something related to view ports concepts in Turbo C.
You have two choices:
- Use clrscr() and redraw the entire board with the updates
- Clear a specific portion of the screen using some functions in BGI.
By creating a destructor in the class, when an object like say Pawn is moved from one square to another I can destroy it at the original location and create a new one at the new location thereby it will appear as if that pawn moved from one square to another.
By destructing the object I think the shape will also be erased.
No, that won't work. Destruction of a class object has got nothing to do with the display. You would anyways need to actually 'erase' the thing which is on the screen. Thus your logic would consist of two parts: Game logic and graphics.
When the pawn is moved, you need to call the move() function on the object as well as repaint the screen instead of just destroying the object.
Every object you create can have a draw method, which will know how to render itself on the screen. So you just need to call the draw method of each object in a loop for all objects in the game. The object will have its own information like color, position etc. so you don't need to worry about the location of drawing.