let img=GetCurrentScriptDirectory~"img\dai_sprite.png";
LoadGraphic(img);
let bgimg=GetCurrentScriptDirectory~"img\daibg1.png"; LoadGraphic(bgimg);
let bgbimg=GetCurrentScriptDirectory~"img\daibg2.png"; LoadGraphic(bgbimg);
let bgcimg=GetCurrentScriptDirectory~"img\daibg2b.png"; LoadGraphic(bgcimg);
let anim=0;
let animb=0;
let drawangle=0;
let bgdiff=0;
let color=[130, 255, 0];
let colorb=[5, -5, 5];

sub anim_idle{
	SetTexture(img);
	if(GetSpeedX<0){
		animb++;
		anim=0;
		if(animb>=18){animb=17;}
		SetGraphicRect(floor(animb/6)*85, 85, floor(animb/6)*85+85, 170);
		SetGraphicAngle(180, 0, 0);
	}else if(GetSpeedX>0){
		animb++;
		anim=0;
		if(animb>=18){animb=17;}
		SetGraphicRect(floor(animb/6)*85, 85, floor(animb/6)*85+85, 170);
		SetGraphicAngle(0, 0, 0);
	}else{
		anim++;
		animb=0;
		if(anim>=18){anim=0;}
		SetGraphicRect(floor(animb/6)*85, 0, floor(animb/6)*85+85, 85);
		SetGraphicAngle(0, 0, 0);
	}
	SetGraphicScale(1, 1);
	SetAlpha(255);
	SetColor(255, 255, 255);
	DrawGraphic(GetX, GetY+5*sin(drawangle));
	drawangle+=3;
}

sub bg{
	bgdiff+=0.5;
	ascent(i in 0..3){
		color[i]=color[i]+colorb[i];
		if(color[i]==255){colorb[i]=-5;}
		if(color[i]==0){colorb[i]=5;}
	}
	SetTexture(bgimg);
	SetGraphicRect(0, 0, 512, 512);
	SetGraphicAngle(0, 0, bgdiff);
	SetGraphicScale(1.25, 1.25);
	SetAlpha(255);
	SetColor(255, 255, 255);
	DrawGraphic(GetCenterX, GetCenterY);
	SetTexture(bgbimg);
	SetGraphicRect(0, bgdiff*3, 1024, 1024+bgdiff*3);
	SetGraphicScale(0.5, 0.5);
	SetGraphicAngle(0, 0, 0);
	SetAlpha(150);
	SetColor(color[0], color[1], color[2]);
	DrawGraphic(GetCenterX, GetCenterY);
}