|
-
Senior Member
[help] hittest VS array checks
Hey, what would be quicker/more optimized:
I have a thingy that the player moves and shoot from. The bullets shoot up and can hit objects in the playfield. The playfield is stored as a grid array.
Now, I can detect objects two ways:
1. Move the bullet as an MC... test for collision with hitTest() ... Then figure out where in the array that object is and remove it.
or
2. Based on the bullet X,Y I can check the grid cell it's overlapping, and see if that grid cell contains an object. If so, then I remove it (hit!).
So which is faster. Doing hittest all the time, then looking up the array, or looking up the array all the time?
:-)
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|