My Lab 2(Scrolling Platformer) Mobile Friendly  #games

Instructions:                                ⭐Instructions⭐\n*Use The W,A,S,D or Arrow Keys To Move.\n*Jump Onto Kill Enemies.(If You Have Bought Jump Kill)\n*Part 1: https://scratch.mit.edu/projects/419322143/\n*My Time 67s \n*This Is Your Halloween Gift. Give Me Mine By Leaving \n  A Love, A Fave And Following Me. \n*I Stop Making It Roll Because It Was Causing A Glitch

@Stage\n\nwhen flag clicked\nbroadcast (Start v)\n\nwhen I receive [start 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))))\n\nwhen I receive [start v]\nforever\n    play sound [Tobu & Itro - Sunburst \[NCS Release\] v] until done\nend\n\nwhen I receive [start v]\nforever\n    if <(Music) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [start v]\nset [timer v] to [0]\nwait until <<mouse down?> or <key (any v) pressed?>>\nforever\n    if <(Shop) = [No]> then\n        wait (1) seconds\n        change [timer v] by (1)\n    end\nend\n\nwhen I receive [win v]\nstop [other scripts in sprite 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 [speed x v] to [1.5]\nset [speed y v] to [16]\nset [jumpkill v] to [No]\nset [flash v] to [no]\nset size to (50) %\nbroadcast (Green Flag v)\nbroadcast (Play Game v)\n\ndefine Game On\nset [sx v] to [0]\nset [x v] to (Checkpoint x)\nset [y v] to (Checkpoint y)\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)\ngo to [front v] layer\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <(Shop) = [No]> then\n    if <<<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 ((Speed x) * (-1))\n    end\n    if <<<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 (Speed x)\n    end\nend\nif <(Shop) = [No]> then\n    set [sx v] to ((sx) * (0.8))\n    if <([abs v] of (sx) ) > [0.9]> then\n        Change Player x by (round (sx))\n    end\nend\nif <(Shop) = [No]> then\n    if <<<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 (Speed y)\n        end\n    end\nend\nif <(Shop) = [No]> then\n    if <(sy) > [-20]> then\n        change [sy v] by (-2)\n    end\n    Change Player y by (sy)\n    Die\n    set [scroll x v] to (x)\n    change [scroll x v] by (round (((x) - (Scroll x)) / (10)))\n    if <(Scroll x) < [0]> then\n        set [scroll x v] to [0]\n    end\n    if <(Scroll x) > [7457]> then\n        set [scroll x v] to [7457]\n    end\n    change [scroll y v] by (round (((y) - (Scroll y)) / (10)))\n    if <(Scroll y) < [0]> then\n        set [scroll y v] to [0]\n    end\n    Position\nend\nswitch costume to (player1 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\nif <(Sounds) = [0]> then\n    start sound [die v]\nend\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 [bounce v]\nif <touching (trampoline v)?> then\n    set [sy v] to [30]\nend\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 start as a clone\nset [ghost v] effect to (0)\nrepeat (5)\n    change [ghost v] effect by (12)\nend\n\nwhen I receive [start v]\nset [turn v] to [1]\nforever\n    change [turn v] by (1)\n    if <(Turn) > [14]> then\n        set [turn v] to [1]\n    end\nend\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: [800] 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]\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)\nchange [clone# v] by (1)\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 <(Shop) = [No]> then\n    if <(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\n    end\nend\n\nwhen I start as a clone\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]>> and <(JumpKill) = [Yes]>> then\n            set [die v] to [2]\n            broadcast (Bounce v)\n            if <(Shop) = [0]> then\n                start sound [Death v]\n            end\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 (4)\n            add (clone#) to [enemykilled v]\n            delete this clone\n        else\n            set [finish v] to [Die]\n        end\n    end\nend\n\nwhen I receive [reset v]\nset [clone# v] to [0]\nrepeat (1)\n    delete this clone\nend\nClone at x: [968] y: [143] Change: [220] Side: [2]\nClone at x: [1722] y: [63] Change: [160] Side: [2]\nClone at x: [3175] y: [-30] Change: [65] Side: [2.5]\nClone at x: [3276] y: [-30] Change: [100] Side: [2]\nClone at x: [4400] y: [-120] Change: [200] Side: [2]\nClone at x: [5180] y: [200] Change: [120] Side: [2]\nClone at x: [5410] y: [202] Change: [120] Side: [2]\nClone at x: [5535] y: [62] Change: [120] Side: [2]\nClone at x: [5732] y: [62] Change: [80] Side: [2]\nClone at x: [6494] y: [115] Change: [120] Side: [2]\nClone at x: [6710] y: [115] Change: [120] Side: [1.5]\nClone at x: [6950] y: [115] Change: [190] Side: [2]\n\nwhen I receive [start v]\ndelete all of [enemykilled v]\nset [die v] to [0]\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 start as a clone\nforever\n    if <[enemykilled v] contains (clone#)?> then\n        delete this clone\n    end\nend\n\n@Danger\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 [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: [800] 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]\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]\ndelete all of [coinscollected v]\nhide\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) Type: (1/2)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (1/2)\nchange [clone# v] by (1)\ncreate clone of (_myself_ v)\nset [x v] to [-999999]\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [clone# v] to [0]\nClone at x: [265] y: [-20] Type: [2]\nClone at x: [313] y: [-20] Type: [2]\nClone at x: [358] y: [-20] Type: [2]\nClone at x: [404] y: [-20] Type: [2]\nClone at x: [451] y: [-20] Type: [2]\nClone at x: [682] y: [23] Type: [2]\nClone at x: [682] y: [60] Type: [2]\nClone at x: [682] y: [-13] Type: [2]\nClone at x: [2105] y: [35] Type: [2]\nClone at x: [2105] y: [-3] Type: [2]\nClone at x: [2323] y: [-92] Type: [2]\nClone at x: [2501] y: [218] Type: [2]\nClone at x: [2565] y: [218] Type: [2]\nClone at x: [2870] y: [218] Type: [2]\nClone at x: [2938] y: [218] Type: [2]\nClone at x: [2906] y: [256] Type: [2]\nClone at x: [3197] y: [231] Type: [2]\nClone at x: [3341] y: [231] Type: [2]\nClone at x: [3785] y: [124] Type: [2]\nClone at x: [4103] y: [124] Type: [2]\nClone at x: [4256] y: [124] Type: [2]\nClone at x: [5347] y: [320] Type: [1]\nClone at x: [6220] y: [88] Type: [2]\nClone at x: [6301] y: [88] Type: [2]\nClone at x: [6381] y: [88] Type: [2]\n\nwhen flag clicked\nset [coins v] to [0]\nhide\n\nwhen I start as a clone\nset [sine v] to [0]\nforever\n    if <(Shop) = [No]> then\n        change [sine v] by (7.5)\n        set size to ((([sin v] of ((sine) * (2)) ) * (5)) + (50)) %\n    end\nend\n\nwhen I start as a clone\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 start as a clone\nforever\n    if <(Shop) = [No]> then\n        if <<touching (player v)?> and <(costume [number v]) = [2]>> then\n            if <(Sounds) = [0]> then\n                start sound [collected v]\n            end\n            change [coins v] by (1)\n            add (clone#) to [coinscollected v]\n            delete this clone\n        end\n        if <<touching (player v)?> and <(costume [number v]) = [1]>> then\n            if <(Sounds) = [0]> then\n                start sound [collected v]\n            end\n            change [coins v] by (10)\n            add (clone#) to [coinscollected v]\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <[coinscollected v] contains (clone#)?> then\n        delete this clone\n    end\nend\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\n    go to [back v] layer\nelse\n    hide\n    go to [back v] layer\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: [800] 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]\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@Trampoline\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nposition ((x) - (Scroll x)) ((y) - (Scroll y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [2370] y: [-104]\nClone at x: [3136] y: [-8]\nClone at x: [3262] y: [-8]\nClone at x: [3386] y: [-8]\nClone at x: [4604] y: [-98]\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nset [x v] to [-99999]\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\nwhen I start as a clone\nshow\nforever\n    if <touching (player v)?> then\n        if <([sy v] of [player v]) < [0]> then\n            broadcast (bounce v)\n            if <(Sounds) = [0]> then\n                start sound [Big Boing v]\n            end\n            switch costume to (1 v)\n            broadcast (bounce v)\n            repeat (6)\n                broadcast (bounce v)\n                next costume\n            end\n            broadcast (bounce v)\n            if <(costume [number v]) > [7]> then\n                broadcast (bounce v)\n                switch costume to (1 v)\n            end\n        end\n    end\nend\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\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 [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        if <(checkpoint#) = [1]> then\n            set y to (-95)\n            if <not <(costume [number v]) = [2]>> then\n                if <(Sounds) = [0]> then\n                    start sound [Checkpoint v]\n                end\n            end\n            switch costume to (2 v)\n            set [checkpoint x v] to [1640]\n            set [checkpoint y v] to [61]\n        end\n        if <(checkpoint#) = [2]> then\n            if <not <(costume [number v]) = [2]>> then\n                if <(Sounds) = [0]> then\n                    start sound [Checkpoint v]\n                end\n            end\n            switch costume to (2 v)\n            set [checkpoint x v] to [3945]\n            set [checkpoint y v] to [101]\n        end\n    end\nend\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)\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: [1637] y: [92]\nset [checkpoint# v] to [2]\nClone at x: [3944] y: [125]\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 [start v]\nforever\n    if <(Sounds) = [0]> then\n        set volume to (50) %\n    else\n        set volume to (0) %\n    end\nend\n\n@Spikes\n\nwhen I receive [green flag v]\nhide\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\nif <(Shop) = [No]> then\n    turn right (10) degrees\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)\nset [x v] to [-9999999]\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [1282] y: [45]\nClone at x: [1709] y: [45]\nClone at x: [1894] y: [45]\nClone at x: [2455] y: [195]\nClone at x: [2613] y: [195]\nClone at x: [2278] y: [-140]\nClone at x: [2826] y: [193]\nClone at x: [2980] y: [193]\nClone at x: [3129] y: [193]\nClone at x: [3270] y: [193]\nClone at x: [3410] y: [193]\nClone at x: [4344] y: [-46]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\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\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@Finish\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)\nset [x v] to (x)\nset [y v] to (y)\ngo to [back v] layer\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [7605] y: [-85]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\nswitch costume to (1 v)\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 [start v]\nforever\n    if <touching (player v)?> then\n        set [finish v] to [Yes]\n    end\nend\n\n@Buttons\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nswitch costume to (shop v)\nset [shop v] to [No]\nshow\nforever\n    go to x: (-198) y: (-162)\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) > [95]>\n            change size by (2)\n        end\n        if <mouse down?> then\n            if <(Shop) = [No]> then\n                set [shop v] to [Yes]\n                broadcast (Shop v)\n                create clone of (_myself_ v)\n            end\n            wait until <not <mouse down?>>\n        end\n    else\n        repeat until <(size) < [92]>\n            change size by (-2)\n        end\n    end\nend\n\nwhen I receive [start v]\ngo to [front v] layer\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\nwhen I start as a clone\nswitch costume to (close v)\nshow\nforever\n    go to x: (111) y: (98)\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) > [95]>\n            change size by (2)\n        end\n        if <mouse down?> then\n            if <(Shop) = [Yes]> then\n                set [shop v] to [No]\n                broadcast (No Shop v)\n                delete this clone\n            end\n            wait until <not <mouse down?>>\n        end\n    else\n        repeat until <(size) < [92]>\n            change size by (-2)\n        end\n    end\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Shop\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\n    switch costume to (1 v)\n    go to [front v] layer\nend\n\nwhen I receive [shop v]\nshow\nset [clone# v] to [1]\ncreate clone of (_myself_ v)\nset [clone# v] to [2]\ncreate clone of (_myself_ v)\n\nwhen I receive [no shop v]\nhide\n\nwhen I start as a clone\nforever\n    go to [front v] layer\n    if <(clone#) = [1]> then\n        go to x: (90) y: (-5)\n        if <(JumpKill) = [Yes]> then\n            switch costume to (bougth v)\n        else\n            switch costume to (buy v)\n        end\n    end\n    if <(clone#) = [2]> then\n        go to x: (90) y: (-85)\n        if <(Speed y) = [18]> then\n            switch costume to (bougth v)\n        else\n            switch costume to (buy v)\n        end\n    end\nend\n\nwhen I start as a clone\nset size to (90) %\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat until <(size) > [95]>\n            change size by (2)\n        end\n        if <mouse down?> then\n            if <<(clone#) = [1]> and <(costume [number v]) = [2]>> then\n                if <(Coins) > [19]> then\n                    set [jumpkill v] to [Yes]\n                    change [coins v] by (-20)\n                    switch costume to (bougth v)\n                end\n            end\n            if <<(clone#) = [2]> and <(costume [number v]) = [2]>> then\n                if <(Coins) > [29]> then\n                    change [coins v] by (-30)\n                    set [speed y v] to [18]\n                    switch costume to (bougth v)\n                end\n            end\n            wait until <not <mouse down?>>\n        end\n    else\n        repeat until <(size) < [92]>\n            change size by (-2)\n        end\n    end\nend\n\nwhen I receive [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\n@Screen\n\nwhen I receive [win v]\nshow\ngo to [front v] layer\nforever\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nhide\n\n@Timer\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    set size to (50) %\n    go to x: (((digits) * (20)) - (20)) y: (-140)\n    if <(length of (Timer)) < (digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (digits) of (Timer))\n    end\nend\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [win v]\nset [digits v] to [1]\nrepeat (30)\n    create clone of (_myself_ v)\n    change [digits v] by (1)\nend\nhide\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: (00) y: (0)\ngo to [front v] layer\nhide\n\nwhen flag clicked\nforever\n    reset timer\nend\n\n@Sounds\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [sounds v] to [0]\nset [music v] to [0]\ncreate clone of (_myself_ v)\nshow\nforever\n    if <(Music) = [0]> then\n        switch costume to (music v)\n    else\n        switch costume to (mute v)\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    if <(Sounds) = [0]> then\n        switch costume to (sounds on v)\n    else\n        switch costume to (sounds off v)\n    end\nend\n\nwhen I start as a clone\nshow\nforever\n    go to x: (208) y: (161)\n    if <(Shop) = [No]> then\n        if <touching (mouse-pointer v)?> then\n            repeat until <(size) > [95]>\n                change size by (2)\n            end\n            if <mouse down?> then\n                if <(Sounds) = [0]> then\n                    set [sounds v] to [2]\n                    wait until <not <mouse down?>>\n                else\n                    if <(Sounds) = [2]> then\n                        set [sounds v] to [0]\n                        wait until <not <mouse down?>>\n                    end\n                end\n            end\n        else\n            repeat until <(size) < [92]>\n                change size by (-2)\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (172) y: (161)\n    if <(Shop) = [No]> then\n        if <touching (mouse-pointer v)?> then\n            repeat until <(size) > [95]>\n                change size by (2)\n            end\n            if <mouse down?> then\n                if <(Music) = [0]> then\n                    set [music v] to [2]\n                    wait until <not <mouse down?>>\n                else\n                    if <(Music) = [2]> then\n                        set [music v] to [0]\n                        wait until <not <mouse down?>>\n                    end\n                end\n            end\n        else\n            repeat until <(size) < [92]>\n                change size by (-2)\n            end\n        end\n    end\nend\n\n