Cave Escape | A Platformer #games

Instructions: This is really old so dont judge me over this

@Stage\n\nwhen flag clicked\nforever\n    play sound [tobu candyland.mp3 v] until done\nend\n\n@Ground\n\nwhen [s v] key pressed\nif <not <([costume # v] of [ground v]) = [10]>> then\n    broadcast (Next level v)\nend\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\ndelete this clone\n\nwhen I receive [message1 v]\n\nwhen [space v] key pressed\nset [my variable v] to (join (mouse x) (mouse y))\n\nwhen I start as a clone\nswitch costume to (costume11 v)\nif <([costume # v] of [ground v]) = [5]> then\n    forever\n        go to x: (133) y: (-80)\n        repeat (56)\n            change x by (-5)\n        end\n        repeat (56)\n            change x by (5)\n        end\n    end\nend\nif <([costume # v] of [ground v]) = [6]> then\n    forever\n        go to x: (70) y: (15)\n        repeat (53)\n            change x by (-5)\n            change y by (-1.5)\n        end\n        repeat (53)\n            change x by (5)\n            change y by (1.5)\n        end\n    end\nend\nif <([costume # v] of [ground v]) = [7]> then\n    forever\n        go to x: (140) y: (13)\n        repeat (68)\n            change x by (-5)\n        end\n        repeat (68)\n            change x by (5)\n        end\n    end\nend\nif <([costume # v] of [ground v]) = [9]> then\n    forever\n        go to x: (120) y: (50)\n        repeat (47)\n            change x by (-5)\n        end\n        repeat (47)\n            change x by (5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    switch backdrop to (night v)\n    wait until <(costume [number v]) = [3]>\n    switch backdrop to (dark v)\n    wait until <(costume [number v]) = [8]>\nend\n\n@Player\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\nwhen I receive [restart v]\nif <not <([costume # v] of [ground v]) = [6]>> then\n    go to x: (-220) y: (-30)\n    point in direction (90)\nelse\n    go to x: (8) y: (-139)\n    point in direction (90)\nend\nset [y v] to [0]\nset [x v] to [0]\n\nwhen flag clicked\nshow\nforever\n    if <<(x position) > [230]> and <touching (_edge_ v)?>> then\n        broadcast (Next level v)\n    end\n    if <<<touching (spikes v)?> or <<touching (lava v)?> or <<(y position) < [-170]> and <touching (_edge_ v)?>>>> or <touching (strings v)?>> then\n        broadcast (Restart v)\n    end\n    if <touching (bounce v)?> then\n        set [y v] to [20]\n    end\nend\n\nchange [y v] by (-1)\n\ndefine Move\ngo to [front v] layer\n\nwhen I receive [message1 v]\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen flag clicked\nforever\n    Move\nend\n\nwhen flag clicked\nbroadcast (Restart v)\nswitch costume to (costume1 v)\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    go to [front v] layer\n    if <touching (ladders v)?> then\n        set [y v] to [0]\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [8]\n        end\n        if <<key (down arrow v) pressed?> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            set [y v] to [-8]\n        end\n    else\n        change [y v] by (-1)\n    end\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [15]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (ground v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\nend\n\n@Art\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (20)\nforever\n    switch costume to ([costume # v] of [ground v])\n    go to [front v] layer\nend\n\n@Spikes\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to ([costume # v] of [ground v])\nend\n\n@Strings\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nhide\nwait (1) seconds\nwait until <([costume # v] of [ground v]) = [5]>\nshow\ncreate clone of (_myself_ v)\nswitch costume to (1 v)\nrepeat until <not <([costume # v] of [ground v]) = [5]>>\n    glide (1) secs to x: (0) y: (-350)\n    glide (1) secs to x: (0) y: (0)\n    wait (1) seconds\nend\n\nwhen I start as a clone\nswitch costume to (2 v)\ngo to x: (0) y: (0)\nrepeat until <not <([costume # v] of [ground v]) = [5]>>\n    glide (1) secs to x: (0) y: (350)\n    glide (1) secs to x: (0) y: (0)\n    wait (1) seconds\nend\ndelete this clone\n\nwhen flag clicked\nwait until <([costume # v] of [ground v]) = [5]>\nwait until <not <([costume # v] of [ground v]) = [5]>>\nstop [other scripts in sprite v]\nhide\n\nwhen I start as a clone\nwait until <not <([costume # v] of [ground v]) = [5]>>\ndelete this clone\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [5]> then\n        show\n    else\n        hide\n    end\nend\n\n@Bounce\n\nwhen flag clicked\nforever\n    if <([costume # v] of [ground v]) = [6]> then\n        show\n    else\n        hide\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    reset timer\n    go to [front v] layer\n    show\nend\n\nwhen [timer v] > (0)\ngo to [front v] layer\n\n