Results 1 to 3 of 3

Thread: A bitmap hittest question

  1. #1

    A bitmap hittest question

    I am now making a game, in which your ship has to avoid many bullets from around. The ship is a MovieClip due to some animation effects. The bullets are just BitmapData stuff....

    However, The ship is also combined of five BitmapData with its five frames. How can I test the hit of the MovieClip and the bullets?

    I read the docs and it is said that only BitmapData can hittest another BitmapData, now i've got a MovieClip (even different BitmapData in different frames) and many other BitmapData (the bullets).

    Any suggestions for this situation?

    Thanks in advance
    My blog (mainly in Chinese, some in English)
    If you wanna know more about China and the web/RIA dev in China, feel free to visit and ask me anything

  2. #2
    Don't use hitTest

    Seriously, I recommend a per-pixel collision detection system like this one which I use in my own bullet system. It takes any DisplayObject you throw at it and is pretty damn efficient about it. Plus, obviously, it gives you more power, being per-pixel and all that.

    Beyond that though, I think you should consider using the blit method of frame animation. You can use hitTest with that if you want and it's MUCH more efficient than MCs.

    Hope this helps.
    cold constructs
    flash, js, ui r&d

  3. #3
    thanks dude!!!

    Quote Originally Posted by vonWolfehaus View Post
    Don't use hitTest

    Seriously, I recommend a per-pixel collision detection system like this one which I use in my own bullet system. It takes any DisplayObject you throw at it and is pretty damn efficient about it. Plus, obviously, it gives you more power, being per-pixel and all that.

    Beyond that though, I think you should consider using the blit method of frame animation. You can use hitTest with that if you want and it's MUCH more efficient than MCs.

    Hope this helps.
    My blog (mainly in Chinese, some in English)
    If you wanna know more about China and the web/RIA dev in China, feel free to visit and ask me anything

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

Home About kirupa.com Meet the Moderators Advertise

 Link to Us

 Credits

Copyright 1999 - 2012