-
Senior Member
Terrain Collision?
I'm not sure how to do terrain collision detection in 3dfa. I've done what most other tutorials say to do, but it doesn't work on 3dfa. Does it require flash 8 or 9? does it matter. I am kinda lost, so any help would be great
-
A Senior Newbie - How Odd
Hi,
It might be best to post an example of what you've been able to do so far so we can see where you're going wrong
Cut the example back to be as simple as possible, so we can see the problem clearly, without getting distracted by the rest of the movie
Are you trying to do this via measuring distances between objects, or by looking at the colour of pixels around your objects?
Posting a link to the tutorial you're following would also help.
Cheers,
M.
-
Senior Member
To be honest...
I don't really know what I'm trying to do. I haven't accomplished anything except putting the terrain and a character on the stage, so posting the file would be a waste. I have tried to detect the color the resides in certain locations before, but I never knew where to start
If you could tell me how to detect what color different pixels are on, that would be great
hope to hear back from you...
Zoranan
-
I have no first hand experience about the subject but try googling something like:
as3 OR actionscript3 OR "actionscript 3" pixel perfect collisions
http://www.kirupa.com/forum/showthread.php?t=293326
http://labs.boulevart.be/index.php/2...ection-in-as3/
http://www.emanueleferonato.com/2007...others-part-2/
Other is to use vector based collision detection,.. I think flash HitTest works that way and mayby Box2d lib also..
-
Senior Member
I wanted to use vector and "hitTest" to do it from the beginning
Zoranan
-
Senior Member
My code is
trace (element ("ground").hitTest(mouseX, mouseY, true));
When I use this code, 3dfa says...
Method 'hitTest ( )' was given 3 parameters when 1 was expected in 'hitTest' on line 1 trace (element ("ground").hitTest (mouseX, mouseY, true))
null
This has never worked for me. Why doesn't 3dfa support this?
Zoranan
-
3DFA hobby scripter
hit test checks if one element hits another element
-
Senior Member
you should be able to use it to check collision with the true shape of elements, instead of the bounding boxes. How do I accomplish this in 3DFA
Zoranan
-
I was wrong about hitTest()... in 3dfa it just uses hitTestObject() so it is just bounding box test... in other hand, hitTest(mouseX, mouseY, true) wont work inside 3dfa but should work when exported, but then it only uses one point check...
So it depends what is your collision testing needs, 3dfa also offers "box" to "lines" test (see collision demo), but if box is not enough then you must use some external collision "libs"... not 3dfa fault but as3 just do not offer ready made complex collision methods.
This looks interesting.. http://www.tink.ws/blog/as-30-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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|