Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // QQ's Growing Horror
- var placeNth = function(n, x) {
- var cnt = 0;
- for (var i=0; i<objects.length; i++) {
- if (objects[i][0] == 0) {
- cnt++;
- objects[i][3] = 100;
- if (cnt == n) {
- objects[i][1] = x;
- objects[i][2] = 0;
- objects[i][3] = 0;
- return;
- }
- }
- }
- }
- var deathPlatform = function(x, y, z, h, w, d, c=color(255, 0, 0, 0.4)) {
- box3D(x, y, z, h, w, d, c, 0);
- 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) {
- player.pos[2] = 100;
- }
- }
- var baseColors = [color(0, 0, 255), color(0, 128, 255), color(0, 255, 255),
- color(0, 255, 128), color(0, 255, 0), color(255, 255, 0),
- color(255, 128, 0), color(255, 0, 0), color(255, 0, 128), color(180, 0, 255), color(180, 0, 255)];
- var baseColor = baseColors[player.checkpoints.length];
- platform3D(-10, -2, 0, 300, 4, 2, baseColor);
- platform3D(-14, -2, -100, 4, 4, 102, color(0, 0, 255, 0));
- platform3D(290, -2, -100, 4, 4, 102, color(0, 0, 255, 0));
- platform3D(-10, -6, -100, 300, 4, 102, color(0, 0, 255, 0));
- platform3D(-10, 2, -100, 300, 4, 102, color(0, 0, 255, 0));
- deathPlatform(-10, -2, -100, 300, 4, 2, color(0, 0, 0, 0));
- // place next checkpoint if one is hit
- if (player.checkpoints.length !== player.lastCheckpoints) {
- placeNth(player.checkpoints.length + 1, player.checkpoints.length % 2 == 0 ? 285 : -5);
- }
- player.lastCheckpoints = player.checkpoints.length;
- platform3D(5, -2, -4, 2, 4, 4, baseColor);
- platform3D(15, -2, -8, 2, 4, 8, baseColor);
- platform3D(24, -2, -5, 2, 4, 5, baseColor);
- platform3D(32, -2, -14, 4, 4, 1, baseColor);
- platform3D(46, -2, -15, 4, 4, 1, baseColor);
- platform3D(67, -2, -15, 9, 4, 1, baseColor);
- platform3D(75, -2, -24, 5, 4, 1, baseColor);
- platform3D(100, -2, -23, 2, 4, 23, baseColor);
- platform3D(143, -2, -6, 2, 4, 6, baseColor);
- platform3D(146, -2, -15, 4, 4, 1, baseColor);
- platform3D(152, -2, -24, 4, 4, 1, baseColor);
- platform3D(158, -2, -33, 4, 4, 1, baseColor);
- platform3D(175, -2, -33, 4, 4, 1, baseColor);
- platform3D(186, -2, -33, 4, 4, 1, baseColor);
- platform3D(205, -2, -45, 4, 4, 24, baseColor);
- platform3D(200, -2, -16, 15, 4, 1, baseColor);
- platform3D(234, -2, -20, 6, 4, 1, baseColor);
- platform3D(256, -2, -12, 6, 4, 12, baseColor);
- if (player.checkpoints.length >= 1) {
- platform3D(280, -2, -10, 2, 4, 1, baseColor);
- platform3D(252, -2, -6, 4, 4, 6, baseColor);
- platform3D(146, -2, -14, 4, 4, 14, baseColor);
- platform3D(209, -2, -30, 1, 4, 1, baseColor);
- platform3D(209, -2, -40, 1, 4, 1, baseColor);
- platform3D(120, -2, -18, 4, 4, 1, baseColor);
- platform3D(24, -2, -22, 2, 4, 17, baseColor);
- platform3D(92, -2, -11, 2, 4, 1, baseColor);
- }
- if (player.checkpoints.length >= 2) {
- platform3D(5, -2, -17, 2, 4, 1, baseColor);
- deathPlatform(26, -2, -1, 4, 4, 1);
- platform3D(75, -2, -23, 1, 4, 8, baseColor);
- platform3D(120, -2, -25, 4, 4, 1, baseColor);
- deathPlatform(158, -2, -34, 4, 4, 1);
- deathPlatform(186, -2, -34, 4, 4, 1);
- deathPlatform(252, -2, -10, 4, 4, 4);
- }
- if (player.checkpoints.length >= 3) {
- deathPlatform(280, -2, -11, 2, 4, 1);
- platform3D(260, -2, -21, 2, 4, 1, baseColor);
- platform3D(243, -2, -26, 4, 4, 1, baseColor);
- deathPlatform(234, -2, -33, 13, 4, 1);
- platform3D(141, -2, -20, 2, 4, 1, baseColor);
- if (player.checkpoints.length != 4) platform3D(55, -2, -11, 21, 4, 1, baseColor);
- deathPlatform(55, -2, -10, 21, 4, 1);
- }
- if (player.checkpoints.length >= 4) {
- deathPlatform(32, -2, -15, 4, 4, 1);
- deathPlatform(75, -2, -30, 5, 4, 1);
- deathPlatform(140, -2, -40, 1, 4, 30);
- deathPlatform(135, -2, -30, 1, 4, 30);
- deathPlatform(152, -2, -25, 4, 4, 1);
- deathPlatform(237, -2, -22, 3, 4, 2);
- }
- if (player.checkpoints.length >= 5) {
- platform3D(119, -2, -50, 1, 4, 26, baseColor);
- deathPlatform(100, -2, -24, 2, 4, 1);
- deathPlatform(260, -2, -20, 2, 4, 4);
- deathPlatform(205, -2, -52, 4, 4, 1);
- platform3D(141, -2, -30, 2, 4, 1, baseColor);
- platform3D(141, -2, -40, 2, 4, 1, baseColor);
- platform3D(46, -2, -23.5, 4, 4, 1, baseColor);
- deathPlatform(46, -2, -16, 4, 4, 1);
- }
- if (player.checkpoints.length >= 6) {
- deathPlatform(5, -2, -5, 2, 4, 1);
- deathPlatform(7, -2, -1, 8, 4, 1);
- deathPlatform(92, -2, -10, 2, 4, 1);
- if (player.checkpoints.length == 6) platform3D(132, -2, -15, 3, 4, 5, baseColor);
- deathPlatform(200, -2, -24, 1, 4, 8);
- }
- if (player.checkpoints.length >= 7) {
- deathPlatform(212, -2, -17, 3, 4, 1);
- deathPlatform(30, -2, -1, 70, 4, 1);
- }
- if (player.checkpoints.length >= 8) {
- platform3D(134, -2, -15, 1, 4, 5, baseColor);
- deathPlatform(4, -2, -25, 1, 4, 9);
- deathPlatform(55, -2, -14, 18, 4, 3);
- deathPlatform(165, -2, -49, 2, 4, 30);
- deathPlatform(262, -2, -1, 20, 4, 1);
- platform3D(141, -2, -50, 2, 4, 1, baseColor);
- platform3D(165, -2, -50, 2, 4, 1, baseColor);
- }
- if (player.checkpoints.length >= 9) {
- deathPlatform(260, -2, -16, 2, 4, 1);
- platform3D(187, -2, -53, 1, 4, 1, baseColor);
- deathPlatform(120, -2, -43, 45, 4, 1);
- deathPlatform(5, -2, -16, 2, 4, 11);
- }
- player.lastCheckpoints = -1;
- // currently invisible checkpoints
- for (var i=0; i<10; i++) addCheckpoint(0, 0, 100);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement