all groups > flash actionscript > march 2007 >
You're in the

flash actionscript

group:

hit detection without on enterframe?


Re: hit detection without on enterframe? David Stiller
3/17/2007 8:13:12 PM
flash actionscript: ahref,

[quoted text, click to view]

Absolutely. You may invoke the MovieClip.hitTest() method whenever you
like. It could be an onEnterFrame even, a mouse click, a timer, just
randomly ...

[quoted text, click to view]

If you've got to check a lot of things, you've got to check 'em. If you
must check repeatedly, then it doesn't much matter if you use an
onEnterFrame event or, say, a setInterval() loop. If you know the position
and surface area of your movie clip, you can certainly perform "imaginary"
hit tests against those coordinates. That would probably be more efficient
because it would omit a method call.


David Stiller
Adobe Community Expert
Dev blog, http://www.quip.net/blog/
"Luck is the residue of good design."

hit detection without on enterframe? ahref
3/17/2007 10:21:40 PM
hi there,

i was wondering if there was a way to do hit detection without the on
enterframe clip event. This is because if there are alot of things that need to
be checked it could get a bit laggy.

thanks
Re: hit detection without on enterframe? aa
3/18/2007 12:00:00 AM
This is an interesting question
What is your context?
[quoted text, click to view]

Re: hit detection without on enterframe? ahref
3/18/2007 12:00:00 AM
well i am making a space exploration game. Much like the game
http://sc2.sourceforge.net. in such a game there are alot of things that will
need checking on a solar system screen;

planet with ship
space station with ship
enemy ship with planet
enemy ship with ship
ship with edge of solar system(leads to hyperspace)

and probably more i havent thought of.

in particulary busy solar systems there is a lot tocheck and i thought this
may get laggy.

thanks
Re: hit detection without on enterframe? kglad
3/18/2007 4:55:08 AM
Re: hit detection without on enterframe? kglad
3/18/2007 3:17:45 PM
AddThis Social Bookmark Button