Among Us Platformer

Instructions: This is an Among Us platformer. There are only 6 levels, but I will be making more! Use the arrow keys or WASD to move your crewmate. \nPress g to be Lime\ny to be Yellow\nr to be Red\nd to be  Dark Blue\np to be Pink\nw to be White\nb to be Black\nand o to be Orange on the menu.\n\nClick to destroy asteroids, press space to calibrate the distributors.

@Stage\n\nwhen flag clicked\nswitch backdrop to (menu v)\n\nwhen flag clicked\nforever\n    if <<<<<key (g v) pressed?> or <key (d v) pressed?>> or <<key (o v) pressed?> or <key (p v) pressed?>>> or <<<key (y v) pressed?> or <key (w v) pressed?>> or <<key (r v) pressed?> or <key (b v) pressed?>>>> and <(backdrop [number v]) = [1]>> then\n        stop all sounds\n        switch backdrop to (crewmate v)\n        play sound [CREWMATE / IMPOSTOR v] until done\n        switch backdrop to (grey v)\n    end\nend\n\nwhen backdrop switches to [space v]\nset [level v] to [6.1]\n\nwhen I receive [space v]\nswitch backdrop to (space v)\nwait (5) seconds\nset [level v] to [6]\nswitch backdrop to (grey v)\n\n@Lime Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death01 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death02 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death03 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death04 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death05 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death06 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        point in direction (90)\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [2]> then\n        play sound [Background Music v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (g v) pressed?> then\n                show\n            end\n        end\n    end\n    if <(PLAYER) = [1]> then\n        set [☁ p1 - x v] to [0]\n        set [☁ p1 - x v] to [0]\n    end\n    go to x: (☁ P1 - X) y: (☁ P1 - Y)\nend\n\n@Orange Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (o v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@Yellow Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (y v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@Red Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (r v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@Blue Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (d v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@Pink Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (p v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@Black Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (b v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@White Crewmate\n\nwhen flag clicked\nhide\nset rotation style [left-right v]\ngo to x: (-195) y: (-116)\nset [level v] to [1]\nset [x velocity v] to [0]\nset [y velocity v] to [0]\nforever\n    Platform [10] [-1] [0.7] [3]\n    if <touching (spikes v)?> then\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <<touching (cannonball v)?> or <touching (cannonball 2 v)?>> then\n        switch costume to (crewmate_death1 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death2 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death3 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death4 v)\n        wait (0.2) seconds\n        switch costume to (crewmate_death5 v)\n        wait (0.15) seconds\n        switch costume to (crewmate_death6 v)\n        wait (0.4) seconds\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n    end\n    if <touching (goal v)?> then\n        change [level v] by (1)\n        go to x: (-195) y: (-116)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Finish v)\n    end\n    if <<(Level) = [6]> and <touching (space place v)?>> then\n        go to x: (-240) y: (0)\n        switch costume to (crewmate_space v)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        broadcast (Space v)\n        glide (5) secs to x: (240) y: (0)\n        hide\n        go to x: (-195) y: (-116)\n        show\n    end\nend\n\ndefine Platform (jump height) (gravity) (friction) (running speed)\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    point in direction (90)\n    change [x velocity v] by (running speed)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    point in direction (-90)\n    change [x velocity v] by ((running speed) * (-1))\nend\nset [x velocity v] to ((X Velocity) * (friction))\nchange x by (X Velocity)\nif <touching (level v)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [8]> or <not <touching (level v)?>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by ((Slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (X Velocity) ) )\n            if <touching (level v)?> then\n                change x by (([abs v] of (X Velocity) ) / ((X Velocity) * (-1)))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat ([ceiling v] of ([abs v] of (Y Velocity) ) )\n        if <touching (level v)?> then\n            change y by (([abs v] of (Y Velocity) ) / ((Y Velocity) * (-1)))\n        end\n    end\n    if <<([abs v] of ((Y Velocity) / (Y Velocity)) ) = [-1]> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        change [y velocity v] by (jump height)\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (crewmate_idle v)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (Walk)\nend\nif <(Y Velocity) > [2]> then\n    switch costume to (crewmate_jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (crewmate_fall v)\nend\n\nwhen flag clicked\nset [walk v] to [4]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [9]> then\n        set [walk v] to [4]\n    end\n    wait (0.07) seconds\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        forever\n            if <key (w v) pressed?> then\n                show\n            end\n        end\n    end\nend\n\n@Level\n\nwhen I receive [space v]\nhide\n\nwhen flag clicked\ngo to [back v] layer\nhide\nforever\n    go to x: (2) y: (-60)\n    switch costume to (Level)\nend\n\nwhen backdrop switches to [grey v]\nshow\n\n@Spikes\n\nwhen flag clicked\nhide\nforever\n    go to x: (2) y: (-60)\n    switch costume to (Level)\nend\n\nwhen backdrop switches to [grey v]\nshow\n\nwhen I receive [space v]\nhide\n\n@Goal\n\nwhen flag clicked\nhide\nforever\n    next costume\n    wait (0.05) seconds\n    if <(Level) = [1]> then\n        go to x: (149) y: (104)\n    end\nend\n\nwhen I receive [finish v]\nif <(Level) = [2]> then\n    go to x: (-12) y: (99)\nend\nif <(Level) = [3]> then\n    go to x: (-203) y: (114)\nend\nif <(Level) = [4]> then\n    go to x: (187) y: (130)\nend\nif <(Level) = [5]> then\n    go to x: (210) y: (-31)\nend\nif <(Level) = [6]> then\n    go to x: (213) y: (-131)\nend\n\nwhen backdrop switches to [grey v]\nshow\n\nwhen I receive [space v]\nhide\n\n@Cannon\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [4]> then\n        go to x: (-170) y: (-49)\n        show\n    end\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen I receive [space v]\nhide\n\n@Cannon 2\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [4]> then\n        go to x: (89) y: (-140)\n        show\n    end\n    if <not <(Level) = [4]>> then\n        hide\n    end\nend\n\nwhen I receive [space v]\nhide\n\n@Cannonball\n\nwhen I receive [finish v]\nif <(Level) = [4]> then\n    forever\n        go to x: (89) y: (-140)\n        show\n        glide (1) secs to x: (-101) y: (-137)\n        hide\n        wait (0.5) seconds\n    end\nend\nif <not <(Level) = [4]>> then\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [space v]\nhide\n\n@Cannonball 2\n\nwhen I receive [finish v]\nif <(Level) = [4]> then\n    forever\n        go to x: (-170) y: (-49)\n        show\n        glide (1) secs to x: (59) y: (-49)\n        hide\n        wait (0.5) seconds\n    end\nend\nif <not <(Level) = [4]>> then\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [space v]\nhide\n\n@Online Button\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [space v]\nhide\n\n@Space Place\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [space v]\nhide\n\n@Task Button\n\nwhen flag clicked\nforever\n    if <(Level) = [1]> then\n        go to x: (-142) y: (46)\n    end\n    if <(Level) = [2]> then\n        go to x: (214) y: (-137)\n    end\n    if <(Level) = [3]> then\n        go to x: (221) y: (47)\n    end\n    if <(Level) = [4]> then\n        go to x: (129) y: (70)\n    end\n    if <(Level) = [5]> then\n        go to x: (-120) y: (16)\n    end\n    if <(Level) = [6]> then\n        go to x: (-19) y: (33)\n    end\nend\n\nwhen backdrop switches to [grey v]\nshow\n\nwhen flag clicked\nswitch costume to (button v)\nhide\nforever\n    if <<<<touching (lime crewmate v)?> or <touching (orange crewmate v)?>> or <<touching (yellow crewmate v)?> or <touching (red crewmate v)?>>> or <<<touching (blue crewmate v)?> or <touching (pink crewmate v)?>> or <<touching (black crewmate v)?> or <touching (white crewmate v)?>>>> then\n        broadcast (Task1 v)\n        switch costume to (button_down v)\n    else\n        broadcast (End_Task` v)\n        switch costume to (button v)\n    end\nend\n\nwhen I receive [space v]\nhide\n\n@Asteroid\n\nwhen flag clicked\nhide\nhide variable [asteroids v]\n\nwhen I receive [task1 v]\nif <<(Level) = [1]> or <(Level) = [5]>> then\n    set [asteroids v] to [0]\n    show variable [asteroids v]\n    repeat until <(Asteroids) > [19]>\n        create clone of (_myself_ v)\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (pick random (1) to (2))\ngo to x: (300) y: (pick random (-150) to (150))\nrepeat until <(x position) < [-225]>\n    change x by (-5)\n    turn left (3) degrees\n    if <<mouse down?> and <touching (sights v)?>> then\n        change [asteroids v] by (1)\n        set [brightness v] effect to (20)\n        wait (.1) seconds\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I receive [divert v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@Sights\n\nwhen flag clicked\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [1]> or <(Level) = [5]>> then\n    show\n    wait (.1) seconds\n    repeat until <(Asteroids) > [19]>\n        go to [front v] layer\n        if <mouse down?> then\n            go to (mouse-pointer v)\n        end\n        wait until <not <mouse down?>>\n    end\n    broadcast (correct v)\n    wait (.5) seconds\n    broadcast (divert v)\n    hide variable [asteroids v]\n    hide\nend\n\n@Check\n\nwhen flag clicked\nhide\n\nwhen I receive [correct v]\ngo to [front v] layer\nshow\nwait (.1) seconds\nhide\nrepeat (2)\n    wait (.1) seconds\n    show\n    wait (.1) seconds\n    hide\nend\n\n@Calibrator3\n\nwhen flag clicked\ngo to x: (0) y: (-100)\nhide\n\nwhen I receive [lit2 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    wait (.5) seconds\n    forever\n        turn left (7) degrees\n        if <key (space v) pressed?> then\n            if <touching (plug3 v)?> then\n                point in direction (90)\n                broadcast (lit3 v)\n                broadcast (correct v)\n                stop [this script v]\n            else\n                point in direction (pick random (180) to (450))\n                broadcast (calibrate v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\n    point in direction (pick random (180) to (450))\nend\n\nwhen I receive [chart v]\nhide\n\n@Calibrator2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [lit1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    wait (.5) seconds\n    forever\n        turn left (7) degrees\n        if <key (space v) pressed?> then\n            if <touching (plug2 v)?> then\n                point in direction (90)\n                broadcast (lit2 v)\n                stop [this script v]\n            else\n                point in direction (pick random (180) to (450))\n                broadcast (calibrate v)\n                stop [this script v]\n            end\n        end\n    end\nend\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\n    point in direction (pick random (180) to (450))\nend\n\nwhen I receive [chart v]\nhide\n\n@Calibrator1\n\nwhen flag clicked\ngo to x: (0) y: (100)\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\n    point in direction (pick random (180) to (450))\n    forever\n        turn left (7) degrees\n        if <key (space v) pressed?> then\n            if <touching (plug1 v)?> then\n                point in direction (90)\n                broadcast (lit1 v)\n                stop [this script v]\n            else\n                point in direction (pick random (180) to (450))\n            end\n        end\n    end\nend\n\nwhen I receive [chart v]\nhide\n\n@Plug3\n\nwhen flag clicked\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\n    switch costume to (costume1 v)\nend\n\nwhen I receive [lit3 v]\nswitch costume to (costume2 v)\nwait (.5) seconds\nbroadcast (chart v)\nhide\n\n@Plug2\n\nwhen flag clicked\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\n    switch costume to (costume1 v)\nend\n\nwhen I receive [lit2 v]\nswitch costume to (costume2 v)\n\nwhen I receive [chart v]\nhide\n\n@Plug1\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\n    switch costume to (costume1 v)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [lit1 v]\nswitch costume to (costume2 v)\n\nwhen I receive [chart v]\nhide\n\n@Button3\n\nwhen flag clicked\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\nend\n\nwhen I receive [chart v]\nhide\n\n@Button2\n\nwhen flag clicked\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\nend\n\nwhen I receive [chart v]\nhide\n\n@Button1\n\nwhen flag clicked\nhide\n\nwhen I receive [task1 v]\nif <<(Level) = [2]> or <(Level) = [4]>> then\n    show\nend\n\nwhen I receive [chart v]\nhide\n\n@admin swipe\n\nwhen I start as a clone\nshow\nset size to (100) %\nif <(costume [name v]) = [Among Us swipe card]> then\n    set [card state v] to [insert]\n    go to [front v] layer\n    go [backward v] (1) layers\n    set size to (65) %\n    go to x: (-80) y: (-140)\n    wait until <<touching (mouse-pointer v)?> and <mouse down?>>\n    start sound [pick card v]\n    repeat (25)\n        change y by (8)\n        change x by (-2.4)\n        change size by (1.2)\n    end\n    set [card state v] to [swipe]\n    forever\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            if <(x position) < [8]> then\n                start sound [swipe v]\n                repeat until <not <mouse down?>>\n                    set [direction going? v] to []\n                    if <(mouse x) > (x position)> then\n                        set [direction going? v] to [right]\n                    end\n                    go to x: (mouse x) y: (60)\n                    if <(x position) < [-140]> then\n                        go to x: (-140) y: (60)\n                    end\n                    if <[120] < (x position)> then\n                        go to x: (120) y: (60)\n                    end\n                    change [card swipe frames v] by (1)\n                end\n                if <<(card swipe frames) > [15]> and <(card swipe frames) < [18]>> then\n                    if <(x position) > [119]> then\n                        if <(direction going?) = [right]> then\n                            set [card state v] to [accepted]\n                            start sound [accepted v]\n                            go to x: (120) y: (60)\n                            set size to (100) %\n                            repeat (25)\n                                change y by (-8)\n                                change x by (-8)\n                                change size by (-1.2)\n                            end\n                            wait (1) seconds\n                            broadcast (delete task v)\n                        end\n                    end\n                else\n                    start sound [too fast/slow/bad read v]\n                    if <[15] > (card swipe frames)> then\n                        set [card state v] to [fast]\n                    end\n                    if <[18] < (card swipe frames)> then\n                        set [card state v] to [slow]\n                    end\n                    if <not <(x position) > [119]>> then\n                        set [card state v] to [bad read]\n                    end\n                end\n            end\n        else\n            set [direction going? v] to []\n            set [card swipe frames v] to [0]\n            change x by (((-140) - (x position)) / (5))\n        end\n    end\nelse\n    if <(costume [name v]) = [front]> then\n        go to x: (0) y: (0)\n        go to [front v] layer\n    else\n        if <(costume [name v]) = [among us card swipe]> then\n            go to x: (0) y: (0)\n            go to [front v] layer\n            go [backward v] (2) layers\n        else\n            if <(costume [number v]) > [4]> then\n                go to x: (0) y: (0)\n                go to [front v] layer\n                forever\n                    switch costume to (card state)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [task1 v]\nif <<(Level) = [3]> or <(Level) = [6]>> then\n    start sound [open v]\n    hide\n    switch costume to (front v)\n    create clone of (_myself_ v)\n    switch costume to (among us card swipe v)\n    create clone of (_myself_ v)\n    switch costume to (among us swipe card v)\n    create clone of (_myself_ v)\n    switch costume to (insert v)\n    create clone of (_myself_ v)\nend\n\nwait until <<touching (mouse-pointer v)?> and <mouse down?>>\nstart sound [pick card v]\n\nset size to (100) %\n\n\n\nwhen I receive [delete task v]\ndelete this clone\n\nstop [other scripts in sprite v]\n\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [task1 v]\nif <<(Level) = [3]> or <(Level) = [6]>> then\n    wait (0) seconds\n    wait until <(card state) = [accepted]>\n    wait (1.8) seconds\n    broadcast (menu screen v)\nend\n\n@Cover\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nwait (0.01) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    wait (0.01) seconds\n    go to [front v] layer\nend\n\n