Pen Platformer

Instructions: THE UNFINISHED VERSION OF RESCUING GEORGE (THE SEQUEL) IS POSTED NOW IF ANY OF YOU WANTED TO PLAY IT\n*UPDATE 2021* GUYS JUST PRESS THE GREEN FLAG AGAIN IF THERE'S A CLOUD IN THE SKY THAT WON'T GO AWAY\n\n*UPDATE 2020*\nBruh okay idk why the rain doesn't work properly anymore but like... thanks for still playing guys <3 I love you all\n\n*UPDATE*\nSo it still has the weird bitmappy effect, BUT ALL LEVELS ARE POSSIBLE NOW! (including the "Thanks!" level!)\n\nDouble-click the green flag.\nuse the arrow keys or a w d\nDon't fall in the holes\nDon't touch the thunder clouds\nTouch the right edge of the screen to go to the next level\nIf you get stuck, click on the ball.\n\nTO WALL JUMP: Hold the up arrow key and the right arrow key when you're touching the wall.\n

@Stage\n\n@Player\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y vel v] by (-1)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    point in direction (-90)\n    change [x vel v] by (speed)\n    next costume\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    point in direction (90)\n    change [x vel v] by ((speed) * (-1))\n    next costume\nend\nset [x vel v] to ((X vel) * (friction))\nchange x by (X vel)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X vel) ) / (X vel)) * (-1))\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        start sound (pick random (1) to (4))\n        if <(X vel) > [0]> then\n            set [x vel v] to [-12]\n        else\n            set [x vel v] to [12]\n        end\n        set [y vel v] to [12]\n    else\n        set [x vel v] to [0]\n    end\nend\nchange y by (Y vel)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y vel) ) / (Y vel)) * (-1))\n    end\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> and <touching (level v)?>> then\n    start sound [Jump v]\n    set [y vel v] to (jump height)\nend\nchange y by (1)\n\nwhen flag clicked\nset [time v] to [0]\nshow variable [time v]\nset [color v] effect to (0)\ngo to x: (-190) y: (0)\nset size to (30) %\ngo to [front v] layer\ngo [backward v] (1) layers\npoint in direction (-90)\nset rotation style [left-right v]\nclear graphic effects\nset [x vel v] to [0]\nset [y vel v] to [0]\n\nwhen flag clicked\nforever\n    if <not <<key (right arrow v) pressed?> or <key (left arrow v) pressed?>>> then\n        switch costume to (among us character v)\n    end\nend\n\nwhen I receive [change colour v]\nchange [color v] effect by (10)\nwait (0.09) seconds\n\nwhen I receive [start v]\nset [ghost v] effect to (0)\nforever\n    Platformer Physics [1] [0.9] [13]\n    if <<touching (danger v)?> or <touching (smasher v)?>> then\n        die\n        go to x: (-190) y: (0)\n        point in direction (-90)\n        set [ghost v] effect to (0)\n    end\n    if <touching (trampoline v)?> then\n        set [y vel v] to [20]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> and <not <<key (up arrow v) pressed?> or <key (w v) pressed?>>>> then\n        start sound (pick random (1) to (4))\n        wait (0.2) seconds\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> and <not <<key (up arrow v) pressed?> or <key (w v) pressed?>>>> then\n        start sound (pick random (1) to (4))\n        wait (0.2) seconds\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <key (any v) pressed?> then\n        broadcast (timer v)\n        forever\n            say []\n        end\n    end\nend\n\nwhen I receive [timer v]\nstart sound [Dream Speedrun Music v]\nrepeat until <(level) = [11]>\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen I receive [next level v]\ngo to x: (-250) y: (-112)\n\ndefine die\nrepeat (15)\n    change [ghost v] effect by (7)\n    change y by (7)\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        stop all sounds\n        play sound [رحمن رحمن - مشاري راشد العفاسي Mishari Rashid Al Afasy - Rahman v] until done\n    end\nend\n\n@level\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\nchange [level v] by (1)\n\n@susrun text\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\nstart sound [Low Whoosh v]\ngo to x: (35) y: (300)\nglide (0.30) secs to x: (35) y: (50)\nglide (0.1) secs to x: (35) y: (40)\nglide (0.01) secs to x: (35) y: (35)\n\nwhen I receive [start v]\nhide\nstop [this script v]\n\n@start\n\nwhen flag clicked\ngo to x: (33) y: (-49)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        if <mouse down?> then\n            broadcast (start v)\n            hide\n            stop [this script v]\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n@customize\n\nwhen flag clicked\ngo to x: (33) y: (-115)\nshow\n\nwhen flag clicked\ngo to x: (33) y: (-115)\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        if <mouse down?> then\n            broadcast (change colour v)\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\nhide\nstop [this script v]\n\n@endline\n\nwhen flag clicked\nshow\nforever\n    if <touching (player v)?> then\n        broadcast (next level v)\n    end\nend\n\nwhen flag clicked\nshow\nforever\n    if <(level) = [11]> then\n        hide\n    end\nend\n\n@danger\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@smasher\n\nwhen flag clicked\nhide\ngo to x: (15) y: (209)\n\nwhen flag clicked\nforever\n    if <(level) = [4]> then\n        show\n        repeat (12)\n            change y by (-10)\n        end\n        wait (0.40) seconds\n        repeat (12)\n            change y by (10)\n        end\n        wait (0.70) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [5]> then\n        hide\n    end\nend\n\n@INTRO\n\nwhen flag clicked\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\ngo [forward v] (11) layers\nrepeat (5)\n    wait (0.01) seconds\n    next costume\nend\nwait (1.4) seconds\nhide\n\n@trampoline\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\ngo to x: (-21) y: (-129)\nforever\n    if <touching (player v)?> then\n        switch costume to (costume1 v)\n        wait (0.03) seconds\n        switch costume to (costume2 v)\n        wait (0.03) seconds\n        switch costume to (costume3 v)\n        wait (0.03) seconds\n        switch costume to (costume4 v)\n        wait (0.03) seconds\n        switch costume to (costume5 v)\n        wait (0.03) seconds\n        switch costume to (costume6 v)\n        wait (0.03) seconds\n        start sound [Jump v]\n        switch costume to (costume6 v)\n        wait (0.03) seconds\n        switch costume to (costume5 v)\n        wait (0.03) seconds\n        switch costume to (costume4 v)\n        wait (0.03) seconds\n        switch costume to (costume3 v)\n        wait (0.03) seconds\n        switch costume to (costume2 v)\n        wait (0.03) seconds\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\n@thumb\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (1) seconds\nshow\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\ngo to [front v] layer\ngo [forward v] (300) layers\nset [ghost v] effect to (0)\nshow\nglide (0.20) secs to x: (496) y: (357)\nhide\n\n