Wednesday, January 6, 2010
Any way the wind blows...
Click and drag the green gem on the above .swf.
Large version here.
I was going to post something about randomizing text with input fields, but this little guy popped into my head on the drive home from work. At my place of work, Oxygen Education, I recently helped a co-worker develop a wind turbine simulator. It was fairly simple, where the _rotation property of a movie clip changed based on where a specific draggable movie clip was.
Well, I decided to take this concept a step further and control an entire ARRAY of movie clips with it. And I thought to myself, I thought "Well, why not allow movement in all directions?"
And so I did. A simple for loop adds the bead movie clips to the stage at random positions. As they are added, an empty variable called "weight" is filled in (which I've set as a number from 1-10). The weight adjusts how large the object is, and also has an effect on the movement speed. You'll notice the larger, and therefore "heavier", beads move a bit slowly. This is accomplished by setting the movement rate to a number multiplied by a decimal (determined by the weight).
So there you have it! Another useless, yet fun to watch, Flash experiment!
Subscribe to:
Post Comments (Atom)
Hey Corey, Could you not use this for something along the lines of a DNA model? Thx, M
ReplyDeleteThis is really freakin' cool Corey!
ReplyDeleteNeato! Or Neeto!
ReplyDeleteThanks, guys! I appreciate the comments.
ReplyDelete@Mathew: You could easily do something like that. My first thought after your comment was showing a solar system that you could fly around and learn about different planets and other space junk.
Damn, I was thinking that too but didnt want to come off cliche lol. Could you use the Icon at the bottom to act as the ship's controls and then zoom into a targeted planet? Could you simulate the orbit of one solar body around the others? Hmmmm this has some cool potential. :)
ReplyDelete