Coin Hunter || A Scrolling Platformer #all #games

Instructions: Notice:\nHere is my entry!\nAbout **% by me.\nPlease don’t comment that it is too hard or too generic.\nBy the way the music is called Unlimited.\n#21 on trending!

@Stage\n\nwhen flag clicked\nforever\n    play sound [Unlimited v] until done\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (Green Flag v) and wait\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [play game v]\nswitch costume to (player 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)\n    end\n    if <(EXIT) = [win]> then\n        start sound [Teleport2 v]\n        Game - Win\n        wait (0.1) seconds\n    else\n        Game - Die\n    end\nend\n\ndefine Game On\nset [sx v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [gravity v] to [-12]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\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 (-2)\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 (2)\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 [15]\n    end\nend\nif <(sy) > [-17]> then\n    change [sy v] by (-2)\nend\nChange Player Y by (sy)\nTest - Die\nset [scroll x v] to (x)\nif <(SCROLL X) < [-100]> then\n    set [scroll x v] to [-100]\n    set [x v] to [-100]\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\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\nif <touching (bouncy v)?> then\n    start sound [Big Boing v]\n    set [sy v] to [30]\nend\n\ndefine Change Player Y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms 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 (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (GRAVITY)\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms 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 - Die\nclear graphic effects\nchange [deaths v] by (1)\nset [exit v] to []\nstart sound [Oops v]\nrepeat (20)\n    change [ghost v] effect by (8)\n    change y by (8)\nend\nhide\nwait (0.5) seconds\n\ndefine Test - Die\nif <<touching (danger v)?> or <touching (gears v)?>> then\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nrepeat (50)\n    point towards (exit v)\n    turn right (65) degrees\n    move ((distance to [exit v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nchange [level v] by (1)\nhide\nset [deaths v] to [0]\nif <(LEVEL) = [4]> then\n    broadcast (Reset v)\nend\n\nwhen I receive [fix lvl 4 glitch v]\ngo to x: (-200) y: (0)\nset [level v] to [4]\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nGame - Die\n\nwhen flag clicked\nbroadcast (Play Game v)\n\nwhen I receive [hide intro v]\ngo to [front v] layer\n\nwhen I receive [go v]\nset [x v] to [0]\nset [y v] to [0]\n\nwhen I receive [hide intro v]\nwait until <<<<<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<(mouse x) < (x position)> and <mouse down?>>>> or <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>>>> or <<key (w v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> or <mouse down?>>\nrepeat until <(LEVEL) = [6]>\n    change [time v] by (1)\n    wait (1) seconds\nend\nsay [That wasn't so bad...] for (3) seconds\nsay (join [Anyways your time was: ] (join (Time) [!])) for (3) seconds\nif <<(☁ World's Best Time) > (Time)> and <not <(Skipped?) = [1]>>> then\n    set [☁ world's best time v] to (Time)\nend\n\nwhen flag clicked\nset [time v] to [0]\nset [time v] to [0]\nhide variable [time v]\n\nwhen I receive [hide intro v]\nset [time v] to [0]\nshow variable [time v]\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [470] y: [0]\n    Clone at x: [470] y: [0]\n    Clone at x: [470] y: [0]\n    Clone at x: [470] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [460] y: [0]\n            Clone at x: [460] y: [0]\n            Clone at x: [460] y: [0]\n            Clone at x: [460] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [460] y: [0]\n                wait (0.1) seconds\n                Clone at x: [460] y: [0]\n                wait (0.1) seconds\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                        switch backdrop to (2 v)\n                        Clone at x: [460] y: [0]\n                        broadcast (Time v)\n                    end\n                end\n            end\n        end\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\nwhen I receive [reset v]\ndelete this clone\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 start as a clone\ngo [forward v] (3) layers\n\n@Danger\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\ngo to x: (0) y: (0)\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\n    Clone at x: [460] y: [0]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n        Clone at x: [460] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at x: [460] y: [0]\n            Clone at x: [460] y: [0]\n            Clone at x: [460] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n                Clone at x: [460] y: [0]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                    Clone at x: [460] y: [0]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (level 6 1 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\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 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 receive [reset v]\ndelete this clone\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 start as a clone\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\ngo to [back v] layer\n\n@Gears\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    point in direction ((90) + (([sin v] of ((Name) * (2)) ) * (300)))\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\nforever\n    change [name v] by (1)\nend\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine Clone x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\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 receive [reset v]\ndelete this clone\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [3]> then\n    Clone x: [10] y: [120]\n    Clone x: [350] y: [120]\nelse\n    if <(LEVEL) = [4]> then\n        Clone x: [1158] y: [-100]\n        Clone x: [2291] y: [-110]\n        Clone x: [2470] y: [70]\n    else\n        if <(LEVEL) = [5]> then\n    end\nend\nset [y v] to [-99999999999]\n\n@Collectables\n\nwhen I receive [green flag v]\nhide variable [mouse v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    start sound [Coin v]\n    change [collected v] by (1)\n    change [total coins v] by (1)\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nhide variable [total coins v]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [200] y: [-60]\n    Clone at x: [340] y: [-60]\n    Clone at x: [500] y: [0]\n    Clone at x: [1072] y: [-15]\n    Clone at x: [1206] y: [35]\n    Clone at x: [1081] y: [118]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at x: [196] y: [-16]\n        Clone at x: [410] y: [23]\n        Clone at x: [511] y: [90]\n        Clone at x: [788] y: [190]\n        Clone at x: [867] y: [90]\n        Clone at x: [1234] y: [100]\n        Clone at x: [1350] y: [100]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at x: [113] y: [30]\n            Clone at x: [225] y: [40]\n            Clone at x: [400] y: [-40]\n            Clone at x: [469] y: [0]\n            Clone at x: [550] y: [-40]\n            Clone at x: [714] y: [-66]\n            Clone at x: [837] y: [9]\n            Clone at x: [974] y: [9]\n            Clone at x: [1226] y: [30]\n            Clone at x: [1545] y: [-60]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at x: [183] y: [27]\n                Clone at x: [340] y: [27]\n                Clone at x: [530] y: [27]\n                Clone at x: [738] y: [27]\n                Clone at x: [1124] y: [27]\n                Clone at x: [1334] y: [27]\n                Clone at x: [1564] y: [-30]\n                Clone at x: [1627] y: [90]\n                Clone at x: [2470] y: [-50]\n            else\n                if <(LEVEL) = [5]> then\n                    Clone at x: [189] y: [50]\n                    Clone at x: [375] y: [60]\n                    Clone at x: [432] y: [170]\n                    Clone at x: [759] y: [230]\n                    Clone at x: [958] y: [160]\n                    Clone at x: [1078] y: [140]\n                    Clone at x: [1340] y: [120]\n                    Clone at x: [1341] y: [-50]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-999999]\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 receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nClone at x: [340] y: [27]\nClone at x: [530] y: [27]\nClone at x: [786] y: [27]\nClone at x: [1124] y: [27]\nClone at x: [1331] y: [245]\nClone at x: [1065] y: [345]\nClone at x: [825] y: [272]\nClone at x: [392] y: [245]\nClone at x: [197] y: [335]\n\nClone at x: [1336] y: [19]\nClone at x: [1441] y: [19]\n\nwhen flag clicked\nforever\n    next costume\nend\n\nwhen I start as a clone\nforever\n    next costume\nend\n\n@Exit\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [name v]) = [Open]> and <touching (player v)?>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [2000] y: [-32]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (closed v)\n        Clone at x: [1900] y: [0]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (closed v)\n            Clone at x: [2000] y: [0]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (closed v)\n                Clone at x: [2700] y: [10]\n            else\n                if <(LEVEL) = [5]> then\n                    switch costume to (closed v)\n                    Clone at x: [1820] y: [-30]\n                else\n                    if <(LEVEL) = [6]> then\n                        switch costume to (closed v)\n                        Clone at x: [6500] y: [0]\n                    end\n                end\n            end\n        end\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\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)\n\nwhen I receive [open portal v]\nstart sound [Teleport v]\nswitch costume to (open v)\n\nwhen I start as a clone\ngo to [back v] layer\n\n@Thumbnail\n\nwhen flag clicked\nset [pixelate v] effect to (0)\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nshow\nwait (0.3) seconds\nrepeat (10)\n    change [pixelate v] effect by (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nforever\n    set [timer2 v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (Timer2)\nset [pixelate v] effect to (0)\nrepeat (13)\n    change [ghost v] effect by (-8)\nend\nshow\n\n