let rect1 = document.querySelector('.perso').getBoundingClientRect(); let rect2 = document.querySelector('.obstacle').getBoundingClientRect();