Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- bool Level::isHitLeft() const
- {
- POINT apt[4];
- int n = current->getLeftSide(apt);
- int x, y;
- for (int i = 0; i < n; i++)
- {
- x = posX + apt[i].x;
- y = posY + apt[i].y;
- if (y > height - 1)
- continue;
- if (x == 0 || board[x-1][y] != RGB(0,0,0))
- return true;
- }
- return false;
- }
- bool Level::isHitRight() const
- {
- POINT apt[4];
- int n = current->getRightSide(apt);
- int x, y;
- for (int i = 0; i < n; i++)
- {
- x = posX + apt[i].x;
- y = posY + apt[i].y;
- if (y > height - 1)
- continue;
- if (x == width - 1 || board[x+1][y] != RGB(0,0,0))
- return true;
- }
- return false;
- }
- bool Level::isHitBottom() const
- {
- POINT apt[4];
- int n = current->getSkirt(apt);
- int x, y;
- for (int i = 0; i < n; i++)
- {
- x = posX + apt[i].x;
- y = posY + apt[i].y;
- if (y < height && (y == 0 || board[x][y-1] != RGB(0,0,0)))
- return true;
- }
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement