isSameYDirection method
Implementation
bool isSameYDirection(double y) {
if (y > 0 && (this == down || this == downRight || this == downLeft)) {
return true;
}
if (y < 0 && (this == up || this == upRight || this == upLeft)) {
return true;
}
return false;
}