Joy! A scrolling Platformer

Instructions: Welcome to\nJoy! A Scrolling Platformer\nArrow Keys to move\nAvoid Lava and the void\nGet checkpoints to stay there when you fail!

@Stage\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\nbroadcast (Play game v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    Game - Die\nend\n\ndefine Game on\nshow\nset [y v] to [0]\nset [x v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\n\ndefine Tick\nif <key (left arrow v) pressed?> then\n    change player x by [-8]\n    point in direction (-90)\nend\nif <key (right arrow v) pressed?> then\n    change player x by [8]\n    point in direction (90)\nend\nif <key (up arrow v) pressed?> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nchange [sy v] by (-2)\nChange player y by (sy)\nset [scrollx v] to (x)\nPositon\nif <(y position) < [-170]> then\n    set [exit v] to [Death R.I.P]\nend\n\ndefine Change player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPositon\nTest - Die\nrepeat until <not <touching (paltformes v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Positon\n    set [sy v] to [0]\nend\n\ndefine Positon\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\n\ndefine change player x by (sx)\nchange [x v] by (sx)\nPositon\nTest - Die\nif <touching (paltformes v)?> then\n    repeat (8)\n        change [y v] by (1)\n        Positon\n        if <not <touching (paltformes v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    repeat until <not <touching (paltformes v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Positon\n    end\nend\n\nwhen flag clicked\nset rotation style [left-right v]\n\ndefine Game - Die\nset [exit v] to []\nset [ok show cube v] to [NO]\nbroadcast (Death. Death! DEATH!!! v)\nhide\nwait (0.5) seconds\nshow\n\ndefine Test - Die\nif <touching color (#ff00ff)?> then\n    set [exit v] to [Die]\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nset [checkpoint v] to [0]\n\nwhen flag clicked\nforever\n    if <touching (checkpoint v)?> then\n        set [checkpoint v] to [1]\n    end\nend\n\nchange [checkpoint v] by (1)\n\nif <(Checkpoint) = [0]> then\n    set [scrollx v] to [5224]\n    set [x v] to [5224]\nend\n\nset [checkpoint v] to [0]\n\nwhen flag clicked\n\nwhen I receive [checkpoint v]\nif <(Checkpoint) = [1]> then\n    set [scrollx v] to [5224]\n    set [x v] to [5224]\nend\n\n@Paltformes\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nset [level v] to [0]\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1 1 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\n\ndefine Postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nchange [checkpoint v] by (1)\n\nhide variable [checkpoint v]\n\n@Deco\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nset [level v] to [0]\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume8 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\n\ndefine Postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Sprite1\n\nwhen I receive [death. death! death!!! v]\nset [ghost v] effect to (0)\nset [trans speed v] to [35.3]\ngo to [front v] layer\ngo to x: (0) y: (-220)\nshow\nrepeat until <(y position) > [160]>\n    change y by (Trans speed)\n    change [trans speed v] by (-2)\nend\nset [trans speed v] to [2]\nrepeat until <(y position) > [200]>\n    change y by (Trans speed)\n    change [trans speed v] by (-0.001)\nend\nbroadcast (Checkpoint v)\nrepeat (15)\n    change [ghost v] effect by (8)\nend\nhide\nset [ok show cube v] to [yes]\n\nwhen flag clicked\nhide\ngo to x: (0) y: (-149)\n\n@Deco2\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nset [level v] to [0]\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume2 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\n\ndefine Postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Checkpoint\n\nwhen I receive [green flag v]\nshow\nset [ghost v] effect to (75)\n\nwhen I receive [tick v]\nPostion ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\nset [level v] to [0]\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (costume8 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nnext costume\n\ndefine Postion (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Sprite2\n\nwhen flag clicked\nhide\n\n