Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- let explosiongraphic1 = CSD~"exp1.png";
- let explosiongraphic2 = CSD~"exp2.png";
- LoadGraphic(explosiongraphic1);
- LoadGraphic(explosiongraphic2);
- task explosion1(X,Y,Killtime,Startingsize,Maxsize){
- let explosion1 = Obj_Create(OBJ_EFFECT);
- let scaling = Startingsize;
- let fadeout = 255;
- let enlargespeed = 0.01;
- let deletetimer = 0;
- Obj_SetPosition(explosion1,X,Y);
- ObjEffect_SetRenderState(explosion1,ADD);
- ObjEffect_SetTexture(explosion1,explosiongraphic1);
- ObjEffect_SetLayer(explosion1,3);
- ObjEffect_SetScale(explosion1,scaling,scaling);
- ObjEffect_SetPrimitiveType(explosion1,PRIMITIVE_TRIANGLESTRIP);
- ObjEffect_CreateVertex(explosion1,4);
- ObjEffect_SetVertexXY(explosion1,0,-128,-128);
- ObjEffect_SetVertexXY(explosion1,1,128,-128);
- ObjEffect_SetVertexXY(explosion1,2,-128,128);
- ObjEffect_SetVertexXY(explosion1,3,128,128);
- ObjEffect_SetVertexUV(explosion1,0,0,0);
- ObjEffect_SetVertexUV(explosion1,1,256,0);
- ObjEffect_SetVertexUV(explosion1,2,0,256);
- ObjEffect_SetVertexUV(explosion1,3,256,256);
- ascent(i in 0..4){
- ObjEffect_SetVertexColor(explosion1,i,fadeout,255,255,255);
- }
- while(!Obj_BeDeleted(explosion1)){
- deletetimer++;
- ascent(i in 0..4){
- ObjEffect_SetVertexColor(explosion1,i,fadeout,255,255,255);
- }
- ObjEffect_SetScale(explosion1,scaling,scaling);
- scaling+=enlargespeed;
- if(scaling>Maxsize && enlargespeed>0.0005){
- enlargespeed-=0.0005;}
- if(enlargespeed<0.0005){
- enlargespeed=0.0005;}
- if(deletetimer>Killtime && enlargespeed==0.0005 && fadeout>0){
- fadeout-=10;}
- if(fadeout<=0){
- Obj_Delete(explosion1);}
- yield;
- }
- }
- task explosion2(X,Y,Killtime,Startingsize,Maxsize){
- let explosion2 = Obj_Create(OBJ_EFFECT);
- let scaling = Startingsize;
- let fadeout = 255;
- let enlargespeed = 0.01;
- let deletetimer = 0;
- Obj_SetPosition(explosion2,X,Y);
- ObjEffect_SetRenderState(explosion2,ADD);
- ObjEffect_SetTexture(explosion2,explosiongraphic2);
- ObjEffect_SetLayer(explosion2,4);
- ObjEffect_SetScale(explosion2,scaling,scaling);
- ObjEffect_SetPrimitiveType(explosion2,PRIMITIVE_TRIANGLESTRIP);
- ObjEffect_CreateVertex(explosion2,4);
- ObjEffect_SetVertexXY(explosion2,0,-128,-128);
- ObjEffect_SetVertexXY(explosion2,1,128,-128);
- ObjEffect_SetVertexXY(explosion2,2,-128,128);
- ObjEffect_SetVertexXY(explosion2,3,128,128);
- ObjEffect_SetVertexUV(explosion2,0,0,0);
- ObjEffect_SetVertexUV(explosion2,1,256,0);
- ObjEffect_SetVertexUV(explosion2,2,0,256);
- ObjEffect_SetVertexUV(explosion2,3,256,256);
- ascent(i in 0..4){
- ObjEffect_SetVertexColor(explosion2,i,fadeout,255,0,0);
- }
- while(!Obj_BeDeleted(explosion2)){
- deletetimer++;
- ascent(i in 0..4){
- ObjEffect_SetVertexColor(explosion2,i,fadeout,255,0,0);
- }
- ObjEffect_SetScale(explosion2,scaling,scaling);
- scaling+=enlargespeed;
- if(scaling>Maxsize && enlargespeed>0.0005){
- enlargespeed-=0.0005;}
- if(enlargespeed<0.0005){
- enlargespeed=0.0005;}
- if(deletetimer>Killtime && enlargespeed==0.0005 && fadeout>0){
- fadeout-=10;}
- if(fadeout<=0){
- Obj_Delete(explosion2);}
- yield;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement