Be a Supporter!

Which is faster?

  • 273 Views
  • 3 Replies
New Topic Respond to this Topic
kizza0
kizza0
  • Member since: Oct. 13, 2007
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Which is faster? 2010-03-03 23:28:29 Reply

Using hitTest point on a fairly large movieclip
or
Using BitmapData.hitTest to a point on the same movieclip.

Should I just hitTestPoint the movieclip or convert it to a bitmap and check collisions?


BOOM HEADSHOT

BBS Signature
doondeka
doondeka
  • Member since: Mar. 25, 2007
  • Offline.
Forum Stats
Member
Level 20
Blank Slate
Response to Which is faster? 2010-03-03 23:39:43 Reply

I think the normal hitTest is best.

Treerung
Treerung
  • Member since: Apr. 18, 2008
  • Offline.
Forum Stats
Member
Level 11
Blank Slate
Response to Which is faster? 2010-03-04 00:24:58 Reply

At 3/3/10 11:28 PM, kizza0 wrote: Using hitTest point on a fairly large movieclip
or
Using BitmapData.hitTest to a point on the same movieclip.

Should I just hitTestPoint the movieclip or convert it to a bitmap and check collisions?

Obvious a bitmap hitTest would take longer since you would be doing many point to point collisions whereas a regular hittest would just check a collision with either the bounding box or a single point.

Its basically a tradeoff for either efficiency or accuracy.


:'(

BBS Signature
kizza0
kizza0
  • Member since: Oct. 13, 2007
  • Offline.
Forum Stats
Member
Level 08
Blank Slate
Response to Which is faster? 2010-03-04 00:32:04 Reply

BitmapHitTest does not have to be a bitmap to bitmap but rather a bitmap to either a rectangle, bitmap or POINT!
SO it can be used for just a point. Which on is faster? I don't know.


BOOM HEADSHOT

BBS Signature