void update(float delta) {
        this.width = img.getWidth();
        this.height = img.getHeight();
        delta /= 5;
        this.x += dx * delta;
        this.y += dy * delta;

        InstanceBlock[] coll = world.intersects(getRect());
        if (coll[UP] != null) {
            if (this.dy < 0) this.dy = 0;
            stopDir[UP] = true;
            coll[UP].getBlock().playerCollided();
        } else stopDir[UP] = false;

        if (coll[DOWN] != null) {
            this.floor = true;
            stopDir[DOWN] = true;
            coll[DOWN].getBlock().playerCollided();
        } else {
            this.floor = false;
            stopDir[DOWN] = false;
        }
        if (coll[RIGHT] != null) {
            if (this.dx > 0) this.dx = 0;
            stopDir[RIGHT] = true;
            coll[RIGHT].getBlock().playerCollided();
        } else stopDir[RIGHT] = false;

        if (coll[LEFT] != null) {
            if (this.dx < 0) this.dx = 0;
            stopDir[LEFT] = true;
            coll[LEFT].getBlock().playerCollided();
        }  else stopDir[LEFT] = false;
        dx = 0;

        gravity(delta);

    }