Walk to the far exit, but only step on the floor colours in the order that they’re shown on the wall opposite (with the colour you’re currently on highlighted). If you step on the wrong colour, things turn spiky.
There’s only one safe path across the room. Sneakily, it requires you to double-back so that, like in the picture, you almost get back to the door you came in through.