Sunshine(Scrolling Platformer)Collab

Instructions: This Is A Collab Project.

@Stage\n\nwhen flag clicked\nbroadcast (Start v)\n\nwhen I receive [start v]\nhide variable [mouse v]\nswitch backdrop to (backdrop v)\nset [timer v] to [0]\nforever\n    change [timer v] by (1)\n    if <(timer) > [50]> then\n        set [timer v] to [0]\n    end\nend\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (Scroll x)) (join [,] ((mouse y) + (Scroll y))))\nshow variable [mouse v]\n\n@Blank\n\n@Player\n\nwhen I receive [start v]\nset [checkpoint x v] to [-199]\nset [checkpoint y v] to [-118]\nset size to (50) %\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\ndefine Game On\nset [x v] to (Checkpoint x)\nset [y v] to (Checkpoint y)\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [finish v] to []\nset [scroll x v] to [0]\nset [scroll y v] to [0]\npoint in direction (90)\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<(mouse x) < (x position)> and <mouse down?>>> then\n    point in direction (-90)\n    change [sx v] by (-1.5)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    point in direction (90)\n    change [sx v] by (1.5)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nDie\nset [scroll x v] to (x)\nchange [scroll x v] by (round (((x) - (Scroll x)) / (10)))\nif <(Scroll x) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (Scroll y)) / (10)))\nif <(Scroll y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nswitch costume to (stand v)\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(Finish) > []>\n        Tick\n        Position\n        broadcast (Tick v)\n    end\n    if <(Finish) = [Yes]> then\n        Game Con\n    else\n        Game End\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platform 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    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (Scroll x)) y: ((y) - (Scroll y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-15]\n        else\n            set [sx v] to [15]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game End\nrepeat (2)\n    hide\n    wait (0.05) seconds\n    show\n    wait (0.05) seconds\nend\nhide\n\ndefine Die\nif <<touching (danger v)?> or <touching (spikes v)?>> then\n    set [finish v] to [Die]\nend\n\ndefine Game Con\nbroadcast (Win v)\n\nwhen I receive [bounce v]\nif <touching (enemy v)?> then\n    set [sy v] to [18]\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [start v]\nbroadcast (DeleteClone v) and wait\nbroadcast (CreateClone v) and wait\n\n@Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nnext costume\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nhide\nswitch costume to (1 v)\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\nwhen I receive [reset v]\ndelete this clone\n\n@Enemy\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\n\ndefine Clone at x: (x) y: (y) Change: (change) Side: (side)\nset [change v] to (change)\nset [x v] to (x)\nset [y v] to (y)\nset [side v] to (side)\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [tick v]\nPosition (((x) - (Scroll x)) + (offset)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<([abs v] of (x position) ) < [250]> and <([abs v] of (y position) ) < [190]>> then\n    show\nelse\n    hide\nend\nif <(die) = [0]> then\n    if <(timer) > [25]> then\n        set [offset v] to ((((((100) - ((timer) * (side))) * ((change) / (50))) - (offset)) / (7)) + (offset))\n    end\n    if <(timer) < [26]> then\n        set [offset v] to ((offset) + (((((timer) * (side)) * ((change) / (50))) - (offset)) / (7)))\n    end\nend\n\nwhen I start as a clone\nset [die v] to [0]\ngo to [front v] layer\ngo [backward v] (2) layers\nset size to (50) %\nset rotation style [left-right v]\nwait (1) seconds\nforever\n    if <touching (player v)?> then\n        if <<([y position v] of [player v]) > (y position)> and <([sy v] of [player v]) < [-1]>> then\n            set [die v] to [2]\n            stop [other scripts in sprite v]\n            broadcast (Bounce v)\n            repeat (5)\n                broadcast (Bounce v)\n                change [ghost v] effect by (20)\n            end\n            switch costume to (2 v)\n            set [ghost v] effect to (0)\n            repeat (8)\n                change [y v] by (4)\n                change [ghost v] effect by (5)\n            end\n            switch costume to (2 v)\n            set [xy v] to (join (round (((x) + (offset)) + (5000))) (round ((y) + (5000))))\n            broadcast (Bounce v)\n            change [coins v] by (3)\n            delete this clone\n        else\n            set [finish v] to [Die]\n        end\n    end\nend\n\nwhen I receive [deleteclone v]\ndelete this clone\n\nwhen I receive [start v]\nset [die v] to [0]\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [createclone v]\nClone at x: [246] y: [-29] Change: [100] Side: [2]\nClone at x: [358] y: [40] Change: [90] Side: [2.4]\nClone at x: [503] y: [125] Change: [200] Side: [2]\nClone at x: [767] y: [40] Change: [90] Side: [2.4]\nClone at x: [855] y: [-29] Change: [100] Side: [2]\nClone at x: [1415] y: [-121] Change: [100] Side: [2]\nClone at x: [1689] y: [154] Change: [0] Side: [0]\nClone at x: [1833] y: [154] Change: [0] Side: [0]\nClone at x: [1972] y: [120] Change: [0] Side: [0]\nClone at x: [2118] y: [120] Change: [0] Side: [0]\nClone at x: [2256] y: [154] Change: [0] Side: [0]\nClone at x: [2280] y: [-8] Change: [100] Side: [2]\nClone at x: [2540] y: [-92] Change: [100] Side: [2]\nClone at x: [2912] y: [-92] Change: [180] Side: [2]\nClone at x: [3256] y: [-92] Change: [210] Side: [2]\n\n@Danger\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\nwhen I receive [reset v]\ndelete this clone\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    change [coins v] by (1)\n    delete this clone\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (1/2)\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\n\nwhen I receive [createclone v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [-112] y: [-99]\nClone at x: [-57] y: [-99]\nClone at x: [-84] y: [-54]\nClone at x: [112] y: [-99]\nClone at x: [57] y: [-99]\nClone at x: [86] y: [-54]\nClone at x: [486] y: [187]\nClone at x: [551] y: [187]\nClone at x: [757] y: [187]\nClone at x: [616] y: [187]\nClone at x: [687] y: [187]\nClone at x: [1024] y: [-52]\nClone at x: [1024] y: [-92]\nClone at x: [1118] y: [-52]\nClone at x: [1118] y: [-92]\nClone at x: [1210] y: [-52]\nClone at x: [1210] y: [-92]\nClone at x: [1575] y: [83]\nClone at x: [1621] y: [83]\nClone at x: [1665] y: [83]\nClone at x: [1575] y: [44]\nClone at x: [1621] y: [44]\nClone at x: [1665] y: [44]\nClone at x: [2278] y: [68]\nClone at x: [2311] y: [68]\nClone at x: [2346] y: [68]\nClone at x: [2378] y: [68]\n\nwhen I receive [deleteclone v]\ndelete this clone\n\nwhen flag clicked\nset [coins v] to [0]\nhide\n\nwhen I start as a clone\nset [sine v] to [0]\nforever\n    change [sine v] by (7.5)\n    set size to ((([sin v] of ((sine) * (2)) ) * (3)) + (50)) %\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Deco\n\nwhen flag clicked\nhide\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\nClone at x: [360] y: [0]\n\nwhen I receive [reset v]\ndelete this clone\n\n@Coin\n\nwhen flag clicked\nshow\nswitch costume to (coin1 v)\nforever\n    next costume\n    wait (0.05) seconds\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Checkpoint\n\nwhen I receive [tick v]\nposition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    if <(checkpoint#) = [1]> then\n        set y to (-95)\n        if <not <(costume [number v]) = [2]>> then\n            if <[] = [0]> then\n                broadcast (Checkpoint v)\n            end\n        end\n        switch costume to (2 v)\n        set [checkpoint x v] to [1383]\n        set [checkpoint y v] to [-118]\n    end\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ngo to [back v] layer\ncreate clone of (_myself_ v)\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [checkpoint# v] to [1]\nClone at x: [1381] y: [-95]\nset [checkpoint# v] to [2]\nClone at x: [4606] y: [140]\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Numbers\n\nwhen flag clicked\nset [digits v] to [1]\nrepeat (30)\n    create clone of (_myself_ v)\n    change [digits v] by (1)\nend\nhide\n\nwhen flag clicked\nforever\n    set size to (0) %\nend\n\nwhen I receive [time v]\nset [digits v] to [1]\nrepeat (30)\n    create clone of (_myself_ v)\n    change [digits v] by (1)\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    set size to (45) %\n    go to x: (((digits) * (16)) - (225)) y: (146)\n    if <(length of (Coins)) < (digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (digits) of (Coins))\n    end\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [win v]\n\n@Thumbnail\n\nwhen [timer v] > (0.05)\nset [ghost v] effect to (100)\nshow\ngo to [front v] layer\nrepeat (10)\n    go to [front v] layer\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\n\nwhen flag clicked\nforever\n    reset timer\nend\n\n