Hey everybody,
I've put a photo from a house in my game, but now i want to make something so that if my character moves to a table, for example, that its getting stopped by that invisible object. How do i make an invisible object?
public void repell () {
If(actor.getX() >= X && actor.getX() <= X2) {
If(... Y.... Y2) {
// find out from which direction you're
// coming, (current coordinates - Middle
// of area
// move out of area in same direction
}
}
} public void setLocation(int x, int y)
{
int oldX = getX();
int oldY = getY();
super.setLocation(x, y);
if(!getIntersectingObjects(Table.class).isEmpty())
{
super.setLocation(oldX, oldY);
}
}