|
-
-
Hi again,
to explain my problem in more detail, I have followed the online tutorial from blanius step by step and created a swf-file. And to my surprise even there the problem shows up.
Flash example
The collision detection has been implemented with the collideRect method.
Does somebody has an other idea how to implement a collision detection?
Help is always appreciated 
Greetings
zeiger
Last edited by zeiger; 11-14-2006 at 04:39 PM.
-
CollideRect takes the rectangular coordinates of the item you have drawn. So what you have to imagine is the smallest rectangle the item you drew fits in and it's that rectangle that's used for the collision detection not the item itself.
I currently can only suggest 2 ways to do collision on non-rectangular items. The 1st is to do the collision detection yourself using a script and the x/y coordinates of the items (not very easy to do). The 2nd is to put invisible objects (like dots) around the perimeter of your items and do the collision detection using collideRect on these (can make a lot of objects but I think is much easier to do).
Maybe someone else has other ideas. Anyway hope this gives you someplace to start.
-
 Originally Posted by ppedz
CollideRect takes the rectangular coordinates of the item you have drawn.
OK. That point I was missing. Now the CollideRect function makes sense. Thanks 
BTW: I found this post collision detection with circles
So if nobody comes with an other solution I have to use only circles/rectangles or I go with your second solution 
Greetings
Dominik
-
The post you found would fall under the 1st suggestion but it only applies to circles. You could do this same type of idea for just about any shape based on it's x/y coordinates. By this I mean make your own type of collision function.
-
KoolMoves Moderator
The circle collision works for non circles as well, it's based on distance. Where you get complicated is with complex shapes. I recall reading another way to do this, I think it used getBounds
-
KoolMoves Moderator
Does current version of 3dfa have "hitTest"? that would do it.
-
 Originally Posted by blanius
Does current version of 3dfa have "hitTest"? that would do it.
I am not 100% sure, but I don't think so.
So I have to make the best of my situation. Otherwise it would be to easy 
Thanks again for all your help.
Greetings
zeiger
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
|