Collision without physics

I have a sprite controlled by the player with CursorKeys (top, bottom, left, right)

I integrated a collision without physics between my sprite and a zone with Phaser.Geom.Intersects.LineToRectangle() because I am testing each side of my sprite for collision.

It works fine, but if the right bound of my sprite collides with the zone, I can’t move my sprite up and down because the last point of the bound up and bound down also collides with the zone…

How can I do ?

sample here :

function() update {

[...]

 let leftBound = sprite.getBounds().getLineD();
 let rightBound = sprite.getBounds().getLineB();
 let upBound = sprite.getBounds().getLineA();
 let downBound = sprite.getBounds().getLineC();

 let leftIntersect = Phaser.Geom.Intersects.LineToRectangle(leftBound,this.zone.getBounds());
 let rightIntersect = Phaser.Geom.Intersects.LineToRectangle(rightBound,this.zone.getBounds());
 let upIntersect = Phaser.Geom.Intersects.LineToRectangle(upBound,this.zone.getBounds());
 let downIntersect = Phaser.Geom.Intersects.LineToRectangle(downBound,this.zone.getBounds());

 if (cursors.left.isDown && leftIntersect == false) {
        sprite.x -= SPEED;
        sprite.anims.play('walk',true);
 } else if (cursors.right.isDown && rightIntersect == false) {
        sprite.x += SPEED;
        sprite.anims.play('walk',true);
 } else if (cursors.up.isDown && upIntersect == false) {
        sprite.y += -SPEED;
        sprite.anims.play('walk',true);
 } else if(cursors.down.isDown && downIntersect == false) {
        sprite.y += SPEED;
        sprite.anims.play('walk',true);
 } else {
        sprite.anims.play('idle');
 }

}

Hello, I don’t know but just a random idea here ttrying to help…
What about using rectangles wrapping the sprite where the size should be the SPEED I guess?
e.g.

let leftBound = new Phaser.Geom.Rectangle(sprite.x - SPEED, sprite.y, SPEED, sprite.height);

then check RectangleToRectangle instead…

let leftIntersect = Phaser.Geom.Intersects.RectangleToRectangle(leftBound, zone.getBounds());

Adjusting something similar to:
imagen