Advertisement
qqwref

QQ's Growing Horror

Apr 15th, 2020 (edited)
34
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.25 KB | None | 0 0
  1. // QQ's Growing Horror
  2.  
  3. var placeNth = function(n, x) {
  4. var cnt = 0;
  5. for (var i=0; i<objects.length; i++) {
  6. if (objects[i][0] == 0) {
  7. cnt++;
  8. objects[i][3] = 100;
  9. if (cnt == n) {
  10. objects[i][1] = x;
  11. objects[i][2] = 0;
  12. objects[i][3] = 0;
  13. return;
  14. }
  15. }
  16. }
  17. }
  18.  
  19. var deathPlatform = function(x, y, z, h, w, d, c=color(255, 0, 0, 0.4)) {
  20. box3D(x, y, z, h, w, d, c, 0);
  21. if (player.pos[0] + player.size[0] >= x && player.pos[0] - player.size[0] <= x + h && player.pos[1] + player.size[1] >= y && player.pos[1] - player.size[1] <= y + w && player.pos[2] + player.size[2] >= z && player.pos[2] - player.size[2] <= z + d) {
  22. player.pos[2] = 100;
  23. }
  24. }
  25.  
  26. var baseColors = [color(0, 0, 255), color(0, 128, 255), color(0, 255, 255),
  27. color(0, 255, 128), color(0, 255, 0), color(255, 255, 0),
  28. color(255, 128, 0), color(255, 0, 0), color(255, 0, 128), color(180, 0, 255), color(180, 0, 255)];
  29. var baseColor = baseColors[player.checkpoints.length];
  30.  
  31. platform3D(-10, -2, 0, 300, 4, 2, baseColor);
  32. platform3D(-14, -2, -100, 4, 4, 102, color(0, 0, 255, 0));
  33. platform3D(290, -2, -100, 4, 4, 102, color(0, 0, 255, 0));
  34. platform3D(-10, -6, -100, 300, 4, 102, color(0, 0, 255, 0));
  35. platform3D(-10, 2, -100, 300, 4, 102, color(0, 0, 255, 0));
  36. deathPlatform(-10, -2, -100, 300, 4, 2, color(0, 0, 0, 0));
  37.  
  38. // place next checkpoint if one is hit
  39. if (player.checkpoints.length !== player.lastCheckpoints) {
  40. placeNth(player.checkpoints.length + 1, player.checkpoints.length % 2 == 0 ? 285 : -5);
  41. }
  42. player.lastCheckpoints = player.checkpoints.length;
  43.  
  44. platform3D(5, -2, -4, 2, 4, 4, baseColor);
  45. platform3D(15, -2, -8, 2, 4, 8, baseColor);
  46. platform3D(24, -2, -5, 2, 4, 5, baseColor);
  47. platform3D(32, -2, -14, 4, 4, 1, baseColor);
  48. platform3D(46, -2, -15, 4, 4, 1, baseColor);
  49. platform3D(67, -2, -15, 9, 4, 1, baseColor);
  50. platform3D(75, -2, -24, 5, 4, 1, baseColor);
  51. platform3D(100, -2, -23, 2, 4, 23, baseColor);
  52. platform3D(143, -2, -6, 2, 4, 6, baseColor);
  53. platform3D(146, -2, -15, 4, 4, 1, baseColor);
  54. platform3D(152, -2, -24, 4, 4, 1, baseColor);
  55. platform3D(158, -2, -33, 4, 4, 1, baseColor);
  56. platform3D(175, -2, -33, 4, 4, 1, baseColor);
  57. platform3D(186, -2, -33, 4, 4, 1, baseColor);
  58. platform3D(205, -2, -45, 4, 4, 24, baseColor);
  59. platform3D(200, -2, -16, 15, 4, 1, baseColor);
  60. platform3D(234, -2, -20, 6, 4, 1, baseColor);
  61. platform3D(256, -2, -12, 6, 4, 12, baseColor);
  62.  
  63. if (player.checkpoints.length >= 1) {
  64. platform3D(280, -2, -10, 2, 4, 1, baseColor);
  65. platform3D(252, -2, -6, 4, 4, 6, baseColor);
  66. platform3D(146, -2, -14, 4, 4, 14, baseColor);
  67. platform3D(209, -2, -30, 1, 4, 1, baseColor);
  68. platform3D(209, -2, -40, 1, 4, 1, baseColor);
  69. platform3D(120, -2, -18, 4, 4, 1, baseColor);
  70. platform3D(24, -2, -22, 2, 4, 17, baseColor);
  71. platform3D(92, -2, -11, 2, 4, 1, baseColor);
  72. }
  73.  
  74. if (player.checkpoints.length >= 2) {
  75. platform3D(5, -2, -17, 2, 4, 1, baseColor);
  76. deathPlatform(26, -2, -1, 4, 4, 1);
  77. platform3D(75, -2, -23, 1, 4, 8, baseColor);
  78. platform3D(120, -2, -25, 4, 4, 1, baseColor);
  79. deathPlatform(158, -2, -34, 4, 4, 1);
  80. deathPlatform(186, -2, -34, 4, 4, 1);
  81. deathPlatform(252, -2, -10, 4, 4, 4);
  82. }
  83.  
  84. if (player.checkpoints.length >= 3) {
  85. deathPlatform(280, -2, -11, 2, 4, 1);
  86. platform3D(260, -2, -21, 2, 4, 1, baseColor);
  87. platform3D(243, -2, -26, 4, 4, 1, baseColor);
  88. deathPlatform(234, -2, -33, 13, 4, 1);
  89. platform3D(141, -2, -20, 2, 4, 1, baseColor);
  90. if (player.checkpoints.length != 4) platform3D(55, -2, -11, 21, 4, 1, baseColor);
  91. deathPlatform(55, -2, -10, 21, 4, 1);
  92. }
  93.  
  94. if (player.checkpoints.length >= 4) {
  95. deathPlatform(32, -2, -15, 4, 4, 1);
  96. deathPlatform(75, -2, -30, 5, 4, 1);
  97. deathPlatform(140, -2, -40, 1, 4, 30);
  98. deathPlatform(135, -2, -30, 1, 4, 30);
  99. deathPlatform(152, -2, -25, 4, 4, 1);
  100. deathPlatform(237, -2, -22, 3, 4, 2);
  101. }
  102.  
  103. if (player.checkpoints.length >= 5) {
  104. platform3D(119, -2, -50, 1, 4, 26, baseColor);
  105. deathPlatform(100, -2, -24, 2, 4, 1);
  106. deathPlatform(260, -2, -20, 2, 4, 4);
  107. deathPlatform(205, -2, -52, 4, 4, 1);
  108. platform3D(141, -2, -30, 2, 4, 1, baseColor);
  109. platform3D(141, -2, -40, 2, 4, 1, baseColor);
  110. platform3D(46, -2, -23.5, 4, 4, 1, baseColor);
  111. deathPlatform(46, -2, -16, 4, 4, 1);
  112. }
  113.  
  114. if (player.checkpoints.length >= 6) {
  115. deathPlatform(5, -2, -5, 2, 4, 1);
  116. deathPlatform(7, -2, -1, 8, 4, 1);
  117. deathPlatform(92, -2, -10, 2, 4, 1);
  118. if (player.checkpoints.length == 6) platform3D(132, -2, -15, 3, 4, 5, baseColor);
  119. deathPlatform(200, -2, -24, 1, 4, 8);
  120. }
  121.  
  122. if (player.checkpoints.length >= 7) {
  123. deathPlatform(212, -2, -17, 3, 4, 1);
  124. deathPlatform(30, -2, -1, 70, 4, 1);
  125. }
  126.  
  127. if (player.checkpoints.length >= 8) {
  128. platform3D(134, -2, -15, 1, 4, 5, baseColor);
  129. deathPlatform(4, -2, -25, 1, 4, 9);
  130. deathPlatform(55, -2, -14, 18, 4, 3);
  131. deathPlatform(165, -2, -49, 2, 4, 30);
  132. deathPlatform(262, -2, -1, 20, 4, 1);
  133. platform3D(141, -2, -50, 2, 4, 1, baseColor);
  134. platform3D(165, -2, -50, 2, 4, 1, baseColor);
  135. }
  136.  
  137. if (player.checkpoints.length >= 9) {
  138. deathPlatform(260, -2, -16, 2, 4, 1);
  139. platform3D(187, -2, -53, 1, 4, 1, baseColor);
  140. deathPlatform(120, -2, -43, 45, 4, 1);
  141. deathPlatform(5, -2, -16, 2, 4, 11);
  142. }
  143.  
  144.  
  145.  
  146.  
  147. player.lastCheckpoints = -1;
  148. // currently invisible checkpoints
  149. for (var i=0; i<10; i++) addCheckpoint(0, 0, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement