|
-
Sprinkler animation
I want to have a sprinkler spray water out of it from left to right. Anyone done this or know of a website that has?
Thanks
-
Senior Member
specifically, I do not know of a website that has done it, and I sure havent tried. Your quesiton is a little broad and general. I'm not sure exactly what to tell you. But I can't just make something for you. I would try and learn a little more about MovieClips, and attaching MovieClips with actionscript. This might give you a better idea of what you want to accomplish other than "make a sprinkler"... If you want my advice. Try and make a MovieClip that attaches another MC of water over and over. Then try and make it spurt from that MC into different directions with different _x and _y speeds. It would take a little trying it out to get it right. But learn a little more to try and understand what you are creating before creating it.
Hope I could help!
~Bill
So many Ideas
So little Time
-
I have looked online and I have tried some idea samples with know luck so far.
-
You'll want to use a particle system that follows the rules of gravity and possibly wind, if you want. It'd look something like this...
Draw a water drop and make it a movieclip. Have it set to "Export for Actionscript" with the linkage name "water".
Code:
density = 2;
gravity = 1;
wind = 2;
createEmptyMovieClip("sprinkler", 0);
sprinkler.depth = 0;
sprinkler.onEnterFrame = function() {
for (var i=0; i<density; i++) {
var clip = this.attachMovie("water", "water"+this.depth, this.depth++);
clip._x = Stage.width/2; // x origin for water
clip._y = Stage.height-100; // y origin for water
clip.xspeed = Math.random()*6-3; // initial velocity horizontal
clip.yspeed = -Math.random()*15; // initial velocity upwards
clip.onEnterFrame = function() {
this._x += this.xspeed;
this._y += this.yspeed;
this.xspeed += wind;
this.yspeed += gravity;
if (this._x < 0 || this._x > Stage.width || this._y > Stage.height-100) {
removeMovieClip(this);
}
};
}
};
This should spray water drops everywhere. I haven't tested it so let me know if it doesn't work.
If you want the drops to fluctuate (directed spray at an oscillating angle), I would use a sine wave. Lemme know if you need help with that.
-
Ok I have tried this and not working, Maybe it is me not sure.
-
I got it now. I need it to come from the center of the back and fall down and go from left to right and then slide back fast to the left again and repeat. Ideas on this? I am trying to make a sprikler but not sure how to make it move with the spray and add the noise also.
Last edited by tim_ver; 06-28-2006 at 12:23 AM.
-
-- OOps --
Sorry, replied by accident when reading this topic.
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
|