jeudi 5 novembre 2015

Collision Detection in JavaScript

I have been working on a car racing game and I wish to detect when my car ( ) collides with another can with id car2 which increases in size gradually. I tried: if(document.getElementById('myCar').style.left==document.getElementById('car2').style.left) alert("hi");

but no use. Please help.




Aucun commentaire:

Enregistrer un commentaire