Created
April 22, 2012 15:59
-
-
Save arilotter/2464876 to your computer and use it in GitHub Desktop.
Obj_curve (draws a bg)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| hue1g = floor(random(256)); | |
| hue2g = (hue1 + 70) mod 255; //+70 | |
| alarm[0] = timer; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| path = path_add(); | |
| path_set_closed(path,false); | |
| path_set_kind(path,1); | |
| path_set_precision(path,8); | |
| path_add_point(path,-350,250,0); //0 | |
| path_add_point(path,150,250,0); //1 | |
| path_add_point(path,650,250,0); //2 | |
| path_add_point(path,1150,250,0); //3 | |
| var i; | |
| cosvar = ds_list_create(); | |
| for (i=0; i<360; i+=1){ | |
| ds_list_add(cosvar,cos(i*((2*pi)/360))); | |
| //cosvar[i] = cos(i*((2*pi)/360)); | |
| } | |
| //for (i=0; i<(2*pi); i+=((2*pi)/60) ){ds_list_add(cosvar,cos(i));} | |
| tex = sprite_get_texture(spr_test,-1); | |
| scroll = 0; | |
| c0 = 0; | |
| c1 = 120; | |
| c2 = 240; | |
| c3 = 0; | |
| ms = part_system_create(); | |
| part_system_depth(ms,-10); | |
| mp = part_emitter_create(ms); | |
| mp2 = part_emitter_create(ms); | |
| mf = -1; | |
| mr = -10; | |
| global.part1 = part_type_create(); | |
| part_type_shape(global.part1,pt_shape_pixel); | |
| part_type_size(global.part1,.5,1,0,.25); | |
| part_type_orientation(global.part1,0,360,0,0,1); | |
| part_type_color1(global.part1,c_white); | |
| part_type_alpha3(global.part1,0,1,0); | |
| part_type_blend(global.part1,1); | |
| part_type_life(global.part1,300,360); | |
| part_type_speed(global.part1,.25,.5,-.001,0); | |
| part_type_direction(global.part1,0,0,0,0); | |
| part3 = part_type_create(); | |
| part_type_shape(part3,pt_shape_pixel); | |
| part_type_size(part3,.25,.75,0,.25); | |
| part_type_orientation(part3,0,360,0,0,1); | |
| part_type_color1(part3,c_white); | |
| part_type_alpha3(part3,0,.5,0); | |
| part_type_blend(part3,1); | |
| part_type_life(part3,300,360); | |
| part_type_speed(part3,.15,.4,-.001,0); | |
| part_type_direction(part3,0,0,0,0); | |
| hue1 = random(255); | |
| hue2 = (hue1 + 70) mod 255; //+70 | |
| hue1g = hue1; | |
| hue2g = hue2; | |
| //color1 = make_color_rgb(0,170,255); | |
| //color2 = make_color_rgb(170,0,255); | |
| color1 = make_color_hsv(hue1,255,255); | |
| color2 = make_color_hsv(hue2,255,255); | |
| timer = 40*60; | |
| alarm[0] = timer; | |
| alarm[0] = 20; | |
| image_speed = 1; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| draw_rectangle_color(-1,-1,room_width+1,room_height+1,merge_color(color1,c_black,.7),merge_color(color1,c_black,.8),merge_color(color1,c_black,.9),c_black,false); | |
| var ct0,ct1,ct2,ct3; | |
| c0 += .1; c1 += .1; c2 += .1; c3 += .1; | |
| if (c0 >= 360){c0 = 0;} | |
| if (c1 >= 360){c1 = 0;} | |
| if (c2 >= 360){c2 = 0;} | |
| if (c3 >= 360){c3 = 0;} | |
| ct0 = cos(c0*((2*pi)/360))*150; | |
| ct1 = cos(c1*((2*pi)/360))*150; | |
| ct2 = cos(c2*((2*pi)/360))*150; | |
| ct3 = cos(c3*((2*pi)/360))*150; | |
| scroll += .001; | |
| scroll = scroll mod 1; | |
| texture_set_repeat(true); | |
| var points,chunks,width,i,tx,ty; | |
| tx = 400; | |
| ty = 500; | |
| path_change_point(path,0,-350,250+(ct0),0); | |
| path_change_point(path,1,150,250+(ct1),0); | |
| path_change_point(path,2,650,250+(ct2),0); | |
| path_change_point(path,3,1150,250+(ct3),0); | |
| chunks = 40; | |
| width = 120; | |
| draw_set_blend_mode(bm_add); | |
| //glow ends | |
| draw_set_alpha(.25); | |
| draw_circle_color(path_get_x(path,.1),path_get_y(path,.1),400,color1,c_black,false); | |
| draw_circle_color(path_get_x(path,.2),path_get_y(path,.2),350,merge_color(color1,color2,.2),c_black,false); | |
| draw_circle_color(path_get_x(path,.3),path_get_y(path,.3),300,merge_color(color1,color2,.3),c_black,false); | |
| draw_circle_color(path_get_x(path,.4),path_get_y(path,.4),250,merge_color(color1,color2,.4),c_black,false); | |
| draw_circle_color(path_get_x(path,.5),path_get_y(path,.5),200,merge_color(color1,color2,.5),c_black,false); | |
| draw_circle_color(path_get_x(path,.6),path_get_y(path,.6),250,merge_color(color1,color2,.6),c_black,false); | |
| draw_circle_color(path_get_x(path,.7),path_get_y(path,.7),300,merge_color(color1,color2,.7),c_black,false); | |
| draw_circle_color(path_get_x(path,.8),path_get_y(path,.8),350,merge_color(color1,color2,.8),c_black,false); | |
| draw_circle_color(path_get_x(path,.9),path_get_y(path,.9),400,color2,c_black,false); | |
| draw_set_alpha(1); | |
| for (i=0; i<chunks; i+=1){ | |
| var bx1,by1,bx2,by2,bd,bd2,tx1,ty1,tx2,ty2,tx3,ty3,tx4,ty4; | |
| bx1 = path_get_x(path,i*(1/chunks)); | |
| by1 = path_get_y(path,i*(1/chunks)); | |
| bx2 = path_get_x(path,(i+1)*(1/chunks)); | |
| by2 = path_get_y(path,(i+1)*(1/chunks)); | |
| bx3 = path_get_x(path,(i+2)*(1/chunks)); | |
| by3 = path_get_y(path,(i+2)*(1/chunks)); | |
| bd = point_direction(bx1,by1,bx2,by2); | |
| bd2 = point_direction(bx2,by2,bx3,by3); | |
| tx1 = bx1 + lengthdir_x(width+(i*3),bd+90); | |
| ty1 = by1 + lengthdir_y(width+(i*3),bd+90); | |
| tx2 = bx1 + lengthdir_x(width+(i*3),bd-90); | |
| ty2 = by1 + lengthdir_y(width+(i*3),bd-90); | |
| tx3 = bx2 + lengthdir_x(width+((i+1)*3),bd2+90); | |
| ty3 = by2 + lengthdir_y(width+((i+1)*3),bd2+90); | |
| tx4 = bx2 + lengthdir_x(width+((i+1)*3),bd2-90); | |
| ty4 = by2 + lengthdir_y(width+((i+1)*3),bd2-90); | |
| draw_primitive_begin_texture(pr_trianglestrip,tex); | |
| draw_vertex_texture(tx1,ty1,((i*(1/chunks))*1)-scroll,0); | |
| draw_vertex_texture(tx3,ty3,(((i+1)*(1/chunks))*1)-scroll,0); | |
| draw_vertex_texture(bx1,by1,((i*(1/chunks))*1)-scroll,.5); | |
| draw_vertex_texture(bx2,by2,(((i+1)*(1/chunks))*1)-scroll,.5); | |
| draw_vertex_texture(tx2,ty2,((i*(1/chunks))*1)-scroll,1); | |
| draw_vertex_texture(tx4,ty4,(((i+1)*(1/chunks))*1)-scroll,1); | |
| draw_primitive_end(); | |
| } | |
| draw_set_blend_mode(bm_normal); | |
| var j,jr,jx,jy,jd; | |
| for (j=0; j<1; j+=1){ | |
| jr = (random(8)+1)/10; | |
| jx = path_get_x(path,jr); | |
| jy = path_get_y(path,jr); | |
| //jd = point_direction(jx,jy,path_get_x(path,jr+.01),path_get_y(path,jr+.01))+random(90)-45; | |
| jd = point_direction(jx,jy,path_get_x(path,jr+.01),path_get_y(path,jr+.01))+choose(-90,90); | |
| //jd = point_direction(jx,jy,path_get_x(path,jr+.01),path_get_y(path,jr+.01)); | |
| part_type_direction(global.part1,jd,jd,0,0); | |
| part_type_direction(part3,jd,jd,0,0); | |
| //part_type_alpha3(global.part2,0,(random(10)/20)+.5,0); | |
| part_emitter_region(ms,mp,jx-15,jx+15,jy-15,jy+15,ps_shape_ellipse,ps_distr_gaussian); | |
| part_emitter_region(ms,mp2,jx-100,jx+100,jy-100,jy+100,ps_shape_ellipse,ps_distr_invgaussian); | |
| part_emitter_burst(ms,mp,global.part1,mf); | |
| part_emitter_burst(ms,mp,part3,mf); | |
| } | |
| draw_set_blend_mode(bm_add); | |
| draw_sprite_tiled_ext(spr_static,-1,x-random(256),y-random(256),1,1,make_color_rgb(92,92,92),1); | |
| draw_set_blend_mode(bm_normal); | |
| draw_set_color(c_white); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| if (hue1 != hue1g){ | |
| if (angcomp(hue1,hue1g) > 0){ | |
| hue1 -= .1; | |
| } else { | |
| hue1 += .1; | |
| } | |
| } | |
| if (hue2 != hue2g){ | |
| if (angcomp(hue2,hue2g) > 0){ | |
| hue2 -= .1; | |
| } else { | |
| hue2 += .1; | |
| } | |
| } | |
| color1 = make_color_hsv(hue1,255,255); | |
| color2 = make_color_hsv(hue2,255,255); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment