Home Tutorials Forums Articles Blogs Movies Library Employment Press Buy templates

Go Back   ActionScript.org Forums > Community Boards > Just for Kicks Challenges

Reply
 
Thread Tools Rate Thread Display Modes
Old 02-03-2009, 04:41 AM   #1
orange gold
got as?
 
Join Date: May 2007
Posts: 507
Default perfect hitTest function

edit: before you read any further... this whole project should be done in actionscript 2

ok.. obviously as many of you know flash's hitTest function is corrupt... the purpose of this challenge is to create a hitTest that well detect hitTest down to the pixel. not just the bounding box or shapeFlag... basically anyone who wants to use the code would just copy and paste in our function at the start of their as file and then just enter in their instance names or w/e

the object of the challenge is simple... and consits of 4 mini chalenges

challenge pt.1
create a code that traces out the two objects we will be using for our hitTest

challenge pt.2
make a code to use hitTest on each pixel of thoose two traced out actionscript objects of our original object

challenge pt.3
have the tracings move with the objects not only x and y scale but click and drag... size increase rotation xscale if visibility is off hitTest goes off etc.

challenge pt.4
simplify all the code as small as possible and give all the objects varable names so that the code starts out
ActionScript Code:
variableobject1 = //"name of your object here" variableobject2 = //"name of your other object here" //main code goes here

that way anyone can copy the final hitTest code into their actionscript file and ust fill in thoose 2 variable names without the troubles of flash's not fully functional default hitTest functions but get the full exact effect there looking for


ENJOY
LET THE GAMES BEGIN!

edit: thx for the first 2 comments on helping me fix this up ~ OG
__________________
Feel free to PM me if you have a question

Last edited by orange gold; 02-03-2009 at 09:57 PM..
orange gold is offline   Reply With Quote
Old 02-03-2009, 07:44 PM   #2
newblack
dondeEstanMisPantalones?
 
newblack's Avatar
 
Join Date: Nov 2005
Location: New York Proper
Posts: 1,173
Send a message via AIM to newblack
Default

i think you might need to be more specific. what does the algorithm return? a midpoint? a collection of points that represents the entire union of the objects? a collision normal? collision detection is a huge field and solutions are application specific...
__________________
i am gibreel farishta
general relativity
jellytanks alpha redux
newblack is offline   Reply With Quote
Old 02-03-2009, 07:57 PM   #3
CyanBlue
Super Moderator
 
CyanBlue's Avatar
 
Join Date: Jan 2002
Location: Centreville, VA
Posts: 24,878
Default

FYI, there are many blog posts & forum threads that talks about achieving better hitTest in Flash... For example, this one looks very promising and efficient...
http://troygilbert.com/2007/06/25/pi...actionscript3/

And, the whole idea of this challenge is that you come up with an idea, you create one that carries that idea, and have others share what they come up with... You probably are missing first two... You really need to define more on your thoughts, as newblack mentioned, and come up with some sample of yours so that others can participate...
__________________
CyanBlue / Jason Je / Macromedia Certified Flash Developer & Designer
http://CyanBlue.FlashVacuum.com
http://www.FlashVacuum.com
http://tutorials.FlashVacuum.com

Do NOT PM, Email or Call me... Your question belongs right in this forum...
CyanBlue is offline   Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
loadMovie, stop/play not working. mengaz ActionScript 2.0 10 01-16-2009 03:07 PM
Need my button to stay clicked! cpdbolinho ActionScript 2.0 7 10-08-2008 01:59 PM
Actionscript 2.0 Loop citizener ActionScript 2.0 8 08-04-2008 03:44 AM
Horizontal Positioning via button click... VandenTR ActionScript 2.0 1 03-04-2008 07:12 AM
flash movie plays in browser too slow m1cky ActionScript 2.0 7 01-11-2005 09:11 PM


All times are GMT. The time now is 02:44 PM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Ad Management plugin by RedTyger
Copyright 2000-2009 ActionScript.org. All Rights Reserved.
Your use of this site is subject to our Privacy Policy and Terms of Use.