Black - a platformer


@Stage\n\nwhen flag clicked\nset [level v] to [1]\nset volume to (200) %\nforever\n    switch backdrop to (level)\nend\n\nwhen I receive [message1 v]\nstart sound [Vexento - Masked Heroes.mp3 v]\n\n@Sprite1\n\nwhen flag clicked\nhide\nwait (4) seconds\nshow\npoint in direction (90)\ngo to x: (-215) y: (-90)\nset [deaths v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    extras\n    if <key (r v) pressed?> then\n        go to x: (-215) y: (-90)\n    end\n    if <<<touching color (#fc3a3a)?> or <touching (meteors v)?>> and <not <(level) = [9]>>> then\n        go to x: (-190) y: (-90)\n        change [deaths v] by (1)\n        broadcast (re the lava wall v)\n    end\n    if <<<(x position) > [240]> and <not <(level) = [8]>>> and <not <(level) = [9]>>> then\n        go to x: (-215) y: (-90)\n        change [level v] by (1)\n    end\n    if <key (right arrow v) pressed?> then\n        turn right (7.5) degrees\n        change [xv v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-1)\n        turn left (7.5) degrees\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#313131)?> then\n        change y by (1)\n        if <touching color (#313131)?> then\n            change y by (1)\n            if <touching color (#313131)?> then\n                change y by (1)\n                if <touching color (#313131)?> then\n                    change y by (1)\n                    if <touching color (#313131)?> then\n                        change y by (1)\n                        if <touching color (#313131)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(Xv) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\n                            else\n                                set [xv v] to [0]\n                            end\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 (#313131)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#313131)?> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [13]\n        end\n    end\n    change y by (1)\nend\n\ndefine extras\nif <<(level) = [5]> and <(x position) < [-240]>> then\n    go to x: (60) y: (-90)\n    change [level v] by (1)\nend\nif <(level) = [8]> then\n    if <(x position) < [-240]> then\n        change [level v] by (1)\n    end\nend\nif <(level) = [9]> then\n    if <touching color (#fc3a3a)?> then\n        change [level v] by (1)\n    end\nend\nif <(level) = [10]> then\n    broadcast (re the lava wall v)\nend\n\nwhen I receive [show tbn  v]\nhide\n\n@Sprite2\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nwait (1) seconds\nhide\n\nwhen I receive [show tbn  v]\nshow\nstop [all v]\n\n@Sprite4\n\nwhen flag clicked\ngo to x: (6) y: (-120)\nhide\nforever\n    if <(level) = [3]> then\n        if <key (c v) pressed?> then\n            show\n        end\n    else\n        hide\n    end\nend\n\n@Sprite5\n\nwhen flag clicked\nforever\n    if <(level) = [4]> then\n        show\n        wait (1) seconds\n        next costume\n    else\n        hide\n    end\nend\n\n@meteors\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [10]> then\n        wait (pick random (0) to (0.4)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nshow\ngo to x: (pick random (-166) to (202)) y: (156)\nforever\n    change y by (-10)\n    if <touching color (#313131)?> then\n        delete this clone\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\na\nhide\n\nwhen I receive [re the lava wall v]\ngo to x: (-550) y: (0)\nforever\n    if <(level) = [11]> then\n        show\n        repeat until <(x position) = [0]>\n            change x by (0.8)\n        end\n    else\n        hide\n    end\nend\n\ndefine a\nforever\n    if <<(username) = [TheArtOfCoding]> and <key (z v) pressed?>> then\n        broadcast (show tbn  v)\n    end\nend\n\n@Sprite7\n\nwhen flag clicked\nhide\n\nwhen I receive [show tbn  v]\nwait (1) seconds\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\n\nwhen I receive [message1 v]\nclear graphic effects\ngo to x: (-250) y: (0)\nhide\nwait (2) seconds\nshow\nSmooth Glide (5) to X: (0) Y: (0)\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\ndefine None\nrepeat until <(round (x position)) = (x)>\n    change x by (((x) - (x position)) / (time))\n    change y by (((y) - (y position)) / (time))\nend\ngo to x: (x) y: (y)\n\n@aoc4 blue\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\n\nwhen I receive [message1 v]\nhide\n\n@Sprite8\n\nwhen flag clicked\ngo to [front v] layer\nshow\ngo to x: (-215) y: (-202)\nSmooth Glide (13) to X: (0) Y: (0)\nwait (1) seconds\nbroadcast (message1 v)\nhide\n\ndefine None\nrepeat until <(round (x position)) = (x)>\n    change x by (((x) - (x position)) / (time))\n    change y by (((y) - (y position)) / (time))\nend\ngo to x: (x) y: (y)\n\n@Sprite11\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    if <(level) = [14]> then\n        show\n        repeat until <not <(level) = [14]>>\n            wait (1) seconds\n            switch costume to (pick random (1) to (10))\n        end\n    else\n        hide\n    end\nend\n\n@Sprite9\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <(level) = [12]> then\n        show\n        wait (1) seconds\n        switch costume to (pick random (1) to (10))\n    else\n        hide\n    end\nend\n\n@Sprite10\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\n    if <(level) = [15]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [show tbn  v]\nhide\n\n