I tried to search for the exact explanation of this method and how to get the (x, y) of the rectangle.
and I found out getX() and getY() as double.
But the one I want to get is the Y-axis of the hitted blocked when the BALL hitted it.
i tried to get the TOP and BOTTOM side of the BLOCK.
public boolean TOP() {
boolean top = true;
if (game.blocks.getTopY() == getTopY())
top = true;
return top;
}
public boolean BTM() {
boolean btm = true;
if (game.blocks.getLowY() == getLowY())
btm = true;
return btm;
}
public int getLowY() {
int LowY = 0;
if (hit())
LowY = y + DIAMETER;
return LowY;
}
public int getTopY() {
int TopY = 0;
if (hit())
TopY = y;
return TopY;
}
If my information is not enough, please inform me so that I can add more.
Thanks.