I had a hard time figuring applicability in my daily work life.
So I sat on Hype, undecided what I could do with it. What I missed in Josh’s workshop was the fact that Hype is simply a collection of classes. Use what you want and ignore what you don’t. Hopefully, I’m not the only one with that misconception. If I am, I’m dumber than I thought.
Yesterday I had some downtime as I wait on my friend to get to .NET changes for TattooCapture and decided to manufacture something I’ve always wanted: A class to plot points equally around 360°. Why? Well… that will become clear in the future. In the meantime, that was my goal. Feed it 8 points and it comes back with how many degrees each would be to be equally dispersed around a circle.
It was a pretty simple solution; divide the number of elements by 360. Tada! Then use that degree number within the class to return what degree an element would be. Further, use it to return what radian (what flash uses to calculate degrees) that element would be.
I ended up with the Orbit class right-click and ‘save as’. Usage boils down to importing the class and an instantiation. Then using it’s public functions. Therefore;
var orbit:Orbit = new Orbit;
orbit.increment = 15; //15 being the total number of elements
var degree:Number = orbit.getDegree(8); //8 being the 8th element
var radian:Number = orbit.getRadians(degree);
//returns the radian value for the 8th element out of 15;
//alternatively, you can piggyback the calculations
var radian:Number = orbit.getRadians(orbit.getDegree(8));
Here’s the first example. Each time you click the start button, the piece will pick a random number of elements, then run through that number and each element on stage in it’s prescribed location. Sweet.
So once I figured that out, I started monkeying around with it, as is my wont. Change the number to see the progress.
In comes Hype.
Eventually, in version 4, I decided to muck about a bit with Hype. I wanted to draw to Bitmap was being done and with Hype, I had a built-in class to do just that. BitmapCanvas. Worked like a charm.
Messed around for another couple of versions and in version 8, added in FilterRhythm and TimeType. So far so good.
In version 10, I added in colorPool. Honestly, it all starts to get a bit silly and really I’m just messing around with minor alterations.
In version 13, I dumped my Event.ENTER_FRAME for SimpleRhythm.
Finally, with some more tweaks, I have this (basically) where I want it. Version 19. I might spend some more time with it, but it’s in a place I like. I left it running while I wrote this post and this is what I got.
The moral of the story is; If you keep your eyes closed, you won’t see the path in front of you. How’s that for a fortune cookie? I oughta be a writer.