@Override
    public void handleOutOfBounds(EntityGrid grid) {
        float tx = -1;
        float ty = -1;

        float gWidth = grid.getSize().x;
        float gHeight = grid.getSize().y;

        float pAdjustedWidth = sprite.getLocalBounds().width * .9f;
        float pAdjustedHeight = sprite.getLocalBounds().height * .9f;

        if (position.x > gWidth - pAdjustedWidth) {
            tx = gWidth - pAdjustedWidth;
        } else if (position.x < -gWidth + pAdjustedWidth) {
            tx = -gWidth + pAdjustedWidth;
        }
        if (position.y > gHeight - pAdjustedHeight) {
            ty = gHeight - pAdjustedHeight;
        } else if (position.y < -gHeight + pAdjustedHeight) {
            ty = -gHeight + pAdjustedHeight;
        }

        if (tx != -1) {
            position = new Vector2(tx, position.y);
        }
        if (ty != -1) {
            position = new Vector2(position.x, ty);
        }
    }