My Valley(Scrolling Platformer)  #games

Instructions: ^Use the W,A,S,D or Arrow Keys To Move The Player.\n^Try To Beat My Score:53s.\n^If This Game Is Running Slow Play In Full Screen. 

@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]\nset volume to (50) %\nforever\n    play sound [Itty Bitty 8 Bit 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]\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\nset [☁ highscore v] to [6000]\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 [flash v] to [no]\nset size to (50) %\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\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)\nset rotation style [left-right v]\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    set [scroll x v] to (x)\n    change [scroll x v] by (round (((x) - (Scroll x)) / (10)))\n    if <(Scroll x) > [7290]> then\n        set [scroll x v] to [7295]\n    end\n    if <(Scroll x) < [0]> then\n        set [scroll x v] to [0]\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\n    if <touching (danger v)?> then\n        set [sy v] to [3]\n        if <<<key (s v) pressed?> or <key (down arrow v) pressed?>> or <<(mouse y) < (y position)> and <mouse down?>>> then\n            change [sy v] by (-4)\n        end\n        if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n            change [sy v] by (4)\n        end\n    end\nend\nswitch costume to (2 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 <(Shop) = [No]> then\n    go to [front v] layer\n    set rotation style [all around v]\n    set [fall v] to (pick random (5) to (10))\n    repeat until <(y position) < [-180]>\n        set size to (100) %\n        change y by (Fall)\n        change [fall v] by (-2)\n        turn right (15) degrees\n        set size to (50) %\n    end\n    hide\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]\nset [swim v] to [No]\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]\nforever\n    if <(x) < [-240]> then\n        set [x v] to [-240]\n    end\nend\n\nwhen I receive [start v]\nbroadcast (DeleteClones v) and wait\nbroadcast (CreateClones 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: [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)\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]>> then\n            set [die v] to [2]\n            broadcast (Bounce v)\n            if <(Shop) = [No]> then\n                if <(Sounds) = [0]> then\n                    start sound [Death v]\n                end\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            delete this clone\n        else\n            set [finish v] to [Die]\n        end\n    end\nend\n\nwhen I receive [deleteclones v]\ndelete this clone\n\nwhen I receive [start 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 receive [createclones v]\nClone at x: [289] y: [-120] Change: [150] Side: [1.5]\nClone at x: [1093] y: [-120] Change: [150] Side: [1.5]\nClone at x: [2008] y: [34] Change: [220] Side: [2]\nClone at x: [2426] y: [-126] Change: [220] Side: [2]\nClone at x: [2875] y: [30] Change: [220] Side: [2]\nClone at x: [3085] y: [30] Change: [200] Side: [1.5]\nClone at x: [4373] y: [-48] Change: [200] Side: [2]\nClone at x: [6375] y: [130] Change: [0] Side: [0]\nClone at x: [6546] y: [132] Change: [0] Side: [0]\nClone at x: [6719] y: [134] Change: [0] Side: [0]\nClone at x: [6902] y: [136] Change: [0] Side: [0]\nClone at x: [7180] y: [-122] Change: [220] Side: [2]\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 start as a clone\nforever\n    if < (costume [name v]) contains [Water]?> then\n        set [ghost v] effect to (20)\n        set [y v] to (([cos v] of ((cos) * (300)) ) * (5))\n    else\n        set [ghost v] effect to (0)\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)\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\nwhen I start as a clone\nset [cos v] to [0]\nforever\n    if <(Shop) = [No]> then\n        change [cos v] by (0.02)\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        if <not << (costume [name v]) contains [Water]?> and <(Swim) = [Yes]>>> then\n            set [finish v] to [No]\n        end\n    end\nend\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 <(Shop) = [No]> then\n    if <<touching (player v)?> and <(costume [number v]) = [2]>> then\n        if <(Sounds) = [0]> then\n            start sound [coin v]\n        end\n        change [coins v] by (1)\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 [coin v]\n        end\n        change [coins v] by (10)\n        delete this clone\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) Type: (1/2)\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 [createclones v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [67] y: [-63] Type: [2]\nClone at x: [135] y: [-63] Type: [2]\nClone at x: [198] y: [-63] Type: [2]\nClone at x: [104] y: [-15] Type: [2]\nClone at x: [263] y: [-63] Type: [2]\nClone at x: [168] y: [-15] Type: [2]\nClone at x: [231] y: [-15] Type: [2]\nClone at x: [722] y: [-63] Type: [2]\nClone at x: [722] y: [-19] Type: [2]\nClone at x: [722] y: [29] Type: [2]\nClone at x: [1450] y: [-107] Type: [2]\nClone at x: [1342] y: [-107] Type: [2]\nClone at x: [1394] y: [-107] Type: [2]\nClone at x: [4416] y: [222] Type: [1]\nClone at x: [1673] y: [11] Type: [2]\nClone at x: [1673] y: [-27] Type: [2]\nClone at x: [1673] y: [-67] Type: [2]\nClone at x: [2003] y: [144] Type: [2]\nClone at x: [2003] y: [42] Type: [2]\nClone at x: [2003] y: [90] Type: [2]\nClone at x: [2736] y: [169] Type: [1]\nClone at x: [3593] y: [-56] Type: [2]\nClone at x: [3593] y: [-90] Type: [2]\nClone at x: [3593] y: [-23] Type: [2]\nClone at x: [4354] y: [185] Type: [2]\nClone at x: [4478] y: [185] Type: [2]\nClone at x: [4510] y: [74] Type: [2]\nClone at x: [4411] y: [24] Type: [2]\nClone at x: [4255] y: [24] Type: [2]\nClone at x: [4336] y: [74] Type: [2]\nClone at x: [4976] y: [204] Type: [2]\nClone at x: [4976] y: [168] Type: [2]\nClone at x: [4976] y: [130] Type: [2]\nClone at x: [5009] y: [130] Type: [2]\nClone at x: [5009] y: [168] Type: [2]\nClone at x: [5009] y: [204] Type: [2]\nClone at x: [5795] y: [22] Type: [2]\nClone at x: [5795] y: [-20] Type: [2]\nClone at x: [6329] y: [58] Type: [2]\nClone at x: [6329] y: [21] Type: [2]\nClone at x: [6329] y: [-15] Type: [2]\nClone at x: [3115] y: [78] Type: [2]\nClone at x: [3301] y: [78] Type: [2]\nClone at x: [3493] y: [78] Type: [2]\nClone at x: [3549] y: [78] Type: [2]\n\nwhen I receive [deleteclones v]\ndelete this clone\n\nwhen flag clicked\nset [coins v] to [0]\nhide\n\nwhen I start as a clone\nset [cos v] to [0]\nforever\n    if <(Shop) = [No]> then\n        change [cos v] by (0.02)\n        set size to ((([cos v] of ((cos) * (400)) ) * (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\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)\ngo to [back v] layer\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)\ngo to [back v] layer\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: [2568] y: [-103]\nset [x v] to [-99999]\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)\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 [tick v]\nposition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    if <(checkpoint#) = [1]> then\n        if <not <(costume [number v]) = [2]>> then\n            if <(Sounds) = [0]> then\n                start sound [Checkpoint v]\n                broadcast (Checkpoint v)\n            end\n        end\n        switch costume to (2 v)\n        set [checkpoint x v] to [1882]\n        set [checkpoint y v] to [-17]\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                broadcast (Checkpoint v)\n            end\n        end\n        switch costume to (2 v)\n        set [checkpoint x v] to [4696]\n        set [checkpoint y v] to [-50]\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: [1877] y: [10]\nset [checkpoint# v] to [2]\nClone at x: [4714] y: [-22]\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\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\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\ngo to [front v] layer\ngo [backward v] (20) layers\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]\nClone at x: [1795] y: [-32]\nClone at x: [2289] y: [-32]\nClone at x: [3689] y: [-124]\nClone at x: [3810] y: [-124]\nClone at x: [3932] y: [-124]\nClone at x: [4064] y: [-124]\nClone at x: [7103] y: [-49]\nClone at x: [6974] y: [33]\nset [x v] to [-99999]\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\nPosition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    set [finish v] to [No]\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\nforever\n    if <(Shop) = [No]> then\n        turn right (8) degrees\n    end\nend\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 [win v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [tick v]\nposition ((x) - (Scroll x)) ((y) - (Scroll y))\nif <touching (player v)?> then\n    set [finish v] to [Yes]\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\ngo [forward v] (5) layers\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: [7444] y: [-104]\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@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)\nset [clone# v] to [3]\ncreate clone of (_myself_ v)\n\nwhen I receive [no shop v]\nhide\ndelete this clone\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: (28)\n        if <(Speed x) = [2]> 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: (-30)\n        if <(Speed y) = [18]> then\n            switch costume to (bougth v)\n        else\n            switch costume to (buy v)\n        end\n    end\n    if <(clone#) = [3]> then\n        go to x: (90) y: (-90)\n        if <(Swim) = [Yes]> 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) = [25]> or <(Coins) > [25]>> then\n                    set [speed x v] to [2]\n                    change [coins v] by (-25)\n                    switch costume to (bougth v)\n                end\n            end\n            if <<(clone#) = [2]> and <(costume [number v]) = [2]>> then\n                if <<(Coins) = [30]> or <(Coins) > [30]>> 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            if <<(clone#) = [3]> and <(costume [number v]) = [2]>> then\n                if <<(Coins) = [40]> or <(Coins) > [40]>> then\n                    change [coins v] by (-40)\n                    set [swim v] to [Yes]\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 (45) %\n    go to x: (((digits) * (16)) - (100)) y: (-80)\n    if <(length of (OutputTime)) < (digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (digits) of (OutputTime))\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\nwhen I receive [win v]\nforever\n    set [outputtime v] to (join [Time:] (join (Timer) [s]))\nend\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@HighScore\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)) - (118)) y: (-130)\n    if <(length of (OutputHighScore)) < (digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (digits) of (OutputHighScore))\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\nwhen I receive [win v]\nforever\n    set [outputhighscore v] to (join [Highscore:] (join (☁ Highscore) [#]))\nend\n\nwhen I receive [win v]\nforever\n    if <(Timer) < (☁ Highscore)> then\n        set [☁ highscore v] to (Timer)\n    end\nend\n\n