private void onBoundaries(int tmpX, int tmpY){
        // check whichBoundary it is
        switch (moveStyleBoundaries){
            case START:
                moveTo((int)thisSpawnPos.x,(int)thisSpawnPos.y);
                break;

            case RANDOM_WHITHIN_AREA:
                int newX,newY;

                do {
                    newX = (int)(thisSpawnPos.x + randomBetween((-0.5*areaWidth), (0.5*areaWidth)));
                    newY = (int)(thisSpawnPos.y + randomBetween((-0.5*areaHeight),(0.5*areaHeight)));

                } while (!isOnMap(newX,newY));

                moveTo(newX,newY);
                break;

            case BOUNCE:
                if (tmpX<0||tmpX>width-1)
                    xDirection *= -1;
                if (tmpY<0||tmpY>height-1)
                    yDirection *= -1;
                break;
        }
    }