danshumway
10-23-2009, 03:02 AM
I'll post back with a download and some instructions soon, but for now I'll just give an overview.
I have developed .9 (working on 1.0 now) of a (in my opinion) useful tool for quickly and easily developing accurate hitTests in Actionscript 2.0 without wasting time coding or measuring distances. (Yes, it's only Actionscript 2.0, I haven't upgraded my flash in a while, sorry)
Sure, you can do advanced hitTests by nesting movie clips in a border, or plotting out all the points, but these take TIME! Even the most simple hitTests that involve points are confusing to organize, and leave you frustrated. Now imagine that you could just select the points that you wanted to run a hitTest on, and have it just work. Imagine your code was bundled up into a function you could call whenever you wanted. Imagine all you had to do was tell the application what to do when a hit registered.
Basically, this is how it works.
1. You launch the application (.swf)
2. You import an image of the clip you want to do a hitTest with.
3. You can now move the image around and select points to test against.
4. You click the button "generate".
5. You enter the name of the test (The test is stored as a function), the name of the image you imported, and the name of the clip you want to test against (not the one you imported).
6. HitTest Generator writes the code out for you, which can then be copied and pasted into any flash project.
The project is focused on ease of use and speed (I developed a simple .swf where the user dragged one complex shape around and whenever it hit another, the output box displayed "true", in about 3 minutes total. The code was around 100 lines.)
Once the code is all set up in your application, you can freely scale either clip. Rotation is currently not supported. I'm working on it.
I'll upload the actual program soon, and give some more details about where I'd like to take it, but for the 1.0 release, I'm working on.
- The ability to re-size an imported image.
- The ability to move around the points you want to hitTest against. (Right now, they're displayed in a grid, which can be annoying.)
- A toolset, so you don't accidentally start moving your image around as you're selecting points, or something like that.
The long term goals, if anyone shows an interest in this, are to keep adding a number of customizable features. Doing hitTests on an animation, predicting collisions so your objects don't get embedded into each other, maybe getting into some simple physics, all while maintaining extreme ease of use, cutting down on the time you spend in my program, and ultimately giving the user as much control as possible over the hitTest.
I'm not giving out source code, at least until sometime next year, because I'm developing this for a contest, but I'll make the program freely available.
Anyway, feel free to post back any comments. Is something like this already out there? Would this be useful to anyone? Are there any features you would really like to see implemented? Is this totally useless, and should I give up now? Can you think of other places to display this?
Thanks in advance, hope this helps someone.
I have developed .9 (working on 1.0 now) of a (in my opinion) useful tool for quickly and easily developing accurate hitTests in Actionscript 2.0 without wasting time coding or measuring distances. (Yes, it's only Actionscript 2.0, I haven't upgraded my flash in a while, sorry)
Sure, you can do advanced hitTests by nesting movie clips in a border, or plotting out all the points, but these take TIME! Even the most simple hitTests that involve points are confusing to organize, and leave you frustrated. Now imagine that you could just select the points that you wanted to run a hitTest on, and have it just work. Imagine your code was bundled up into a function you could call whenever you wanted. Imagine all you had to do was tell the application what to do when a hit registered.
Basically, this is how it works.
1. You launch the application (.swf)
2. You import an image of the clip you want to do a hitTest with.
3. You can now move the image around and select points to test against.
4. You click the button "generate".
5. You enter the name of the test (The test is stored as a function), the name of the image you imported, and the name of the clip you want to test against (not the one you imported).
6. HitTest Generator writes the code out for you, which can then be copied and pasted into any flash project.
The project is focused on ease of use and speed (I developed a simple .swf where the user dragged one complex shape around and whenever it hit another, the output box displayed "true", in about 3 minutes total. The code was around 100 lines.)
Once the code is all set up in your application, you can freely scale either clip. Rotation is currently not supported. I'm working on it.
I'll upload the actual program soon, and give some more details about where I'd like to take it, but for the 1.0 release, I'm working on.
- The ability to re-size an imported image.
- The ability to move around the points you want to hitTest against. (Right now, they're displayed in a grid, which can be annoying.)
- A toolset, so you don't accidentally start moving your image around as you're selecting points, or something like that.
The long term goals, if anyone shows an interest in this, are to keep adding a number of customizable features. Doing hitTests on an animation, predicting collisions so your objects don't get embedded into each other, maybe getting into some simple physics, all while maintaining extreme ease of use, cutting down on the time you spend in my program, and ultimately giving the user as much control as possible over the hitTest.
I'm not giving out source code, at least until sometime next year, because I'm developing this for a contest, but I'll make the program freely available.
Anyway, feel free to post back any comments. Is something like this already out there? Would this be useful to anyone? Are there any features you would really like to see implemented? Is this totally useless, and should I give up now? Can you think of other places to display this?
Thanks in advance, hope this helps someone.