Guest User

Untitled

a guest
Feb 4th, 2013
123
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.50 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[test]
  3. #Text[test]
  4. #ScriptVersion[2]
  5. #Player[FREE]
  6.  
  7. script_enemy_main{
  8.  
  9. @Initialize{
  10. MagicCircle(false);
  11. SetRateScoreSystemEnable(false);
  12. //SetDefaultStatusVisible(false);
  13. SetLife(1000);
  14. //SetScore(1);
  15. SetX(GetCenterX);
  16. SetY(GetClipMaxY/3);
  17. main;
  18. }
  19.  
  20. @MainLoop{
  21. SetCollisionA(GetX,GetY,32);
  22. yield;
  23. }
  24.  
  25. @DrawLoop{}
  26. @Finalize{}
  27.  
  28. @BackGround{}
  29.  
  30. task main{
  31. //CreateDebugWindow();
  32.  
  33. hypocycloid2(GetEnemyX, GetEnemyY, 12, 10, 2);
  34.  
  35.  
  36.  
  37. }
  38.  
  39. task hypocycloid2(a,b,r,k,l){
  40. let t = 0;
  41. loop(120){
  42. t += 360/120;
  43. //let x = a + r*((k-1)*cos(t) + l*cos((k-1)*t));
  44. //let y = b + r*((k-1)*sin(t) - l*sin((k-1)*t));
  45. //CreateShot01(x, y, 0, 0, RED01, 0);
  46. bl(a,b,t,r,k,l);
  47.  
  48.  
  49. }
  50. }
  51.  
  52. task bl(aa,bb,tt,r,k,l){
  53. let t = tt;
  54. let a = aa;
  55. let b = bb;
  56. let obj = Obj_Create(OBJ_SHOT);
  57. let x = a + r*((k-1)*cos(t) + l*cos((k-1)*t));
  58. let y = b + r*((k-1)*sin(t) - l*sin((k-1)*t));
  59. let d = dist(x,y,a,b);
  60. let h = atan2(y-b,x-a);
  61. let t2 = 0;
  62. ObjShot_SetDelay(obj, 0);
  63. ObjShot_SetGraphic(obj, RED01);
  64. loop{
  65. Obj_SetPosition(obj, x, y);
  66. b+=2;
  67. x = a + r*((k-1)*cos(t) + l*cos((k-1)*t)) + cos(h+180)*d + cos(h+t2)*d;
  68. y = b + r*((k-1)*sin(t) - l*sin((k-1)*t)) + sin(h+180)*d + sin(h+t2)*d;
  69. t2++;
  70. yield;
  71. }
  72. }
  73.  
  74. function dist(x1, y1, x2, y2){
  75. return ( (x1-x2)^2 + (y1-y2)^2 )^0.5;
  76. }
  77.  
  78. function dist_manh(x1, y1, x2, y2){
  79. return (|x1-x2|) + (|y1-y2|);
  80. }
  81.  
  82. function wait(n){
  83. loop(n){ yield; }
  84. }
  85.  
  86. }//end script
Advertisement
Add Comment
Please, Sign In to add comment