Advertisement
Guest User

Untitled

a guest
Jun 26th, 2017
48
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.65 KB | None | 0 0
  1. if (collision_point(x,y,obj_planet,1,1)) { speed = -1; if(playerShield > 0) { playerShield -= 300; } else { playerLife -= 300; } }
  2. if (collision_point(x,y,obj_planet2,1,1)) { speed = -1; }
  3. if (collision_point(x,y,obj_planet3,1,1)) { speed = -1; if(playerShield > 0) { playerShield -= 300; } else { playerLife -= 300; } }
  4. if (collision_point(x,y,obj_Enemy_Robot1,1,1)) { speed = -1; }
  5. if (collision_point(x,y,obj_sun1,1,1)) { speed = -1; }
  6. if (collision_point(x,y,obj_JugsShip,1,1)) { speed = -1; }
  7.  
  8. // CHEATING ZE !
  9. if keyboard_check_pressed(vk_f2) { shieldRegenRate = 20; powerRegenRate = 20; playerMPower = 65000; playerMShield = 65000; playerMLife = 65000; playerLife = playerMLife; }
  10. if keyboard_check_pressed(vk_f3) { missileAmmo += 500; nanobots += 500; shieldbattery += 500; }
  11. if keyboard_check_pressed(vk_numpad9) { playerCredit += 50000; }
  12.  
  13. if keyboard_check_pressed(vk_numpad7) {
  14. missx = 0;
  15. //sound_play(se_missile);
  16. while (missx < 36) {
  17. cheatshot = instance_create(x+15*cos(missdir),y+15*sin(missdir),obj_missile);
  18. cheatshot.speed = 0.1;
  19. cheatshot.direction = missdir;
  20. cheatshot.image_angle = direction-90;
  21. missdir += 360/36;
  22. missx += 1;
  23. }
  24. }
  25.  
  26.  
  27. // Rotation and movement and controlls
  28. if keyboard_check(vk_up) { if ( speed < 3) { speed += 0.5 } }
  29. if keyboard_check(vk_down) {
  30. if ( isWarp == true) { speed = 3; isWarp = false; }
  31. if ( speed > -3 ) { speed -= 0.5 }
  32. }
  33. if keyboard_check(vk_left) { direction+=3; }
  34. if keyboard_check(vk_right) { direction-=3; }
  35. image_angle = direction-90;
  36.  
  37. // Player Experience and Leveling
  38. if playerXP >= playerNXP {
  39. playerXP -=playerNXP;
  40. playerLevel +=1;
  41. playerNXP *=2;
  42. playerLife *=1.5;
  43. playerMLife *=1.5;
  44. playerShield *=1.2;
  45. playerMShield *=1.2;
  46. }
  47.  
  48. // tractor beam code
  49. if (keyboard_check_pressed(vk_numpad1)) {
  50. if(isTractor == false) {
  51. if (playerPower >= 10) {
  52. sound_play(se_Tractorbeam2);
  53. isTractor = true;
  54. playerPower -= 10;
  55. }
  56. }
  57. else { isTractor = false; } // nu kun je hem ook uitzetten!
  58. }
  59.  
  60.  
  61.  
  62. // warp mode
  63. if (keyboard_check_pressed(vk_numpad4)) {
  64. if (disWarp == false) {
  65. if (isWarp == false) {
  66. if (playerPower >= 100) {
  67. isWarp = true;
  68. speed = 15;
  69. playerPower -= 100;
  70. }
  71. }
  72. }
  73. }
  74.  
  75.  
  76. // 3 statements voor warp checking. 1) indien warp -> drain power. 2) indien warp + power op -> warp uit 3) indien warp + speed <3 -> warp uit
  77. if (isWarp == true) { playerPower -= warpDrain; }
  78. if (isWarp == true && playerPower <= 0 ) { isWarp = false; speed = 3; }
  79. if (isWarp == true && speed <= 3) { isWarp = false; }
  80.  
  81. // only count when isTractor is true
  82. if (isTractor == true) {
  83. //countTractor += 1; // count
  84. //if(countTractor = 240) { isTractor = false; countTractor = 0; } // tractor is activated for this many frames
  85. }
  86.  
  87. // dit block mag enkel worden uitgevoerd indien warp mode inactief is!
  88. if (isWarp == false) {
  89.  
  90. // Main Laser fire code
  91. if (keyboard_check(vk_space) && countlaser == -1) {
  92. countlaser = 0;
  93. }
  94. if (keyboard_check(vk_space)) {
  95. if (countlaser == 0) {
  96. if(playerPower > laserPowerDrain) {
  97. shotlaser = instance_create(playership.x,playership.y,pewshot);
  98. shotlaser.speed = 20;
  99. shotlaser.direction = playership.direction;
  100. shotlaser.image_angle = playership.direction+90;
  101. sound_play(se_pew);
  102. playerPower -= laserPowerDrain;
  103. }
  104. }
  105. if (countlaser >= 0) { countlaser += 1; }
  106. if (countlaser >= laserRefireRate) { countlaser = -1; }
  107. }
  108.  
  109. // Fire Missiles
  110. if (keyboard_check(vk_shift) && countmissile == -1) {
  111. countmissile = 0;
  112. }
  113. if (keyboard_check(vk_shift)) {
  114. if (countmissile == 0 ) {
  115. if (missileAmmo > 0) {
  116. shot = instance_create(x,y,obj_missile);
  117. shot.speed = 0.1;
  118. shot.direction = direction;
  119. shot.image_angle = direction-90;
  120. sound_play(se_missile);
  121. missileAmmo -= 1;
  122. }
  123. }
  124. if (countmissile >= 0) { countmissile += 1; }
  125. if (countmissile >= missileRefireRate) { countmissile = -1; }
  126. }
  127.  
  128. }
  129.  
  130. // player life correctie
  131. {
  132. if (playerLife < 0) { playerLife = 0; } // voorkomen dat stuff fout gaat
  133. }
  134.  
  135.  
  136. // power regen code
  137. {
  138. if (playerPower < playerMPower) { playerPower += powerRegenRate; } // regen rate
  139. if (playerPower > playerMPower) { playerPower = playerMPower; } // voorkomen dat stuff fout gaat
  140. if (playerPower < 0) { playerPower = 0; } // voorkomen dat stuff fout gaat
  141. }
  142.  
  143. // shield regen code
  144. {
  145. if (playerShield < playerMShield) { playerShield += shieldRegenRate; } // regen rate
  146. if (playerShield > playerMShield) { playerShield = playerMShield; } // voorkomen dat stuff fout gaat
  147. //if (playerShield < 0) { playerShield = 0; } // voorkomen dat stuff fout gaat
  148. }
  149.  
  150.  
  151. //Sound when object is passed at high velocity
  152. if distance_to_object(obj_Asteroid2_1) <=10 and speed >= 10 {
  153. sound_play(se_Zoof);
  154. }
  155.  
  156. if distance_to_object(obj_Asteroid2_2) <=10 and speed >= 10 {
  157. sound_play(se_Zoof);
  158. }
  159. if distance_to_object(obj_Asteroid2_3) <=10 and speed >= 10 {
  160. sound_play(se_Zoof);
  161. }
  162.  
  163. if distance_to_object(obj_Enemy_Robot1) <=10 and speed >= 10 {
  164. sound_play(se_Zoof);
  165. }
  166.  
  167. if distance_to_object(obj_EnemyRaider1) <=10 and speed >= 10 {
  168. sound_play(se_Zoof);
  169. }
  170.  
  171. if distance_to_object(obj_EnemyRaider2) <=10 and speed >= 10 {
  172. sound_play(se_Zoof);
  173. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement