|
-
[RESOLVED] getObjectsUnderPoint headache
Hey all,
I've been on this problem for about a week now and it's making me angry. I'm making this game where lots of bullets and lots of enemies are involved. I'm testing [bullet]-[enemy] and [bullet]-[environment object] collision using getObjectsUnderPoint(). All environment objects and enemies get spawned on the same parent movieclip object called Theatre. Enemies are irregularly-shaped and rotate depending on movement direction.
Okay, first, I created the bullet logic. Flies everywhere just fine, and I programmed it to destroy itself when it hits anything. I create environment objects. Bullets that collide on the environment objects disappear as instructed (here I tested that Theatre.getObjectsUnderPoint() returns the environment movieclip object ONLY... great!)
Here's where it becomes messed up. I add an enemy that runs around. Bullets that hit him only disappear sometimes... and during troubleshooting, I noticed that Theatre.getObjectsUnderPoint() returned the Shape object within the enemy movieclip ONLY, not the enemy movieclip itself as I expected. What's with the inconsistency? Also, why does Theatre.getObjectsUnderPoint() return nothing (MC object or otherwise) when the bullet so obviously overlaps the enemy movieclip? Something's got to return because something's obviously at that Point at that particular time right?
Common mistakes people tend to overlook that I took care not to:
- I made sure that I passed the xy coordinate relative to the stage object to getObjectsUnderPoint()
Thanks for any help guys, I'd almost give my soul to have this thing solved. (can you tell I'm desperate? :P)
Jay.
Last edited by thurinus; 08-07-2007 at 08:02 AM.
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
|