function TCharge01(x,y,sts,r,g,b){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/charge.png";
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,128,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,x,y,0);
	ObjRender_SetAlpha(obj,0);
	ObjRender_SetScaleXYZ(obj,sts,sts,0);
	TAlpha;
	TShrink;
	TEffects;
	return obj;
	task TAlpha{
		let l=10;
		let alpha=255/l;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha+=255/(l*2);
			yield;
			}
		}
	task TShrink{
		let size=sts;
		let l=45;
		loop(l){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			size-=sts/l;
			yield;
			}
		Obj_Delete(obj);
	}
	task TEffects{
		loop(15){
			let angle1=rand(0,360);
			let obje=ObjEnemy_Create(OBJ_ENEMY);
			let img2=GCSD~"img/leaf.png";
			ObjPrim_SetTexture(obje,img2);
			ObjSprite2D_SetSourceRect(obje,0,1,26,30);
			ObjSprite2D_SetDestCenter(obje);
			ObjRender_SetPosition(obje,x+150*cos(angle1),y+150*sin(angle1),0);
			ObjEnemy_Regist(obje);
			ObjMove_SetSpeed(obje,0);
			ObjMove_SetAcceleration(obje,0.15);
			ObjMove_SetMaxSpeed(obje,5);
			ObjRender_SetColor(obje,r,g,b);
			ObjMove_SetAngle(obje,atan2(y-ObjMove_GetY(obje),x-ObjMove_GetX(obje)));
			TAlphaE(obje);
			TShrinkE(obje);
			TSpin(obje);
			wait(2);
			}
		task TAlphaE(obj){
		let l=30;
		let alpha=288/l;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha+=228/(l*2);
			yield;
			}
		}
		task TShrinkE(obj){
		let size=5;
		let l=60;
		loop(l){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			size-=5/l;
			yield;
			}
		Obj_Delete(obj);
		}
		task TSpin(obj){
			let spin=rand(0,360);
			let plusa=rand(-7.5,7.5);
			ObjRender_SetAngleZ(obj,spin);
			while(!Obj_IsDeleted(obj)){
				spin+=plusa;
				ObjRender_SetAngleZ(obj,spin);
				yield;
			}
		}
	}
}

function TExplode01(x,y,mxts,r,g,b){
	let obj=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/charge.png";
	ObjPrim_SetTexture(obj,img);
	ObjSprite2D_SetSourceRect(obj,0,0,128,128);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,x,y,0);
	ObjRender_SetAlpha(obj,255);
	ObjRender_SetScaleXYZ(obj,0,0,0);
	TAlpha;
	TExpand;
	TEffects;
	return obj;
	task TAlpha{
		let l=40;
		let alpha=255;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha-=255/(l);
			yield;
			}
		}
	task TExpand{
		let size=0;
		let l=40;
		loop(l){
			ObjRender_SetScaleXYZ(obj,size,size,0);
			size+=mxts/l;
			yield;
			}
		Obj_Delete(obj);
	}
	task TEffects{
		loop(10){
			let angle=rand(0,360);
			let obje=ObjEnemy_Create(OBJ_ENEMY);
			let img2=GCSD~"img/leaf.png";
			ObjPrim_SetTexture(obje,img2);
			ObjSprite2D_SetSourceRect(obje,0,1,26,30);
			ObjSprite2D_SetDestCenter(obje);
			ObjRender_SetPosition(obje,x,y,0);
			ObjEnemy_Regist(obje);
			ObjMove_SetSpeed(obje,4);
			ObjRender_SetColor(obje,r,g,b);
			ObjMove_SetAngle(obje,angle);
			ObjRender_SetAlpha(obje,128);
			ObjRender_SetScaleXYZ(obje,3,3,0);
			TAlphaE(obje);
			TSpin(obje);
			}
		task TAlphaE(obj){
//		loop(30){ yield; }
		let l=150;
		let alpha=128;
		loop(l){
			ObjRender_SetAlpha(obj,alpha);
			alpha-=255/(l);
			yield;
			}
		Obj_Delete(obj);
		}
		task TSpin(obj){
			let spin=rand(0,360);
			let plusa=rand(-15,15);
			ObjRender_SetAngleZ(obj,spin);
			while(!Obj_IsDeleted(obj)){
				spin+=plusa;
				ObjRender_SetAngleZ(obj,spin);
				yield;
			}
		}
	}
}

function TDrawBoss{
	let sPath=GCSD~"img/spellseal.png";
    let objBoss=ObjEnemy_Create(OBJ_ENEMY_BOSS);
    ObjEnemy_Regist(objBoss);
    let imgSwamp=GCSD~"img/boss.png";
    ObjPrim_SetTexture(objBoss,imgSwamp);
	TAngle;
    ObjSprite2D_SetDestCenter(objBoss);
	let objS=FDrawMagicCircle(objBoss,0,0,4,128);
	TCheckForSpell;
	return objBoss;
	while(!Obj_IsDeleted(objBoss)){ yield; }
	Obj_Delete(objS);
	task TAngle{
		while(!Obj_IsDeleted(objBoss)){
			if(cos(ObjMove_GetAngle(objBoss))>0){
				ObjSprite2D_SetSourceRect(objBoss,107,102,180,159);
			}
			if(cos(ObjMove_GetAngle(objBoss))<0){
				ObjSprite2D_SetSourceRect(objBoss,107,19,180,76);
			}
			yield;
		}
	}
	task TCheckForSpell{
		let s=5;
		let sizes=[1.75,2.20];
		ascent(i in 0..length(sizes)){
			TBarrier(sizes[i],s);
			s=-s;
		}
		task TBarrier(size,spint){
			let objScene=GetEnemyBossSceneObjectID();
			let scale=3;
			let oAlpha=0;
			let alpha=255;
			let obj=ObjPrim_Create(OBJ_SPRITE_2D);
			ObjPrim_SetTexture(obj,sPath);
			ObjSprite2D_SetSourceRect(obj,0,0,128,128);
			ObjSprite2D_SetDestCenter(obj);
			ObjRender_SetAlpha(obj,0);
			ObjRender_SetScaleXYZ(obj,scale,scale,0);
			let X=ObjRender_GetX(objBoss);
			let Y=ObjRender_GetY(objBoss);
			TBMove;
			while(!Obj_IsDeleted(objBoss)){
				if(objScene!=ID_INVALID&&ObjEnemyBossScene_GetInfo(objScene,INFO_IS_SPELL)==true&&IsPlayerSpellActive==true){
					loop(20){
						ObjRender_SetScaleXYZ(obj,scale,scale,0);
						ObjRender_SetAlpha(objBoss,alpha);
						ObjRender_SetAlpha(obj,oAlpha);
						oAlpha+=128/20;
						alpha-=128/20;
						scale-=size/20;
						yield;
					}
					while(IsPlayerSpellActive==true&&!Obj_IsDeleted(objBoss)&&objScene!=ID_INVALID){
						yield;
					}
					loop(20){
						ObjRender_SetScaleXYZ(obj,scale,scale,0);
						ObjRender_SetAlpha(objBoss,alpha);
						ObjRender_SetAlpha(obj,oAlpha);
						oAlpha-=128/20;
						alpha+=128/20;
						scale+=size/20;
						yield;
					}
					ObjRender_SetAlpha(obj,0);
					ObjRender_SetScaleXYZ(obj,scale,scale,0);
					alpha=255;
					ObjRender_SetAlpha(objBoss,alpha);
				}
				yield;
				if(ObjEnemy_GetInfo(objBoss,INFO_LIFE)<0||Obj_IsDeleted(objBoss)){ break; }
			}
			Obj_Delete(obj);
			task TBMove{
				let spin=0;
				while(!Obj_IsDeleted(obj)){
					X=ObjRender_GetX(objBoss);
					Y=ObjRender_GetY(objBoss);
					ObjRender_SetPosition(obj,X,Y,0);
					ObjRender_SetAngleXYZ(obj,0,0,spin*spint);
					spin++;
					yield;
				}
			}
		}
	}
}

function TDrawMudkip(x,y){
    let objMud=ObjEnemy_Create(OBJ_ENEMY);
    let img=GCSD~"img/mudkip.png";
    ObjPrim_SetTexture(objMud,img);
	ObjEnemy_Regist(objMud);
	TAngle;
    ObjSprite2D_SetDestCenter(objMud);
	let obj=FDrawMagicCircle(objMud,0,0,4,128);
	ObjEnemy_SetLife(objMud,1500);
	ObjRender_SetPosition(objMud,x,y,0);
	TLife;
	TIntersect;
	return objMud;
	while(!Obj_IsDeleted(objMud)){ yield; }
	Obj_Delete(obj);
	task TAngle{
		while(!Obj_IsDeleted(objMud)){
			if(cos(ObjMove_GetAngle(objMud))>0){
				ObjSprite2D_SetSourceRect(objMud,0,43,39,85);
			}
			if(cos(ObjMove_GetAngle(objMud))<0){
				ObjSprite2D_SetSourceRect(objMud,0,0,39,42);
			}
			yield;
		}
	}
	task TLife{
		let maxlife=ObjEnemy_GetInfo(objMud,INFO_LIFE);
		let renderliferate=0;
		let path=GCSD~"img/life.png";
		let obj=ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj,path);
		Obj_SetRenderPriority(obj,0.8);
		loop{
			let totallife=ObjEnemy_GetInfo(objMud,INFO_LIFE);
			let liferate=min(totallife/maxlife,renderliferate);
			ObjSprite2D_SetSourceRect(obj,0,4,16,12);
			ObjSprite2D_SetDestRect(obj,8,8,8+50*liferate,16);
			if(renderliferate!=1){
				renderliferate+=0.01;
				renderliferate=min(renderliferate,1);
				ObjEnemy_SetDamageRate(objMud,0,0);
			}
			ObjRender_SetPosition(obj,ObjMove_GetX(objMud)-34,ObjMove_GetY(objMud)+10,0);
			yield;
		}
	}
	task TIntersect{
		while(!Obj_IsDeleted(objMud)){
			if(ObjEnemy_GetInfo(objMud,INFO_LIFE)<=0){
				break;
			}
			ObjEnemy_SetIntersectionCircleToShot(objMud,ObjMove_GetX(objMud),ObjMove_GetY(objMud),20);
			ObjEnemy_SetIntersectionCircleToPlayer(objMud,ObjMove_GetX(objMud),ObjMove_GetY(objMud),20);
			ObjEnemy_SetDamageRate(objMud,100,25);
			yield;
		}
		TExplosionA(ObjMove_GetX(objMud),ObjMove_GetY(objMud),12,0.5);
		Obj_Delete(obj);
		Obj_Delete(objMud);
	}
}

function TDrawMarsh(x,y){
    let objMarsh=ObjEnemy_Create(OBJ_ENEMY);
    let img=GCSD~"img/marshtomp.png";
    ObjPrim_SetTexture(objMarsh,img);
	ObjEnemy_Regist(objMarsh);
	TAngle;
    ObjSprite2D_SetDestCenter(objMarsh);
	let obj=FDrawMagicCircle(objMarsh,0,0,4,128);
	ObjEnemy_SetLife(objMarsh,2000);
	ObjRender_SetPosition(objMarsh,x,y,0);
	TLife;
	TIntersect;
	return objMarsh;
	while(!Obj_IsDeleted(objMarsh)){ yield; }
	Obj_Delete(obj);
	task TAngle{
		while(!Obj_IsDeleted(objMarsh)){
			if(cos(ObjMove_GetAngle(objMarsh))>0){
				ObjSprite2D_SetSourceRect(objMarsh,0,56,50,112);
			}
			if(cos(ObjMove_GetAngle(objMarsh))<0){
				ObjSprite2D_SetSourceRect(objMarsh,0,0,50,56);
			}
			yield;
		}
	}
	task TLife{
		let maxlife=ObjEnemy_GetInfo(objMarsh,INFO_LIFE);
		let renderliferate=0;
		let path=GCSD~"img/life.png";
		let obj=ObjPrim_Create(OBJ_SPRITE_2D);
		ObjPrim_SetTexture(obj,path);
		Obj_SetRenderPriority(obj,0.8);
		loop{
			let totallife=ObjEnemy_GetInfo(objMarsh,INFO_LIFE);
			let liferate=min(totallife/maxlife,renderliferate);
			ObjSprite2D_SetSourceRect(obj,0,4,16,12);
			ObjSprite2D_SetDestRect(obj,8,8,8+50*liferate,16);
			if(renderliferate!=1){
				renderliferate+=0.01;
				renderliferate=min(renderliferate,1);
				ObjEnemy_SetDamageRate(objMarsh,0,0);
			}
			ObjRender_SetPosition(obj,ObjMove_GetX(objMarsh)-34,ObjMove_GetY(objMarsh)+20,0);
			yield;
		}
	}
	task TIntersect{
		while(!Obj_IsDeleted(objMarsh)){
			if(ObjEnemy_GetInfo(objMarsh,INFO_LIFE)<=0){
				break;
			}
			ObjEnemy_SetIntersectionCircleToShot(objMarsh,ObjMove_GetX(objMarsh),ObjMove_GetY(objMarsh),26);
			ObjEnemy_SetIntersectionCircleToPlayer(objMarsh,ObjMove_GetX(objMarsh),ObjMove_GetY(objMarsh),26);
			ObjEnemy_SetDamageRate(objMarsh,100,25);
			yield;
		}
		TExplosionA(ObjMove_GetX(objMarsh),ObjMove_GetY(objMarsh),12,0.5);
		Obj_Delete(obj);
		Obj_Delete(objMarsh);
	}
}

function TWaterHide(obj,let size,b){
	let f1;
	let f2;
	let f3;
	let f4;
	let change=0;
	alternative(size)
		case("SMALL"){
			f1=[4,140,27,175];
			f2=[34,139,60,176];
			f3=[70,137,94,178];
			f4=[98,141,125,175];
			}
		case("LARGE"){
			f1=[0,210,62,251];
			f2=[70,213,116,248];
			f3=[130,212,182,249];
			f4=[201,210,250,251];
			}
	let water=ObjPrim_Create(OBJ_SPRITE_2D);
	let img=GCSD~"img/stg4benm.png";
	ObjPrim_SetTexture(water,img);
	ObjSprite2D_SetSourceRect(water,f1[0],f1[1],f1[2],f1[3]);
	ObjSprite2D_SetDestCenter(water);
	ObjRender_SetAlpha(water,192);
	ObjRender_SetAlpha(obj,0);
	TAnimate;
	if(b==true){
		loop(5){	
			TCallBubbles(ObjRender_GetX(obj),ObjRender_GetY(obj));
		}
	}
	return water;
	while(!Obj_IsDeleted(water)){ yield; }
	Obj_Delete(water);
	task TAnimate{
		while(!Obj_IsDeleted(water)){
			if(change==4){
				change=0;
			}
			if(change==0){
				ObjSprite2D_SetSourceRect(water,f1[0],f1[1],f1[2],f1[3]);
			}
			if(change==1){
				ObjSprite2D_SetSourceRect(water,f2[0],f2[1],f2[2],f2[3]);
			}
			if(change==2){
				ObjSprite2D_SetSourceRect(water,f3[0],f3[1],f3[2],f3[3]);
			}
			if(change==3){
				ObjSprite2D_SetSourceRect(water,f4[0],f4[1],f4[2],f4[3]);
			}
			wait(5);
			change++;
			}
		}
	task TBubble(bobj){
		let alpha=255;
		let a;
		loop(20){
			a=255/20;
			ObjRender_SetAlpha(bobj,alpha);
			alpha-=a;
			yield;
			}
		}
	}

task TCallBubbles(x,y){
	let bubble=ObjPrim_Create(OBJ_SPRITE_2D);
	let img2=GCSD~"img/stg4benm.png";
	ObjPrim_SetTexture(bubble,img2);
	ObjSprite2D_SetSourceRect(bubble,2,177,31,206);
	ObjSprite2D_SetDestCenter(bubble);
	ObjRender_SetPosition(bubble,x+rand(-25,25),y+rand(-25,25),0);
	ObjRender_SetAlpha(bubble,192);
	ObjRender_SetAngleZ(bubble,rand(0,360));
	let alpha=255;
	let a;
	let scale=0;
	let s;
	loop(30){
		a=255/30;
		s=5/30;
		ObjRender_SetAlpha(bubble,alpha);
		ObjRender_SetScaleXYZ(bubble,scale,scale,0);
		alpha-=a;
		scale+=s;
		yield;
		}
	Obj_Delete(bubble);
}

function FDrawMagicCircle(BOSS,xadd,yadd,zadd,alpha){
	let xspin=0;
	let yspin=0;
	let zspin=0;
	let scale=0;
	let obj=ObjEnemy_Create(OBJ_ENEMY);
	ObjEnemy_Regist(obj);
	let imgFam=GCSD~"img/graphics2.png";
	LoadTexture(imgFam);
	ObjPrim_SetTexture(obj,imgFam);
	ObjSprite2D_SetSourceRect(obj,129,81,256,208);
	ObjSprite2D_SetDestCenter(obj);
	ObjRender_SetPosition(obj,0,0,0);
	ObjRender_SetAlpha(obj,alpha);
	TSpinSize;
	return obj;
	task TSpinSize{
		while(!Obj_IsDeleted(BOSS)){
			ObjRender_SetAngleXYZ(obj,xspin,yspin,zspin);
			xspin+=xadd;
			yspin+=yadd;
			zspin+=zadd;
			let result=sin(scale)/3+3.25;
			ObjRender_SetScaleXYZ(obj,result/2,result/2,0);
			scale+=3;
			ObjMove_SetPosition(obj,ObjMove_GetX(BOSS),ObjMove_GetY(BOSS));
			yield;
		}
		Obj_Delete(obj);
	}
}

function FDrawFamiliar(BOSS,x,y,z,xadd,yadd,zadd,alpha,r,g,b){
        let xspin=0;
        let yspin=0;
        let zspin=0;
		let obj=ObjEnemy_Create(OBJ_ENEMY);
        ObjEnemy_Regist(obj);
        let imgFam=GCSD~"img/etama2.png";
        ObjPrim_SetTexture(obj,imgFam);
        ObjSprite2D_SetSourceRect(obj,193,113,256,176);
        ObjSprite2D_SetDestCenter(obj);
		ObjRender_SetPosition(obj,x,y,z);
        ObjRender_SetAlpha(obj,alpha);
        ObjRender_SetColor(obj,r,g,b);
        CheckBossExists;
		TSpin;
		task TSpin{
			while(!Obj_IsDeleted(obj)){
				ObjRender_SetAngleXYZ(obj,xspin,yspin,zspin);
				xspin+=xadd;
				yspin+=yadd;
				zspin+=zadd;
				yield;
			}
		}
        return obj;
        task CheckBossExists{
                while(!Obj_IsDeleted(obj)){
                        if(ObjEnemy_GetInfo(BOSS,INFO_LIFE)<=0){
                                Obj_Delete(obj);
                        }
					yield;
                }
        }
}

task Cutin(obj,text){
	let alpha=0;
	let scale=4;
	let objTxt=ObjText_Create;
	ObjText_SetText(objTxt,text);
	ObjText_SetFontSize(objTxt,10);
	ObjText_SetFontColorTop(objTxt,255,255,255);
	ObjText_SetFontColorBottom(objTxt,255,0,0);
	ObjText_SetFontBorderType(objTxt,BORDER_FULL);
	ObjText_SetFontBorderColor(objTxt,0,0,0);
	ObjText_SetFontBorderWidth(objTxt,1);
	ObjText_SetHorizontalAlignment(objTxt,ALIGNMENT_LEFT);
	ObjText_SetMaxWidth(objTxt,380);
	Obj_SetRenderPriority(objTxt,0.8);
	ObjRender_SetPosition(objTxt,GetStgFrameWidth-375,GetStgFrameHeight-145,0);
//	ObjText_SetAutoTransCenter(objTxt,true);
	
	let path=GCSD~"img/Swampcutin.png";
	let cut=ObjPrim_Create(OBJ_SPRITE_2D);
	ObjPrim_SetTexture(cut,path);
	ObjSprite2D_SetSourceRect(cut,0,0,408,338);
	ObjRender_SetScaleXYZ(cut,1,1,1);
    ObjSprite2D_SetDestCenter(cut);
	ObjRender_SetPosition(cut,-(488/4),GetStgFrameHeight/2,0);
	Obj_SetRenderPriority(cut,0.78);
	ObjRender_SetScaleXYZ(cut,0.75,0.75,0.75);
	TMove;
	TCut;
	TImage;
	let dir=2;
	ascent(x in -4..4){
		ascent(y in -5..5){
			TText(431*0.75*x,250+(34*y),dir);
			dir=-dir;
		}
	}
	task TMove{
	let yscale=1;
	let ypos=GetStgFrameHeight-150;
	loop(20){
		alpha+=12.75;
		scale-=0.15;
		ObjRender_SetAlpha(objTxt,alpha);
		ObjRender_SetScaleXYZ(objTxt,scale,scale,1);
		yield;
	}
	wait(45);
	loop(28){
		ObjRender_SetY(objTxt,ypos);
		ypos-=(GetStgFrameHeight-150)/32;
		yield;
	}
	while(!Obj_IsDeleted(obj)){yield;}
		loop(20){
			alpha-=12.75;
			yscale+=0.05;
			ObjRender_SetAlpha(objTxt,alpha);
			ObjRender_SetScaleXYZ(objTxt,yscale,yscale,1);
			yield;
		}
		Obj_Delete(objTxt);
	}
	task TCut{
		let speed=50;
		ObjRender_SetX(cut,ObjRender_GetX(cut)+speed);
		yield;
		while(speed>0.1){
			ObjRender_SetX(cut,ObjRender_GetX(cut)+speed);
			speed-=speed/6;
			yield;
		}
		loop(45){
			ObjRender_SetX(cut,ObjRender_GetX(cut)+speed);
			yield;
		}
		let cutScaleX=0.75;
		let cutScaleY=0.75;
		let d=30;
		while(cutScaleY>0){
			ObjRender_SetScaleXYZ(cut,cutScaleX,cutScaleY,0.75);
			cutScaleX+=cutScaleX/16/d+0.01;
			cutScaleY-=cutScaleY/d+0.01;
			d-=2.5;
			yield;
		}
		Obj_Delete(cut);
	}
	task TImage{
		let alpha2=0;
		let scale2=4;
		let yscale2=1;
		let ypos2=ObjRender_GetY(objTxt)-5;
		let objI=ObjPrim_Create(OBJ_SPRITE_2D);
		let pathI=GCSD~"img/cut.png";
		ObjPrim_SetTexture(objI,pathI);
		ObjSprite2D_SetSourceRect(objI,119,3,383,60);
		ObjSprite2D_SetDestCenter(objI);
		Obj_SetRenderPriority(objI,0.79);
		ObjRender_SetPosition(objI,ObjRender_GetX(objTxt)+125,ObjRender_GetY(objTxt)-5,0);
		ObjRender_SetAlpha(objI,0);
		ObjRender_SetScaleXYZ(objI,scale2,scale2,0);
		SetColor(objI,"RED","NORMAL");
		loop(20){
			alpha2+=12.75;
			scale2-=0.15;
			ObjRender_SetAlpha(objI,alpha2);
			ObjRender_SetScaleXYZ(objI,scale2,scale2,1);
			yield;
		}
		wait(45);
		loop(28){
			ObjRender_SetPosition(objI,ObjRender_GetX(objTxt)+125,ObjRender_GetY(objTxt)-5,0);
			yield;
		}
		while(!Obj_IsDeleted(obj)){yield;}
		loop(20){
			alpha2-=12.75;
			yscale2+=0.05;
			ObjRender_SetAlpha(objI,alpha2);
			ObjRender_SetScaleXYZ(objI,yscale2,yscale2,1);
			yield;
		}
		Obj_Delete(objI);
	}
	task TText(x,y,s){
		let alpha=0;
		let objT=ObjPrim_Create(OBJ_SPRITE_2D);
		let pathT=GCSD~"img/cuttext.png";
		ObjPrim_SetTexture(objT,pathT);
		ObjSprite2D_SetSourceRect(objT,0,1,431,35);
		ObjSprite2D_SetDestCenter(objT);
		Obj_SetRenderPriority(objT,0.77);
		ObjRender_SetPosition(objT,x,y,0);
		ObjRender_SetAlpha(objT,0);
		ObjRender_SetScaleXYZ(objT,0.5,0.5,1);
		TMove;
		loop(30){
			ObjRender_SetAlpha(objT,alpha);
			alpha+=128/30;
			yield;
		}
		ObjRender_SetAlpha(objT,192);
		wait(45);
		loop(60){
			ObjRender_SetAlpha(objT,alpha);
			alpha-=128/30;
			yield;
		}
		ObjRender_SetAlpha(objT,0);
		Obj_Delete(objT);
		task TMove{
		 let speed=s;
			while(!Obj_IsDeleted(objT)){
				ObjRender_SetPosition(objT,x+speed,y,0);
				speed+=s;
				yield;
			}
		}
	}
}

function SetColor(obj,c,b){
	let colour=GetRGB(c,b);
	ObjRender_SetColor(obj,colour[0],colour[1],colour[2]);
}

function GetRGB(let color,let brightness){
		alternative(color)
		case("RED") {
			alternative(brightness)
			case("NORMAL") { return [255, 51, 51]; }
			case("DARK") { return [255, 0, 0]; }
			case("BRIGHT") { return [255, 102, 102]; }
		}
		case("ORANGE") {
			alternative(brightness)
			case("NORMAL") { return [255, 153, 51]; }
			case("DARK") { return [255, 128, 0]; }
			case("BRIGHT") { return [255, 178, 102]; }
		}
		case("YELLOW") {
			alternative(brightness)
			case("NORMAL") { return [255, 255, 51]; }
			case("DARK") { return [255, 255, 0]; }
			case("BRIGHT") { return [255, 255, 102]; }
		}
		case("LIME") {
			alternative(brightness)
			case("NORMAL") { return [153, 255, 51]; }
			case("DARK") { return [128, 255, 0]; }
			case("BRIGHT") { return [178, 255, 102]; }
		}
		case("GREEN") {
			alternative(brightness)
			case("NORMAL") { return [153, 255, 153]; }
			case("DARK") { return [0, 255, 0]; }
			case("BRIGHT") { return [102, 255, 102]; }
		}
		case("MINT","TEAL") {
			alternative(brightness)
			case("NORMAL") { return [51, 255, 153]; }
			case("DARK") { return [0, 255, 128]; }
			case("BRIGHT") { return [102, 255, 178]; }
		}
		case("SKY","AQUA") {
			alternative(brightness)
			case("NORMAL") { return [51, 255, 255]; }
			case("DARK") { return [0, 255, 255]; }
			case("BRIGHT") { return [102, 255, 255]; }
		}
		case("BLUE") {
			alternative(brightness)
			case("NORMAL") { return [51, 153, 255]; }
			case("DARK") { return [0, 128, 255]; }
			case("BRIGHT") { return [102, 178, 255]; }
		}
		case("NAVY","INDIGO") {
			alternative(brightness)
			case("NORMAL") { return [51, 51, 255]; }
			case("DARK") { return [0, 0, 255]; }
			case("BRIGHT") { return [102, 102, 255]; }
		}
		case("PURPLE") {
			alternative(brightness)
			case("NORMAL") { return [153, 51, 255]; }
			case("DARK") { return [128, 0, 255]; }
			case("BRIGHT") { return [178, 102, 255]; }
		}
		case("VIOLET","MAGENTA") {
			alternative(brightness)
			case("NORMAL") { return [255, 51, 255]; }
			case("DARK") { return [255, 0, 255]; }
			case("BRIGHT") { return [255, 102, 255]; }
		}
		case("FUSCHIA","ROSE") {
			alternative(brightness)
			case("NORMAL") { return [255, 51, 153]; }
			case("DARK") { return [255, 0, 128]; }
			case("BRIGHT") { return [255, 102, 178]; }
		}
	}