How best to perform collision detection in javascipt?
This is something that I have often wondered, but now I need it for a sites christmas decorations. What I need is a means of detecting when the sprite is over a static image.
The pixel positions could be measured and compared but that might be slow and unsuitable for web browsing
I'm thinking maybe I need a 2-bit collision map, for simpler detection without re-calculating the position of every element on the page.
Perhaps this is already done by the browser? Netscape 4.x document.layers is an example of a browser's reserved array of specific objects.
Is there anything similar in MSIE? Hopefully a built in array with all the IMG on the page?
Please share your knowledge or experiences of collisions
Thank you kindly!
----------
I'm willing to trade custom scripts for... [see profile]
This is something that I have often wondered, but now I need it for a sites christmas decorations. What I need is a means of detecting when the sprite is over a static image.
The pixel positions could be measured and compared but that might be slow and unsuitable for web browsing

I'm thinking maybe I need a 2-bit collision map, for simpler detection without re-calculating the position of every element on the page.
Perhaps this is already done by the browser? Netscape 4.x document.layers is an example of a browser's reserved array of specific objects.
Is there anything similar in MSIE? Hopefully a built in array with all the IMG on the page?
Please share your knowledge or experiences of collisions

Thank you kindly!

----------
I'm willing to trade custom scripts for... [see profile]