Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if (abs(x - this->getLocX()) == abs(y - this->getLocY())) // THIS WORKS GOOD
- {
- cout << "n" << abs(x - this->getLocX()) << abs(y - this->getLocY()) << x << y;
- for (int i = 0; i < abs(x - this->getLocX()); i++)
- {
- cout << "n" << boardP->hasPiece(this->getLocX() - 1, i-1) << "n" << boardP->hasPiece(i, y) << "n" << x << "n" << y << "n" << i << "n";
- if (boardP->hasPiece(this->getLocX() - 1, i-1)) // THIS DOESNT WORK
- return 0; // THERE ARE PLAYERS IN THE WAY
- }
- return 2; // THERE ARE NO PLAYERS IN THE WAY
- }
- return 0;
Add Comment
Please, Sign In to add comment