I was wondering if anyone had a code that could help make a wave effect. The image im useing is a really simple upside down v shape but I want it to look like its actually coming in like a wave. If anyone has any ideas please share :bounce:
This could be an idea, but I honnestly don’t know how you could adapt it:
//RIPPLES: EBEN ELIASON, MAY, 2003 (KINETIC-THOUGHT)
//Edited by pom
//
//The following additional lines of code are given for dynamic experimentation.
//As such, all values were initially hard coded and therefore these lines
//do not count toward the 25 line limit, which my code excalty hits.
size = 300 //the size of the "pool" (multiples of 15)
amplitude = 30 //initial wavefront amplitude (0-100)
viscocity = .1 //determines how "thick" the fluid is (0-1)
elasticity = .5 //essentially determines freq of ripples (0-2)
_global.root = this ;
//sets a time for each drop indicating when the wavefront from click will reach it
this.onMouseDown = function(){
for(i = 1; i <= k; i++) {
var dx, dy ;
var clip = root["Drop"+i] ;
clip.distance = ((dx = clip._x - root._xmouse)*dx + (dy = clip._y - root._ymouse)*dy)/10;
clip.ripples.push(getTimer() + clip.distance/2);
}
}
for(i = 0; i < size; i+=25) for(j = 0; j < size; j+=25){
Drop = this.createEmptyMovieClip("Drop"+(++k), k);
Drop.lineStyle(45,0x002255,60);
Drop.lineTo(.15,.45);
Drop._x = j;
Drop._y = i;
Drop.ripples = new Array();
Drop.col = new Color (Drop);
Drop.onEnterFrame = function(){
for(i = 0; i < this.ripples.length; i++){
if(getTimer() > this.ripples*){
this.ripples.splice(i, 1);
this._xscale -= amplitude ;
this._yscale -= amplitude ;
}
}
this.Az = (100 - this._xscale)*(elasticity)
this.Vz = (this.Vz + this.Az)*(1-viscocity)
this._xscale = this._yscale += this.Vz ;
dif = 100 - this._xscale ;
var difO = {aa:50,rb:0,gb:0,bb:this.vc=100+1.5*dif};
this.col.setTransform(difO);}}
Ah I wish I could take a look at that code now but I cant until I get home on Tuesday. Your ideas are always good so im sure that I can use it in some way.