A Trolled Platformer 3

Instructions: left and right keys and A and D keys are to move,\nUp arrow, W, and space bar to jump.\n\ntry to beat each level, some walls you can go through (-:<\nmake sure to ❤️ and⭐️!!

@Stage\n\nwhen flag clicked\nforever\n    switch backdrop to (level)\nend\n\nwhen [m v] key pressed\nchange volume by (-5)\n\nwhen [n v] key pressed\nchange volume by (5)\n\nwhen I receive [start the music v]\nset volume to (100) %\nforever\n    play sound [RICK ROLLED!!!!! v] until done\n    play sound [RICK ROLLED!!!!! v] until done\n    play sound [Spooky Scary Skeletons \(Remix\) - Extended Mix v] until done\n    play sound [Spooky Scary Skeletons \(Remix\) - Extended Mix v] until done\nend\n\nwhen flag clicked\nwait until <(level) = [30]>\nset volume to (100) %\nbroadcast (stop music v)\nstop [other scripts in sprite v]\nplay sound [Paper Mario Music - Approach To The Mansion v] until done\n\nwhen I receive [last level v]\nstop [other scripts in sprite v]\nforever\n    play sound [Super Paper Mario OST - The Ultimate Show v] until done\nend\n\n@DAT BOI 3!!!!\n\nwhen flag clicked\nbroadcast (start the music v)\nset [level v] to [0]\nhide variable [level v]\nhide\nset size to (110) %\nwait (1) seconds\nbroadcast (time v)\nreset timer\nshow variable [level v]\nset [last key pressed v] to [right]\nshow\ngo to [front v] layer\ngo to x: (-200) y: (-60)\nset [xv v] to [0]\nset [yv v] to [0]\ngo to [front v] layer\nforever\n    platform\n    if <not <touching color (#000000)?>> then\n        go to [front v] layer\n    end\nend\n\nwhen I receive [die v]\ngo to x: (-200) y: (-60)\n\ndefine platform\nset rotation style [left-right v]\nswitch costume to (hitbox v)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by (-1)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (1)\nend\npoint in direction (((xv) * (logo secret)) + (90))\nset [xv v] to ((xv) * (0.85))\nchange x by (xv)\nif <touching color (#000000)?> then\n    change y by (-2)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-5)\n                            change x by ((-1) * (xv))\n                            if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> and <not <(xv) = [0]>>> then\n                                set [mode v] to [walljump]\n                                set [yv v] to [8]\n                                set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                            else\n                                set [mode v] to [wallslide]\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\nend\nchange y by (-3)\nif <touching color (#000000)?> then\n    if <(yv) = [-3]> then\n        if <<key (a v) pressed?> or <<key (d v) pressed?> or <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>> then\n            set [mode v] to [run]\n        else\n            if <([abs v] of (xv) ) > [.1]> then\n                set [mode v] to [skid]\n            else\n                set [mode v] to [stand]\n            end\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> then\n        set [mode v] to [jump]\n        set [yv v] to [9]\n    end\nend\nif <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n    set [mode v] to [fall]\nend\nchange y by (3)\nif <(yv) > [-15]> then\n    change [yv v] by (-0.5)\nend\nchange y by (-2)\nif <not <touching color (#000000)?>> then\n    change y by (-1)\n    if <not <touching color (#000000)?>> then\n        change y by (-1)\n        if <not <touching color (#000000)?>> then\n            change y by (-1)\n            if <not <touching color (#000000)?>> then\n                change y by (-1)\n                if <not <touching color (#000000)?>> then\n                    change y by (-1)\n                    if <not <touching color (#000000)?>> then\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (2)\nchange y by (yv)\nif <touching color (#000000)?> then\n    change y by (-2)\n    if <touching color (#000000)?> then\n        change y by ((-1) * (yv))\n        set [yv v] to [-3]\n    end\n    change y by (2)\nend\nset rotation style [all around v]\nswitch costume to (last key pressed)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    if <<(level) > [13]> and <(level) < [26]>> then\n        switch costume to (left sam v)\n        set [last key pressed v] to [left sam]\n    else\n        switch costume to (left v)\n        set [last key pressed v] to [left]\n    end\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    if <<(level) > [13]> and <(level) < [26]>> then\n        switch costume to (right sam v)\n        set [last key pressed v] to [right sam]\n    else\n        switch costume to (right v)\n        set [last key pressed v] to [right]\n    end\nend\n\nwhen flag clicked\nwait (2) seconds\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <touching color (#9e00ff)?> then\n        set [yv v] to [10]\n    end\n    if <touching color (#c359ff)?> then\n        set [yv v] to [20]\n    end\n    if <touching color (#93451d)?> then\n        change [xv v] by (-.7)\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (hitbox v)\n    if <<touching color (#ff0000)?> or <(y position) < [-194]>> then\n        broadcast (hahaha noob v)\n        wait (1) seconds\n        broadcast (die v)\n    end\n    switch costume to (last key pressed)\nend\n\nwhen flag clicked\nforever\n    if <touching (win v)?> then\n        change [level v] by (1)\n        broadcast (die v)\n    end\nend\n\ndefine mroftalp\nset rotation style [left-right v]\nswitch costume to (hitbox v)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by (1)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (-1)\nend\npoint in direction (((xv) * (logo secret)) + (90))\nset [xv v] to ((xv) * (0.85))\nchange x by (xv)\nif <touching color (#000000)?> then\n    change y by (-2)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (-5)\n                            change x by ((-1) * (xv))\n                            if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> and <not <(xv) = [0]>>> then\n                                set [mode v] to [walljump]\n                                set [yv v] to [8]\n                                set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                            else\n                                set [mode v] to [wallslide]\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\nend\nchange y by (-3)\nif <touching color (#000000)?> then\n    if <(yv) = [-3]> then\n        if <<key (a v) pressed?> or <<key (d v) pressed?> or <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>>>> then\n            set [mode v] to [run]\n        else\n            if <([abs v] of (xv) ) > [.1]> then\n                set [mode v] to [skid]\n            else\n                set [mode v] to [stand]\n            end\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <key (space v) pressed?>> then\n        set [mode v] to [jump]\n        set [yv v] to [9]\n    end\nend\nif <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n    set [mode v] to [fall]\nend\nchange y by (3)\nif <(yv) > [-15]> then\n    change [yv v] by (-0.5)\nend\nchange y by (-2)\nif <not <touching color (#000000)?>> then\n    change y by (-1)\n    if <not <touching color (#000000)?>> then\n        change y by (-1)\n        if <not <touching color (#000000)?>> then\n            change y by (-1)\n            if <not <touching color (#000000)?>> then\n                change y by (-1)\n                if <not <touching color (#000000)?>> then\n                    change y by (-1)\n                    if <not <touching color (#000000)?>> then\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (2)\nchange y by (yv)\nif <touching color (#000000)?> then\n    change y by (-2)\n    if <touching color (#000000)?> then\n        change y by ((-1) * (yv))\n        set [yv v] to [-3]\n    end\n    change y by (2)\nend\nset rotation style [all around v]\nswitch costume to (last key pressed)\nif <touching color (#a300ff)?> then\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (right2 v)\n        set [last key pressed v] to [left2]\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (right2 v)\n        set [last key pressed v] to [right2]\n    end\nelse\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (left v)\n        set [last key pressed v] to [left]\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (right v)\n        set [last key pressed v] to [right]\n    end\nend\n\nwhen flag clicked\ngo to x: (-200) y: (-60)\nwait until <(x position) > [78]>\nbroadcast (EXPLODE v)\n\nwhen I receive [explode v]\nchange y by (20)\nrepeat (10)\n    set [yv v] to [15]\n    set [xv v] to [-40]\nend\n\nwhen flag clicked\nwait (0.01) seconds\nwait until <(level) = [1]>\nplay sound [Nope \(Construction Worker TF2\) - Gaming Sound Effect \(HD\) v] until done\n\nwhen [r v] key pressed\nbroadcast (die v)\n\nwhen flag clicked\nwait until <(x position) > [-100]>\nset [level v] to [1]\nbroadcast (die v)\n\nwhen flag clicked\nwait until <(level) = [6]>\nset size to (40) %\nwait until <(level) = [7]>\nset size to (110) %\n\nif <not <<(level) = [12]> or <(level) = [13]>>> then\n\nset [☁ record time: v] to [1000000]\n\nwhen flag clicked\nwait until <(level) = [12]>\nwait until <touching color (#00e5ff)?>\nstop [other scripts in sprite v]\nbroadcast (time v)\nbroadcast (time travel v)\n\nwhen I receive [time v]\nset [☁ record time: v] to (☁ Record Time:)\nhide variable [☁ record time: v]\nhide variable [time: v]\nwait (1) seconds\nwait until <(level) = [1]>\nrepeat until <(level) = [31]>\n    set [time: v] to (timer)\nend\nshow variable [time: v]\nshow variable [☁ record time: v]\nif <(Time:) < (☁ Record Time:)> then\n    set [☁ record time: v] to (Time:)\nend\n\nwhen I receive [back in time v]\nforever\n    platform\n    if <not <touching color (#000000)?>> then\n        go to [front v] layer\n    end\nend\n\nwhen I receive [back in time v]\nforever\n    if <touching (win v)?> then\n        change [level v] by (1)\n        broadcast (die v)\n    end\nend\n\nwhen I receive [back in time v]\nforever\n    switch costume to (hitbox v)\n    if <<touching color (#ff0000)?> or <<(y position) < [-194]> and <(can die) = [yes]>>> then\n        broadcast (hahaha noob v)\n        wait (1) seconds\n        broadcast (die v)\n    end\n    switch costume to (last key pressed)\nend\n\nwhen I receive [back in time v]\nforever\n    if <touching color (#9e00ff)?> then\n        set [yv v] to [10]\n    end\n    if <touching color (#c359ff)?> then\n        set [yv v] to [20]\n    end\nend\n\nwhen I receive [back in time v]\nwait until <(level) = [23]>\nwait until <touching color (#00e5ff)?>\nstop [other scripts in sprite v]\nbroadcast (time v)\nbroadcast (time travel 2 v)\n\nwhen flag clicked\nset [count v] to [0]\nset [can die v] to [yes]\n\nwhen I receive [back in time v]\nset [count v] to [0]\nwait until <(level) = [30]>\nwait (0.05) seconds\nwait until <(x position) > [0]>\nset [can die v] to [no]\nbroadcast (fall v)\nrepeat (8)\n    repeat until <(y position) < [-200]>\n        set [xv v] to [0]\n    end\n    go to x: (0) y: (200)\n    change [count v] by (1)\nend\nbroadcast (die v)\nset [can die v] to [yes]\nbroadcast (last level v)\n\n@ground\n\nwhen flag clicked\nwait until <(level) = [22]>\ngo to [front v] layer\n\nwhen I receive [explode v]\nshow\n\nwhen flag clicked\nforever\n    switch costume to ((level) + (count))\nend\n\nset [level v] to [27]\n\nwhen I receive [fall v]\nset [ghost v] effect to (50)\n\nwhen I receive [last level v]\nclear graphic effects\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (1.5) seconds\ngo to [front v] layer\n\nwhen flag clicked\nhide\n\n@win\n\nwhen flag clicked\nforever\n    if <(level) = [19]> then\n        go to [front v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nforever\n    switch costume to (level)\nend\n\n@logo\n\nwhen flag clicked\nset [logo secret v] to [3]\nrepeat (35)\n    go to [front v] layer\nend\n\nwhen this sprite clicked\nset [logo secret v] to [60]\n\nwhen flag clicked\nswitch costume to (costume 100% #1 v)\nrepeat (5)\n    switch costume to (costume 100% #1 v)\n    wait (1) seconds\n    switch costume to (costume 100% #2 v)\n    wait (1) seconds\n    switch costume to (costume 100% #3 v)\n    wait (1) seconds\n    switch costume to (costume 100% #2 v)\n    wait (1) seconds\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@level:\n\nwhen flag clicked\nwait until <(level) = [22]>\nrepeat (10)\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    set [brightness v] effect to (0)\n    change [brightness v] effect by (([sin v] of ((timer) * (100)) ) * (10))\nend\n\nwhen flag clicked\nswitch costume to (switch lite v)\ngo to x: (0) y: (0)\nwait (1.51) seconds\nrepeat (10)\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <<(level) > [12]> and <(level) < [24]>> then\n        switch costume to (costume1 v)\n    else\n        switch costume to (switch lite v)\n    end\nend\n\n@haha\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nrepeat (10)\n    hide\nend\n\nwhen I receive [hahaha noob v]\ngo to [front v] layer\nhide variable [level v]\nshow\nswitch costume to (pick random (1) to (15))\nwait (1) seconds\nhide\nshow variable [level v]\n\nwhen flag clicked\nforever\n    if <(level) = [12]> then\n        point in direction (-90)\n        set rotation style [left-right v]\n    else\n        if <(level) = [13]> then\n            point in direction (-90)\n            set rotation style [all around v]\n        else\n            point in direction (90)\n            set rotation style [left-right v]\n        end\n    end\nend\n\n@GOT M\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nforever\n    if <<(level) = [8]> and <([x position v] of [dat boi 3!!!! v]) < [-238]>> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nwait until <<(level) = [8]> and <([x position v] of [dat boi 3!!!! v]) < [-238]>>\nplay sound [got em v] until done\n\nwhen flag clicked\npoint in direction (90)\nwait until <<(level) = [8]> and <([x position v] of [dat boi 3!!!! v]) < [-238]>>\npoint in direction (90)\nrepeat (160)\n    show\n    go to [front v] layer\n    show\nend\nrepeat (160)\n    point in direction (pick random (-180) to (180))\n    show\n    go to [front v] layer\n    show\nend\n\n@music\n\nwhen [m v] key pressed\nchange volume by (5)\n\nwhen [n v] key pressed\nchange volume by (-5)\n\nwhen I receive [start the music v]\nset volume to (0) %\nforever\n    play sound [Never Gonna Hit Those Notes The Official Video Final Version v] until done\n    play sound [Never Gonna Hit Those Notes The Official Video Final Version v] until done\n    play sound [Spooky Scary Skeletons \(Remix\) - Extended Mix v] until done\n    play sound [Spooky Scary Skeletons \(Remix\) - Extended Mix v] until done\nend\n\nwhen I receive [stop music v]\nstop [other scripts in sprite v]\nplay sound [Paper Mario Music - Approach To The Mansion v] until done\n\n@Explosion\n\nwhen flag clicked\nhide\n\nwhen I receive [explode v]\nshow\nswitch costume to (tumblr_m9vrrtjov2 v)\nstart sound [explode1 v]\nset [level v] to [1]\nrepeat (16)\n    wait (0.1) seconds\n    go to [front v] layer\n    next costume\nend\nhide\n\n@other ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nwait (1.4) seconds\n\ngo to [front v] layer\n\nwhen I receive [explode v]\nhide\n\n@time travel\n\nwhen flag clicked\nclear graphic effects\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [time travel v]\nswitch costume to (costume1 v)\nshow\ngo to [front v] layer\nrepeat (30)\n    go to x: (pick random (-15) to (15)) y: (pick random (-10) to (10))\nend\nswitch costume to (costume2 v)\nrepeat (40)\n    go to x: (pick random (-15) to (15)) y: (pick random (-10) to (10))\nend\nswitch costume to (costume3 v)\nrepeat (10)\n    go to x: (pick random (-15) to (15)) y: (pick random (-10) to (10))\nend\ngo to x: (0) y: (0)\nswitch costume to (costume4 v)\n\nwhen I receive [time travel v]\nplay sound [Computer Beep2 v] until done\nstart sound [Squeaky Toy v]\nwait (0.5) seconds\nplay sound [Squeaky Toy v] until done\nstart sound [D Trombone v]\nstart sound [Teleport v]\nplay sound [Whoop v] until done\nbroadcast (back in time v)\nbroadcast (die v)\nchange [level v] by (1)\nhide\n\nwhen I receive [time travel 2 v]\nswitch costume to (costume5 v)\nshow\ngo to [front v] layer\nrepeat (30)\n    go to x: (pick random (-15) to (15)) y: (pick random (-10) to (10))\nend\nswitch costume to (costume2 v)\nrepeat (40)\n    go to x: (pick random (-15) to (15)) y: (pick random (-10) to (10))\nend\nswitch costume to (costume3 v)\nrepeat (10)\n    go to x: (pick random (-15) to (15)) y: (pick random (-10) to (10))\nend\ngo to x: (0) y: (0)\nswitch costume to (costume4 v)\n\nwhen I receive [time travel 2 v]\nstart sound [Ship Bell v]\nplay sound [Computer Beep2 v] until done\nstart sound [Squeaky Toy v]\nwait (0.5) seconds\nstart sound [D Trombone v]\nstart sound [Teleport v]\nplay sound [Squeaky Toy v] until done\nbroadcast (back in time v)\nbroadcast (die v)\nchange [level v] by (1)\nhide\n\n@ground2\n\nhide\n\n@logo2\n\nwhen flag clicked\nhide\n\n