Skip to content
Advertisement

What’s wrong with the addEventListeners

the vector should be able to be pulled and repositioned. ugh!. I have it up on fiddle at

jsFiddle

JavaScript
JavaScript

Advertisement

Answer

There is nothing messy with JavaScript, you just need a lot more practice…

Few things on your code, as they point out in the comments you have a typo cleintY, also you have to substract the canvas.offset to get the correct position of the mouse.

Those points should be an array that way you can add more and everything will work.

Here is your code working

JavaScript
JavaScript
Advertisement