Skip to content

Instantly share code, notes, and snippets.

@drakeirving
Last active August 29, 2015 14:17
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save drakeirving/1f0ea18bcd28fcfa044c to your computer and use it in GitHub Desktop.
Save drakeirving/1f0ea18bcd28fcfa044c to your computer and use it in GitHub Desktop.
Blur Test
#TouhouDanmakufu
#ScriptVersion[3]
#Title["blur test"]
@Initialize{
Init();
TMain();
}
@MainLoop{ yield; }
@Event{
alternative(GetEventType())
case(EV_REQUEST_LIFE){
SetScriptResult(1);
}
}
let dir = GetCurrentScriptDirectory();
let test = dir~"blurtest.png";
let obj;
function Init(){
obj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
ObjEnemy_Regist(obj);
}
task TMain(){
ObjPrim_SetTexture(obj, test);
ObjSprite2D_SetSourceRect(obj, 0, 0, 64, 80);
ObjSprite2D_SetDestRect(obj, 0, 0, 64, 80);
loop(30){yield;}
//BlurPosition(0.5, 0);
BlurMove(0.5, 135);
}
function BlurPosition(left, top){
ObjMove_SetPosition(obj, left, top);
//ObjSprite2D_SetDestRect(obj, left, top, 64+left, 80+top);
}
task BlurMove(speed, angle){
ObjMove_SetSpeed(obj, speed);
ObjMove_SetAngle(obj, angle);
loop{
// fix at (0,0)
ObjSprite2D_SetDestRect(obj, -ObjMove_GetX(obj), -ObjMove_GetY(obj), -ObjMove_GetX(obj)+64, -ObjMove_GetY(obj)+80);
yield;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment