Guest User

Object Bullets

a guest
Jan 21st, 2013
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.74 KB | None | 0 0
  1. #TouhouDanmakufu
  2. #Title[Spell 8]
  3. #Text[An attempt at making a spell]
  4. #Player[MARISA]
  5. #ScriptVersion[2]
  6.  
  7. script_enemy_main{
  8.  
  9. let CSD = GetCurrentScriptDirectory;
  10.  
  11. let imgBoss = CSD ~ "system\touhoucharacter1.png";
  12. let cut = CSD ~ "system\touhoucharacter3.png";
  13. let bg = CSD ~ "system\trees.png";
  14.  
  15. @Initialize{
  16. SetLife(2500);
  17. SetTimer(60);
  18. SetScore(100000);
  19. SetMovePosition01(GetCenterX,GetCenterY,5);
  20. LoadGraphic(imgBoss);
  21. LoadGraphic(cut);
  22. LoadGraphic(bg);
  23.  
  24. CutIn(YOUMU,"...",cut,0,0,360,290);
  25.  
  26. mainTask;
  27. }
  28.  
  29. @MainLoop{
  30. SetCollisionA(GetX,GetY,32);
  31. SetCollisionB(GetX,GetY,16);
  32. yield;
  33. }
  34.  
  35. @DrawLoop{
  36. SetTexture(imgBoss);
  37. SetRenderState(ALPHA);
  38. SetAlpha(255);
  39. SetGraphicRect(0,0,110,110);
  40. SetGraphicScale(0.7,0.7);
  41. SetGraphicAngle(0,0,0);
  42. DrawGraphic(GetX,GetY);
  43. }
  44.  
  45. @BackGround{
  46. SetTexture(bg);
  47. SetRenderState(ALPHA);
  48. SetAlpha(255);
  49. SetGraphicRect(0,0,600,690);
  50. SetGraphicScale(1,1);
  51. SetGraphicAngle(0,0,0);
  52. DrawGraphic(GetCenterX,GetCenterY);
  53. }
  54.  
  55. @Finalize{
  56. DeleteGraphic(imgBoss);
  57. DeleteGraphic(cut);
  58. DeleteGraphic(bg);
  59. }
  60.  
  61. task mainTask{
  62. yield;
  63. fire;
  64. movement;
  65. }
  66. task movement{
  67. loop{
  68. SetMovePosition02(GetCenterX, GetCenterY-96, 0);
  69. yield;
  70. }
  71. }
  72. task fire(GetEnemyX, GetEnemyY, 2, GetAngleToPlayer){
  73. let obj=Obj_Create(OBJ_SHOT);
  74. Obj_SetPosition(obj, GetEnemyX, GetEnemyY);
  75. Obj_SetAngle(obj, GetAngleToPlayer);
  76. Obj_SetSpeed(obj, 2);
  77. ObjShot_SetGraphic(obj, WHITE03);
  78. ObjShot_SetDelay (obj, 60);
  79. ObjShot_SetBombResist (obj, true);
  80. while(Obj_BeDeleted(obj)==false){
  81. yield;
  82. }
  83. }
  84. function wait(w){
  85. loop(w){yield;}
  86. }
  87. }
Advertisement
Add Comment
Please, Sign In to add comment