A Flash Developer Resource Site

Results 1 to 4 of 4

Thread: Speed of hitTest

  1. #1
    Senior Member
    Join Date
    Jul 2000
    Posts
    127
    Hey,

    I haven't got experience with using hitTest.. Now I want to use it to check the collision of all objects with the level.

    But.. How quick is hitTest? Imagine I need 50 tests per frame, would the slow down the game to much?

    Thanx,

    Zander

  2. #2
    Junior Member
    Join Date
    Nov 2001
    Posts
    3

    about HitTest


    in a Pentium 3 or 500Mhz PC..

    20 HitTest per Frame makes the game horrible...

    below that

    10 HitTest per Frame makes the game horrible..

    I think..... (not fully tested. it's just my opinion)

    Flash's HitTest routine is very ineffective...for game.

    - ChainSmoke

  3. #3
    Senior Member
    Join Date
    Jul 2000
    Posts
    127
    I've done some research and came to the following conclusion: hitTest is faser then a self-programmed script.

    I'm running an P 1333 and I had the following framerates:


    Code:
    Hittest                 Own collision detection
    # loops       FPS       FPS
    
    0             99        99
    
    250           85        70
    
    500           47        38
    Zander

  4. #4
    50 tests per frame will be pretty slow. i think you can work around it sometimes, for example if you have an asteroids game and you want to test if the asteroids hit the ship you can put them all in one clip and get away with only one hittest.

Posting Permissions

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




Click Here to Expand Forum to Full Width

HTML5 Development Center