- Title: Ripple Engine
- Description: Ripples the screen and makes it look like a flag or underwater.
- GM Version: GM7
- Registered: Yes
- File Type: .gmk
- File Size: 22Kb
- File Link:
Flag ripple, at Host-a
Water ripple, at Host-a
Someone asked how to make a flag flap in the wind without animating it in the Novice and Intermediate Users, and when I made this example, I thought it might also be useful to others.
There are two scripts, one for making flags (ripples are growing as they move to the right), and one for other effects, like a fullscreen ripple effect.
Here's the flag script:
/*draw_flag(texture_index,x,y,width,height,number_of_vertexes,waveheight,speed,intensity)Draws a texture with ripples like a flag."waveheight" defines how high the waves are, "speed" decides the speedof the waves, and intensity decides the number of waves.Script made by TheSnidr[url="http://thesnidr.blog.com/"]http://thesnidr.blog.com/[/url]*/var xtex,ytex,xx,xx1,xx2,yy,i,col,var1,var2,var3,c_dark;xtex=texture_get_width(argument0)ytex=texture_get_height(argument0)ripple=argument7*(-current_time/1000)*(room_speed/30)draw_primitive_begin_texture(pr_trianglestrip,argument0)for (i=0;i<=argument5;i+=1){ var1=i/argument5 var2=ripple+var1*argument8 var3=argument6*var1 xx=argument1+argument3*var1 xx1=xx+sin(var2)*var3 xx2=xx+cos(var2)*var3 yy=sin(var2)*var3 _xtex=var1*xtex if cos(var2)>0 then col=200 else col=200+55*abs(cos(var2)) draw_vertex_texture_color(xx1,argument2+yy,_xtex,0,make_color_rgb(col,col,col),1) draw_vertex_texture_color(xx2,argument2+yy+argument4,_xtex,ytex,make_color_rgb(col,col,col),1)}draw_primitive_end()Thanks to GamerXP for better color gradients
Here's an example:

Edited by TheSnidr, 16 November 2010 - 09:54 PM.











