Advertisement
Guest User

Failed script...

a guest
Jun 5th, 2014
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.20 KB | None | 0 0
  1. #TouhouDanmakufu[Single]
  2. #ScriptVersion[3]
  3. #Title["Tutorial 01"]
  4. #Text["First attempt"]
  5. //{-----------------------------------------------Boss
  6. #include "script/default_system/Default_ShotConst.txt"
  7.  
  8. let bossObj; //= ObjEnemy_Create(OBJ_ENEMY_BOSS);
  9.  
  10. let imgboss = GetCurrentScriptDirectory~"Nel.png";
  11.  
  12. let GetX = 0;
  13. let GetY = 0;
  14.  
  15.  
  16.  
  17. @Initialize{
  18.  
  19.     bossObj = ObjEnemy_Create(OBJ_ENEMY_BOSS);
  20.     ObjEnemy_Regist(bossObj);
  21.    
  22.     ObjPrim_SetTexture(bossObj,imgboss);
  23.     ObjSprite2D_SetSourceRect(bossObj,0,0,64,64);
  24.     ObjSprite2D_SetDestCenter(bossObj);
  25.    
  26.     ObjMove_SetDestAtSpeed(bossObj,192,120,5);
  27.    
  28.     TMain;
  29.    
  30.  
  31.  
  32. }
  33. @Event{
  34.  
  35.     alternative(GetEventType())
  36.  
  37.  
  38.     case(EV_REQUEST_LIFE){
  39.         SetScriptResult(1500);}
  40.  
  41.  
  42.     case(EV_REQUEST_TIMER){
  43.         SetScriptResult(45);}
  44.    
  45.    
  46. }
  47. @Mainloop{
  48.  
  49. let GetX = ObjMove_GetX(bossObj);
  50. let GetY = ObjMove_GetY(bossObj);
  51. yield;
  52.  
  53. }
  54. @Finalize{
  55.  
  56. }
  57. //}
  58. //{-----------------------------------------------Tasks
  59.  
  60.  
  61. task TMain{
  62.     wait(60);
  63.     yield;
  64.     fire;
  65.  
  66. }
  67.  
  68. task fire{
  69.         loop{
  70.     CreateShotA1(GetX,GetY,3,GetAngleToPlayer(bossObj),34,10);
  71.     wait(20);
  72.     }}
  73.  
  74. //}
  75. //{-----------------------------------------------Functions
  76. task wait(w){
  77. loop(w){yield}
  78. }
  79. //}
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement