PDA

View Full Version : irregular HitTest



VoS
December 15th, 2004, 05:34 PM
ive recently made a game in which you have to avoid some big evil round planets. i found out the in the making of that that using the function hittest uses square objects. i dident bother much then with it, i just brought out the ol'e algebra book and looked up the distance formual and made my own hittest.

now my questyion is is there a more refined way of using hittest for a more irregular object than a circle.

I made somewhat irregualr objects have hittest boxxes so that it was split up into many smaller parts, this gets kinda tedious if its really irregualr or if i need to move it around on the screen

btw if anyone wants ta c the game i made ;)
http://xev.mine.nu/jens/revengeofdots.html
avoid everyting , and shop at the store on the planet , u can go over the big planet in lower left corner but not the ones in orbit ;)
a few bugs still like only way to restart is the reload button in browser

Jerryscript
December 15th, 2004, 10:10 PM
If you change the object to a button, the shape will be hittested and not the bounding box.

You can change objects to buttons via actionscript by assigning an onpress function, and turn off the handcursor for appearances sake.

VoS
December 16th, 2004, 03:27 AM
If you change the object to a button, the shape will be hittested and not the bounding box.

You can change objects to buttons via actionscript by assigning an onpress function, and turn off the handcursor for appearances sake.

would that work with movies being changed into buttons when the movie has

onClipEvent (enterFrame) {
}