void black_piece()
{
if (board[5][1] == 1)
{
drawScene_move();
}
if (board[4][0] == 1)
{
flag[4][0] = true;
// drawScene_move_one();
}
if (board[4][2] == 1)
{
flag[4][2] = true;
// drawScene_move_two();
}
}
void move_piece()
{
if (flag[4][0] == true)
{
flag[4][2] = false;
drawScene_move_one();
}
if (flag[4][2] == true)
{
flag[4][0] = false;
drawScene_move_two();
}
}
void mouseMotion(int x, int y)
{
if (y <= 180)
{
y = 180;
}
if (x <= 240)
{
x = 240;
}
if (y >= 420)
{
y = 420;
}
if (x >= 560)
{
x = 560;
}
board[(y - 180) / 30][(x - 240) / 40] = 1;
cout << x << " " << y << endl;
move_piece();
black_piece();
glFlush();
}
well I am making a checkers game using c++ and opengl. I am trying to get one piece to move from one space to another but do it only once not twice.