public void outOfBounds()
{
//if ((x < MatchConfig.windowBoundaryXmin && speedX < 0) || (x > MatchConfig.windowBoundaryXmax && speedX > 0))
if ((x < 0 && speedX < 0) || (x > MatchConfig.map.mapWidth && speedX > 0))
{
this.speedX = this.speedX * (-1);
}
//if ((y < MatchConfig.windowBoundaryYmin && speedY < 0) || (y > MatchConfig.windowBoundaryYmax && speedY > 0))
if ((y < 0 && speedY < 0) || (y > MatchConfig.map.mapHeigth && speedY > 0))
{
this.speedY = this.speedY * (-1);
}
}