Guest User

custom player script

a guest
Feb 25th, 2013
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.44 KB | None | 0 0
  1. script_player_main{
  2.  
  3. let CSD = GetCurrentScriptDirectory;
  4. let Ntex = CSD ~ "NAPlayer.png";
  5. let f = 0;
  6. let f2 = 0;
  7. let count = -1;
  8.  
  9. @Initialize{
  10.  
  11. SetSpeed(3,1);
  12. LoadGraphic(Ntex);
  13. LoadPlayerShotData(CSD ~ "NAShot.txt");
  14. }
  15.  
  16. @DrawLoop{
  17. SetTexture(Ntex);
  18. SetAlpha(255);
  19. SetGraphicScale(1,1);
  20. DrawGraphic(GetPlayerX,GetPlayerY);
  21. f+=3;
  22. f2+=3;
  23. if(f==60){ f = 0; }
  24. }
  25.  
  26. @Missed{
  27. yield;
  28. }
  29.  
  30. @SpellCard{
  31.  
  32. }
  33.  
  34. @Finalize{
  35.  
  36. }
  37.  
  38. @MainLoop {
  39.  
  40. if((GetKeyState(VK_SHOT)==KEY_PUSH | | GetKeyState(VK_SHOT)==KEY_HOLD) && count == -1){
  41. count = 0;
  42. }
  43.  
  44. if(GetKeyState(VK_SLOWMOVE)==KEY_PUSH | | GetKeyState(VK_SLOWMOVE)==KEY_HOLD) {
  45. if(count == 5){
  46. NAShot(GetPlayerX,GetPlayerY-20,20,270,1,5);
  47. NAShot(GetPlayerX,GetPlayerY-20,20,250,1,5);
  48. NAShot(GetPlayerX,GetPlayerY-20,20,290,1,5);
  49. count = -1;
  50. }
  51. }
  52.  
  53. else {
  54. if(count == 5){
  55. NAShot(GetPlayerX,GetPlayerY-20,20,270,1,5);
  56. count = -1;
  57. }
  58. }
  59.  
  60. if(count >=0) {
  61. count++;
  62. }
  63.  
  64. SetIntersectionCircle(GetPlayerX,GetPlayerY,0);
  65. yield;
  66. }
  67.  
  68.  
  69.  
  70. task NAShot(x,y,speed,dir,graphic,dmg) {
  71. let obj = Obj_Create(OBJ_SHOT);
  72.  
  73. Obj_SetPosition(obj,x,y);
  74. Obj_SetSpeed(obj,speed);
  75. Obj_SetAngle(obj,dir);
  76. Obj_SetAlpha(obj,155);
  77. ObjShot_SetGraphic(obj,graphic);
  78. ObjShot_SetDamage(obj,dmg);
  79. ObjShot_SetPenetration(obj,1);
  80. }
  81.  
  82.  
  83. function wait(w) { loop(w) { yield; } }
  84.  
  85. }
Advertisement
Add Comment
Please, Sign In to add comment