The Platformer

Instructions: Control the block with arrow keys and reach the blue flag to get to the next level. Complete all 16 levels to win. (May have to click the green flag twice to play).\n\nComment below how you found this project!\n\nTutorial:\nhttps://scratch.mit.edu/projects/202860068/\n\nMy best score is 722\n\nComment your score below!

@Stage\n\n@Character\n\nwhen flag clicked\nhide variable [level v]\nset [level v] to [1]\nshow\nset size to (25) %\nset [yv v] to [0]\ngo to x: (-230) y: (-130)\n\nwhen flag clicked\nforever\n    if <not <touching color (#ffffff)?>> then\n        go to x: (-230) y: (-130)\n    end\nend\n\nwhen I receive [start v]\nshow variable [level v]\n\nwhen flag clicked\nforever\n    if <touching color (#ff0000)?> then\n        go to x: (-230) y: (-130)\n    end\nend\n\nwhen flag clicked\nhide variable [score v]\nforever\n    if <touching (flag v)?> then\n        broadcast (next level v)\n        change [level v] by (1)\n        go to x: (-230) y: (-130)\n        change [score v] by (50)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (n v) pressed?> then\n        broadcast (next level v)\n        change [level v] by (1)\n        wait (0.2) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (portal #1 v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to (portal #2 v)\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<touching color (#003fff)?> and <(Boss) = [1]>> then\n        set [yv v] to [23]\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (boss fireball v)?> then\n        go to x: (-230) y: (-130)\n    end\nend\n\nwhen I receive [death v]\ngo to x: (-230) y: (-130)\n\nwhen I receive [start v]\nset [score v] to [0]\nshow variable [score v]\nforever\n    wait (1) seconds\n    change [score v] by (-1)\nend\n\nwhen flag clicked\nforever\n    if <(x position) < [0]> then\n        set [player quadrant v] to [-1]\n    else\n        set [player quadrant v] to [1]\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <key (right arrow v) pressed?> then\n        change x by (5)\n        if <touching color (#000000)?> then\n            change x by (-5)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        change x by (-5)\n        if <touching color (#000000)?> then\n            change x by (5)\n        end\n    end\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (-5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (yv)\n    if <touching color (#000000)?> then\n        change y by ((0) - (yv))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\nend\n\n@Level\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Flag\n\nwhen flag clicked\nset size to (4) %\nforever\n    show\n    if <(Level) = [1]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [2]> then\n        go to x: (220) y: (55)\n    end\n    if <(Level) = [3]> then\n        go to x: (130) y: (141)\n    end\n    if <(Level) = [4]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [5]> then\n        go to x: (4) y: (121)\n    end\n    if <(Level) = [6]> then\n        go to x: (219) y: (-62)\n    end\n    if <(Level) = [7]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [8]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [9]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [10]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [11]> then\n        go to x: (-156) y: (142)\n    end\n    if <(Level) = [12]> then\n        go to x: (150) y: (-125)\n    end\n    if <(Level) = [13]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [13]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [14]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [15]> then\n        go to x: (225) y: (-125)\n    end\n    if <(Level) = [16]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [boss death v]\ngo to x: (0) y: (0)\nwait (2.2) seconds\nshow\nrepeat (25)\n    change y by (-5)\nend\n\n@Winner!\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nforever\n    if <(Level) = [17]> then\n        show\n        hide variable [level v]\n        stop [all v]\n    end\nend\n\n@Rotating tunnel\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [7]> then\n        show\n        go to x: (0) y: (-117)\n        turn right (1) degrees\n        switch costume to (costume1 v)\n    end\n    if <(Level) = [12]> then\n        go to x: (152) y: (-20)\n        show\n        turn right (0.5) degrees\n        switch costume to (costume2 v)\n    end\n    if <(Level) = [13]> then\n        go to x: (0) y: (13)\n        show\n        turn right (-2.2) degrees\n        switch costume to (costume3 v)\n    end\n    if <not <<<(Level) = [7]> or <(Level) = [12]>> or <(Level) = [13]>>> then\n        hide\n    end\nend\n\n@Title\n\nwhen flag clicked\nset [pixelate v] effect to (0)\nhide\ngo to x: (413) y: (0)\nset size to (80) %\nwait (0.5) seconds\nshow\nrepeat (20.65)\n    change x by (-20)\nend\nwait (1) seconds\nrepeat (10)\n    change [pixelate v] effect by (10)\nend\nhide\nbroadcast (Start v)\n\n@Portal #1\n\nwhen flag clicked\nhide\nset size to (20) %\nforever\n    if <(Level) = [10]> then\n        show\n        go to x: (-73) y: (112)\n    end\n    if <(Level) = [11]> then\n        show\n        go to x: (171) y: (-119)\n    end\n    if <not <<(Level) = [10]> or <(Level) = [11]>>> then\n        hide\n        set size to (20) %\n    end\nend\n\n@Portal #2\n\nwhen flag clicked\nhide\nset size to (20) %\nforever\n    if <(Level) = [10]> then\n        show\n        go to x: (84) y: (112)\n    end\n    if <(Level) = [11]> then\n        show\n        go to x: (-225) y: (151)\n    end\n    if <not <<(Level) = [10]> or <(Level) = [11]>>> then\n        hide\n        set size to (20) %\n    end\nend\n\n@Boss\n\nwhen flag clicked\nset [boss stage v] to [1]\nset size to (100) %\nset [ghost v] effect to (0)\nforever\n    if <(Level) = [16]> then\n        show\n        if <(distance to [character v]) < [35]> then\n            broadcast (Boss death v)\n        end\n    else\n        hide\n    end\nend\n\nwhen I receive [boss death v]\nset [boss v] to [0]\nglide (2) secs to x: (0) y: (0)\nrepeat (20)\n    change [ghost v] effect by (5)\n    change size by (5)\nend\nhide\n\nwhen flag clicked\ngo to x: (190) y: (-115)\n\n@Boss fireball\n\nwhen flag clicked\nset [boss v] to [1]\nset size to (10) %\nhide\nforever\n    if <(Level) = [16]> then\n        wait (0.7) seconds\n        show\n        create clone of (_myself_ v)\n        hide\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Level) = [16]> then\n        point towards (character v)\n        repeat until <touching (character v)?>\n            move (5) steps\n            if <touching (_edge_ v)?> then\n                delete this clone\n            end\n        end\n    else\n        delete this clone\n    end\nend\n\nwhen flag clicked\nforever\n    go to (boss v)\nend\n\nwhen I start as a clone\nforever\n    if <(Level) = [16]> then\n        if <touching (character v)?> then\n            broadcast (Death v)\n            delete this clone\n        end\n        if <(Boss) = [0]> then\n            delete this clone\n        end\n    else\n        delete this clone\n    end\nend\n\nwhen I receive [boss death v]\nstop [other scripts in sprite v]\n\n@Sprite1\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n