Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function Difficulty(type){
- let csd = GetCurrentScriptDirectory;
- let obje=Obj_Create(OBJ_EFFECT);
- let texture = csd~ ".\include\Difficulty.png";
- let left = 0;
- let top = 0;
- let right = 0;
- let bottom = 0;
- LoadGraphic(texture);
- if(type == "Easy"){
- top = 0;
- right = 68;
- bottom = 16.8;
- }
- if(type == "Normal"){
- top = 16.8;
- right = 68;
- bottom = 32;
- }
- if(type == "Hard"){
- top = 33.6;
- right = 68;
- bottom = 50.4;
- }
- let XYbLR = left + right / 2;
- let XYbTB = 0;
- if(type == "Easy"){
- XYbTB = top + bottom / 2 ;
- }
- if(type == "Normal"){
- XYbTB = top / 2 ;
- }
- if(type == "Hard"){
- XYbTB = top - bottom / 2 ;
- }
- Obj_SetPosition(obje,230,40);
- ObjEffect_SetTexture(obje,texture);
- ObjEffect_SetRenderState(obje,ALPHA);
- ObjEffect_SetLayer(obje,8);
- ObjEffect_SetScale(obje,1,1);
- ObjEffect_SetPrimitiveType(obje, PRIMITIVE_TRIANGLESTRIP);
- ObjEffect_CreateVertex(obje, 4);
- ObjEffect_SetVertexXY(obje, 0, -XYbLR, -XYbTB);
- ObjEffect_SetVertexUV(obje, 0, left, top);
- ObjEffect_SetVertexXY(obje, 1, XYbLR, -XYbTB);
- ObjEffect_SetVertexUV(obje, 1, right, top);
- ObjEffect_SetVertexXY(obje, 2, -XYbLR, XYbTB);
- ObjEffect_SetVertexUV(obje, 2, left, bottom);
- ObjEffect_SetVertexXY(obje, 3, XYbLR, XYbTB);
- ObjEffect_SetVertexUV(obje, 3, right, bottom);
- DF(obje,texture);
- return obje;
- }
- task DF(obje,texture){
- let csd = GetCurrentScriptDirectory;
- let count3 = 0;
- let count = 1;
- let count2 = 0;
- let count4 = 0;
- while(!Obj_BeDeleted(obje)){
- count3++;
- count+=2;
- count2++;
- count4++;
- if(count>=60){
- ObjEffect_SetAngle(obje,count-5,0,0);
- }
- if(count>=93){
- count = 93;
- }
- if(count2==94){
- Obj_SetPosition(obje,530,40);
- }
- if(count2>=100){
- ObjEffect_SetAngle(obje,count-count,0,0);
- count-=4;
- }
- if(count3==5){
- ObjEffect_SetTexture(obje,0);
- count3 = -5;
- }
- if(count3==0){
- ObjEffect_SetTexture(obje,texture);
- }
- if(count4>=20){
- count3 = 0;
- }
- yield;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment