Among Us / Platformer

Instructions:                           ✩Among us platformer✩\n✦ WASD or Arrow keys to move\n✦ Avoid the impostors\n✦ Have Fun :)\n✦ 10 hearts for part 2, so tell your friends to heart it\n\n                                     ✩Thanks to✩      \n✦ InnerSloth for the music, and inspiration\n✦ Me (@Fadedflame) for code, and art\n✦ You, for making me want to work hard on projects\n\nI wish you a good day :D

@Stage\n\n@Menu\n\nwhen flag clicked\nset [music v] to [on]\nset [sfx v] to [on]\nset [menu v] to [1]\nset [tab opened v] to [0]\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (background v)\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\nend\nhide\nforever\n    if <(Menu) = [1]> then\n        wait (pick random (0.13) to (0.3)) seconds\n        create clone of (_myself_ v)\n    else\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\nset size to (100) %\ngo to x: (0) y: (0)\nclear graphic effects\nshow\nif <(costume [number v]) = [7]> then\n    if <(pick random (1) to (100)) < [4]> then\n        switch costume to (join [thing] (pick random (1) to (11)))\n        point in direction (pick random (-180) to (180))\n        go [backward v] (6) layers\n        go to x: (-300) y: (pick random (-180) to (180))\n        set size to (25) %\n        Move (pick random (1) to (2.1)) (pick random (1) to (2.99))\n    end\n    go [backward v] (5) layers\n    go to x: (-300) y: (pick random (-180) to (180))\n    set size to (pick random (80) to (140)) %\n    Move (pick random (.5) to (3)) []\nend\nif <(costume [number v]) = [8]> then\n    clear graphic effects\n    set [ghost v] effect to (100)\n    repeat (17)\n        go to [front v] layer\n        change [ghost v] effect by (-6)\n    end\n    wait until <key (q v) pressed?>\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    set [tab opened v] to [0]\n    delete this clone\nend\nif <(costume [number v]) = [9]> then\n    clear graphic effects\n    set [ghost v] effect to (100)\n    repeat (17)\n        go to [front v] layer\n        change [ghost v] effect by (-6)\n    end\n    wait until <key (q v) pressed?>\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    set [tab opened v] to [0]\n    delete this clone\nend\nif <(costume [number v]) = [4]> then\n    forever\n        set [brightness v] effect to (0)\n        if <(Tab opened) = [0]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-25)\n                if <mouse down?> then\n                    if <(SFX) = [on]> then\n                        start sound [menu click v]\n                    end\n                    set [menu v] to [0]\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [3]> then\n    forever\n        set [brightness v] effect to (0)\n        if <(Tab opened) = [0]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-25)\n                if <mouse down?> then\n                    if <(SFX) = [on]> then\n                        start sound [menu click v]\n                    end\n                    set [tab opened v] to [1]\n                    switch costume to (credits 2 v)\n                    create clone of (_myself_ v)\n                    switch costume to (credits v)\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [5]> then\n    forever\n        set [brightness v] effect to (0)\n        if <(Tab opened) = [0]> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-25)\n                if <mouse down?> then\n                    if <(SFX) = [on]> then\n                        start sound [menu click v]\n                    end\n                    set [tab opened v] to [1]\n                    switch costume to (how to play 2 v)\n                    create clone of (_myself_ v)\n                    switch costume to (how to play v)\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [6]> then\n    if <(Tab opened) = [0]> then\n        forever\n            set [brightness v] effect to (0)\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (-25)\n                if <mouse down?> then\n                    if <(SFX) = [on]> then\n                        start sound [menu click v]\n                    end\n                    set [tab opened v] to [1]\n                    switch costume to (settings 2 v)\n                    create clone of (_myself_ v)\n                    switch costume to (settings 4 v)\n                    create clone of (_myself_ v)\n                    switch costume to (settings 3 v)\n                    create clone of (_myself_ v)\n                    switch costume to (settings v)\n                end\n            end\n        end\n    end\nend\nif <(costume [number v]) = [10]> then\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    repeat (17)\n        go to [front v] layer\n        change [ghost v] effect by (-6)\n    end\n    go to [front v] layer\n    go [backward v] (3) layers\n    forever\n        wait until <key (q v) pressed?>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [tab opened v] to [0]\n        delete this clone\n    end\nend\nif <(costume [number v]) = [11]> then\n    go to [front v] layer\n    set size to (75) %\n    switch costume to (settings 4 v)\n    clear graphic effects\n    go to x: (-70) y: (62)\n    set [ghost v] effect to (100)\n    repeat (17)\n        go to [front v] layer\n        change [ghost v] effect by (-6)\n    end\n    forever\n        if <(costume [number v]) = [12]> then\n            set [sfx v] to [on]\n        else\n            set [sfx v] to [off]\n        end\n        go to x: (-70) y: (62)\n        go to [front v] layer\n        set [brightness v] effect to (0)\n        set size to (75) %\n        set [brightness v] effect to (0)\n        if <touching (mouse-pointer v)?> then\n            set size to (85) %\n            set [brightness v] effect to (-15)\n            if <mouse down?> then\n                if <(SFX) = [on]> then\n                    start sound [menu click v]\n                end\n                if <(costume [number v]) = [12]> then\n                    switch costume to (settings 3 v)\n                else\n                    switch costume to (settings 4 v)\n                end\n                wait until <not <mouse down?>>\n            end\n        end\n        if <key (q v) pressed?> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            set [tab opened v] to [0]\n            delete this clone\n        end\n    end\nend\nif <(costume [number v]) = [12]> then\n    go to [front v] layer\n    set size to (75) %\n    go to x: (-70) y: (-62)\n    set [ghost v] effect to (100)\n    repeat (17)\n        go to [front v] layer\n        change [ghost v] effect by (-6)\n    end\n    forever\n        go to [front v] layer\n        if <(costume [number v]) = [12]> then\n            set [music v] to [on]\n        else\n            set [music v] to [off]\n        end\n        set size to (75) %\n        go to x: (-70) y: (-62)\n        set [brightness v] effect to (0)\n        if <touching (mouse-pointer v)?> then\n            set size to (85) %\n            set [brightness v] effect to (-15)\n            if <mouse down?> then\n                if <(SFX) = [on]> then\n                    start sound [menu click v]\n                end\n                if <(costume [number v]) = [12]> then\n                    switch costume to (settings 3 v)\n                else\n                    switch costume to (settings 4 v)\n                end\n                wait until <not <mouse down?>>\n            end\n        end\n        if <key (q v) pressed?> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            set [tab opened v] to [0]\n            delete this clone\n        end\n    end\nend\n\ndefine Move (speed) (rotation)\nrepeat until <(x position) > [235]>\n    change x by (speed)\n    turn right (rotation) degrees\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    start sound [Among Us Theme v]\n    if <(Music) = [off]> then\n        stop all sounds\n    else\n        wait (95) seconds\n    end\n    repeat until <(Music) = [on]>\n        wait (1) seconds\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Menu) = [0]> then\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        delete this clone\n    end\nend\n\nwhen I receive [menu v]\nset [music v] to [on]\nset [sfx v] to [on]\nset [menu v] to [1]\nset [tab opened v] to [0]\nshow\nclear graphic effects\ngo to x: (0) y: (0)\nswitch costume to (background v)\nrepeat (6)\n    create clone of (_myself_ v)\n    next costume\nend\nhide\nforever\n    if <(Menu) = [1]> then\n        wait (pick random (0.13) to (0.3)) seconds\n        create clone of (_myself_ v)\n    else\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\n\n@thumbnail\n\nwhen flag clicked\nshow\nclear graphic effects\nswitch costume to (thumbnail v)\ngo to x: (0) y: (0)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\n@Choose character\n\nwhen flag clicked\nset [character color v] to []\nset [start v] to [0]\nset [menu v] to [1]\nset size to (100) %\ngo to x: (0) y: (0)\nhide\nwait until <(Menu) = [0]>\nswitch costume to (costume1 v)\ncreate clone of (_myself_ v)\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\ngo to x: (-170) y: (50)\nrepeat (3)\n    repeat (4)\n        next costume\n        create clone of (_myself_ v)\n        change x by (110)\n    end\n    set x to (-170)\n    change y by (-85)\nend\n\nwhen I receive [menu v]\nwait until <(Menu) = [0]>\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\nshow\nset size to (32) %\nif <(costume [number v]) = [1]> then\n    set size to (100) %\n    go to [back v] layer\n    go to x: (0) y: (0)\n    show\n    forever\n        if <(Start) = [1]> then\n            repeat (25)\n                change [ghost v] effect by (4)\n            end\n            delete this clone\n        end\n    end\nelse\n    if <(costume [number v]) = [2]> then\n        set size to (100) %\n        go to [back v] layer\n        go [forward v] (1) layers\n        go to x: (0) y: (0)\n        show\n        forever\n            if <(Start) = [1]> then\n                delete this clone\n            end\n        end\n    else\n        set [ghost v] effect to (100)\n        wait (0) seconds\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        forever\n            clear graphic effects\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (30)\n                if <mouse down?> then\n                    set [start v] to [1]\n                    set [character color v] to (costume [name v])\n                    broadcast (Gamestart v)\n                end\n            end\n            if <(Start) = [1]> then\n                delete this clone\n            end\n        end\n    end\nend\n\n@Levels\n\nwhen I receive [gamestart v]\nswitch costume to (1 v)\ngo to [back v] layer\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [menu v]\nhide\n\nwhen I receive [next lvl v]\nnext costume\n\n@level hitbox\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen I receive [next lvl v]\nnext costume\n\nclear graphic effects\n\n@Player\n\nwhen flag clicked\nhide\n\nwhen I receive [gamestart v]\nset [level v] to [1]\nset size to (20) %\nswitch costume to (Character Color)\nset [costume v] to (Character Color)\nset [ghost v] effect to (100)\nshow\ngo to x: (-200) y: (-20)\nrepeat (15)\n    change [ghost v] effect by (-6.6667)\nend\ngo to x: (-200) y: (-20)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    switch costume to (hitbox v)\n    point in direction (90)\n    if <(x position) > [235]> then\n        hide\n        change [level v] by (1)\n        broadcast (Next lvl v)\n        go to x: (-200) y: (-20)\n        wait (0.249) seconds\n        show\n    end\n    if <<(y position) < [-170]> or <touching color (#1d1414)?>> then\n        broadcast (dead v)\n        go to x: (-200) y: (-20)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (1)\n    end\n    set [xv v] to ((xv) * (0.85))\n    change x by (xv)\n    if <touching (level hitbox v)?> then\n        change y by (-2)\n        if <touching (level hitbox v)?> then\n            change x by ((-1) * ((xv) + ((xv) / (([abs v] of (xv) ) + (0.0001)))))\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <not <(xv) = [0]>>> then\n                set [yv v] to [8]\n                set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n            else\n                set [xv v] to [0]\n            end\n        end\n        change y by (2)\n    end\n    change y by (-3)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (level hitbox v)?>> then\n        if <(SFX) = [on]> then\n            start sound [Jump-SoundBible v]\n        end\n        set [yv v] to [10]\n    end\n    change y by (3)\n    if <(yv) > [-15]> then\n        change [yv v] by (-.6)\n    end\n    if <(yv) < [3]> then\n        change y by (-2)\n        if <not <touching (level hitbox v)?>> then\n            change y by (-1)\n        end\n        change y by (2)\n    end\n    change y by (yv)\n    if <touching (level hitbox v)?> then\n        change y by (-2)\n        if <touching (level hitbox v)?> then\n            change y by ((-1) * (yv))\n            set [yv v] to [-3]\n        end\n        change y by (2)\n    end\n    switch costume to (costume)\n    if <(xv) > [0]> then\n        switch costume to (Character Color)\n        set [costume v] to (costume [name v])\n    end\n    if <(xv) < [0]> then\n        switch costume to (Character Color)\n        next costume\n        set [costume v] to (costume [name v])\n    end\n    set [xpos v] to (round (x position))\n    set [rotation v] to ((([sin v] of (r2) ) * ((xv) / (.3))) + (90))\n    change [r2 v] by (10)\n    point in direction ((rotation) + ((xv) / (.66)))\nend\n\nforever\n\n@Impostors\n\nwhen flag clicked\nset [level v] to [0]\nset size to (20) %\nset [impostor# v] to [0]\nhide\nrepeat (8)\n    change [impostor# v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <(impostor#) < [5]> then\n    impostor (impostor#)\nelse\n    knife ((impostor#) - (4))\nend\n\ndefine impostor (#)\ngo [backward v] (5) layers\nswitch costume to (impostor v)\nif <(#) = [1]> then\n    forever\n        hide\n        switch costume to (impostor2 v)\n        if <(xpos) > (x position)> then\n            switch costume to (impostor v)\n        end\n        if <(level) = [3]> then\n            go to x: (55) y: (-130)\n            show\n        end\n        if <(level) = [4]> then\n            go to x: (117) y: (-77)\n            show\n        end\n        if <(level) = [5]> then\n            go to x: (134) y: (-67)\n            show\n        end\n        if <(level) = [6]> then\n            go to x: (80) y: (-130)\n            show\n        end\n        if <(level) = [7]> then\n            go to x: (133) y: (-60)\n            show\n        end\n        if <(level) = [8]> then\n            go to x: (133) y: (-2)\n            show\n        end\n        if <(level) = [9]> then\n            go to x: (133) y: (-16)\n            show\n        end\n        if <(level) = [10]> then\n            go to x: (-120) y: (-130)\n            show\n        end\n    end\nend\nif <(#) = [2]> then\n    forever\n        hide\n        switch costume to (impostor2 v)\n        if <(xpos) > (x position)> then\n            switch costume to (impostor v)\n        end\n        if <(level) = [5]> then\n            go to x: (-11) y: (-67)\n            show\n        end\n        if <(level) = [7]> then\n            go to x: (-8) y: (-130)\n            show\n        end\n        if <(level) = [10]> then\n            go to x: (71) y: (62)\n            show\n        end\n    end\nend\nif <(#) = [3]> then\nif <(#) = [4]> then\n\ndefine knife (##)\nswitch costume to (knife v)\nif <(##) = [1]> then\n    forever\n        hide\n        if <(level) = [3]> then\n            go to x: (55) y: (-130)\n            show\n            point towards (player v)\n        end\n        if <(level) = [4]> then\n            go to x: (117) y: (-80)\n            show\n            point towards (player v)\n        end\n        if <(level) = [5]> then\n            go to x: (134) y: (-67)\n            show\n            point towards (player v)\n        end\n        if <(level) = [6]> then\n            go to x: (80) y: (-130)\n            show\n            point towards (player v)\n        end\n        if <(level) = [7]> then\n            go to x: (133) y: (-60)\n            show\n            point towards (player v)\n        end\n        if <(level) = [8]> then\n            go to x: (133) y: (-2)\n            show\n            point towards (player v)\n        end\n        if <(level) = [9]> then\n            go to x: (133) y: (-16)\n            show\n            point towards (player v)\n        end\n        if <(level) = [10]> then\n            go to x: (-120) y: (-130)\n            show\n            point towards (player v)\n        end\n    end\nend\nif <(##) = [2]> then\n    forever\n        hide\n        if <(level) = [5]> then\n            go to x: (-11) y: (-67)\n            show\n            point towards (player v)\n        end\n        if <(level) = [7]> then\n            go to x: (-8) y: (-130)\n            show\n            point towards (player v)\n        end\n        if <(level) = [10]> then\n            go to x: (71) y: (62)\n            show\n            point towards (player v)\n        end\n    end\nend\nif <(##) = [3]> then\nif <(##) = [4]> then\n\n