Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #TouhouDanmakufu
- #Title[test]
- #Text[test]
- #ScriptVersion[2]
- #Player[FREE]
- script_enemy_main{
- @Initialize{
- MagicCircle(false);
- SetRateScoreSystemEnable(false);
- //SetDefaultStatusVisible(false);
- SetLife(1000);
- //SetScore(1);
- SetX(GetCenterX);
- SetY(GetClipMaxY/3);
- main;
- }
- @MainLoop{
- SetCollisionA(GetX,GetY,32);
- yield;
- }
- @DrawLoop{}
- @Finalize{}
- @BackGround{}
- task main{
- //CreateDebugWindow();
- hypocycloid2(GetEnemyX, GetEnemyY, 12, 10, 2);
- }
- task hypocycloid2(a,b,r,k,l){
- let t = 0;
- loop(120){
- t += 360/120;
- //let x = a + r*((k-1)*cos(t) + l*cos((k-1)*t));
- //let y = b + r*((k-1)*sin(t) - l*sin((k-1)*t));
- //CreateShot01(x, y, 0, 0, RED01, 0);
- bl(a,b,t,r,k,l);
- }
- }
- task bl(aa,bb,tt,r,k,l){
- let t = tt;
- let a = aa;
- let b = bb;
- let obj = Obj_Create(OBJ_SHOT);
- let x = a + r*((k-1)*cos(t) + l*cos((k-1)*t));
- let y = b + r*((k-1)*sin(t) - l*sin((k-1)*t));
- let d = dist(x,y,a,b);
- let h = atan2(y-b,x-a);
- let t2 = 0;
- ObjShot_SetDelay(obj, 0);
- ObjShot_SetGraphic(obj, RED01);
- loop{
- Obj_SetPosition(obj, x, y);
- b+=2;
- x = a + r*((k-1)*cos(t) + l*cos((k-1)*t)) + cos(h+180)*d + cos(h+t2)*d;
- y = b + r*((k-1)*sin(t) - l*sin((k-1)*t)) + sin(h+180)*d + sin(h+t2)*d;
- t2++;
- yield;
- }
- }
- function dist(x1, y1, x2, y2){
- return ( (x1-x2)^2 + (y1-y2)^2 )^0.5;
- }
- function dist_manh(x1, y1, x2, y2){
- return (|x1-x2|) + (|y1-y2|);
- }
- function wait(n){
- loop(n){ yield; }
- }
- }//end script
Advertisement
Add Comment
Please, Sign In to add comment