Rainbow Runner 3 || Platformer || #games

Instructions: use arrow keys or wasd to move, dont touch spikes, lava, cactus, and saws or else you will die, you have to collect all coins or else you cannot advance to the next level, if the portal is grey that means you haven't collected all the coins. if the portal is blue that means you have collected all of the coins and ready to advance to the next level. click the shop icon to go the shop, and click the sound icon to mute or unmute. press r to restart if get stuck

@Stage\n\nwhen flag clicked\n\nwhen I receive [begin v]\nforever\n    play sound [Nebula v] until done\nend\n\nbroadcast (begin v)\n\n@Others\n\ndefine begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\nwhen I receive [join game v]\nset [last value v] to (join [A] (value))\nwait (3) seconds\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\n@Player\n\nwhen I receive [begin v]\nset [chat v] to [0]\nshow list [chat v]\nforever\n    Chat\nend\n\nif <<key (t v) pressed?> or <<touching (mouse-pointer v)?> and <mouse down?>>> then\n    if <(Chat) = [1]> then\n        show list [chat v]\n        set [chat v] to [0]\n        wait until <<not <<touching (mouse-pointer v)?> and <mouse down?>>> and <not <key (t v) pressed?>>>\n        if <(Chat) = [0]> then\n            set [chat v] to [1]\n            wait until <<not <<touching (mouse-pointer v)?> and <mouse down?>>> and <not <key (t v) pressed?>>>\n        end\n    end\nend\n\nwhen I receive [play game v]\nset [connected? v] to [0]\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\ndefine Change Player x by (sx)\npoint in direction (90)\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 (-12)\n    if <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> 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\nwhen flag clicked\npoint in direction (90)\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\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 Game On\nset [y v] to [0]\nset [x v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [ghost v] effect to (0)\nset size to (100) %\n\ndefine Test - Die\nif <touching (danger v)?> then\n    start sound [crashed oof v]\n    set [exit v] to [die]\nend\nif <touching (saws v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - Die\nset [exit v] to []\n\nstart sound [Hurt v]\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\nhide\nchange [level v] by (1)\nwait (1) seconds\n\ndefine Tick\nif <not <key (any v) pressed?>> then\n    switch costume to (normal v)\nend\nif <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (left v)\n    change [sx v] by (-2)\nend\nif <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n    switch costume to (right v)\n    change [sx v] by (2)\nend\nif <<<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<<(mouse x) < (x position)> and <mouse down?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>>> then\n    switch costume to (left up v)\nend\nif <<<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> and <<<(x position) < (mouse x)> and <mouse down?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>>> then\n    switch costume to (right up v)\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 <<<(y position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> 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)\nTest - Die\nset [scroll x v] to (x)\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\nif <(y) < [-180]> then\n    set [exit v] to [die]\n    start sound [crashed oof v]\nend\nif <(x) < [-220]> then\n    set [x v] to [-220]\nend\n\nwhen flag clicked\nhide\nset [max players v] to [8]\nset [my player # v] to [0]\nbroadcast (Connecting v)\nbroadcast (Setup Others v) and wait\nbroadcast (Join Game v) and wait\nbroadcast (Begin v)\nbroadcast (Connected v)\nstart sound [Connect v]\n\nif <(MY PLAYER #) > [0]> then\nelse\nend\n\nbroadcast (Full v)\nstart sound [Disconnect v]\n\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ 1p v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ 2p v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ 3p v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ 4p v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ 5p v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ 6p v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ 7p v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ 8p v] to (value)\n                            else\n                                if <(player) = [9]> then\n                                    set [☁ 9p v] to (value)\n                                else\n                                    if <(player) = [10]> then\n                                        set [☁ 10p v] to (value)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine write (val) to encoded\nset [letter # v] to [1]\nrepeat (length of (val))\n    set [encoded v] to (join (encoded) (item # of (letter (letter #) of (val)) in [code v]))\n    change [letter # v] by (1)\nend\nset [encoded v] to (join (encoded) [00])\n\nwhen I receive [begin v]\nforever\n    if <(MY PLAYER #) > [0]> then\n        send cloud data\n    end\nend\n\ndefine send cloud data\nset [encoded v] to []\nwrite (username) to encoded\nwrite (round ((timer) * (10))) to encoded\nwrite (x) to encoded\nwrite (y) to encoded\nwrite (Chat Words) to encoded\nset cloud # (MY PLAYER #) to (encoded)\n\ndefine Chat\nif <(Chat) = [1]> then\n    if <key (1 v) pressed?> then\n        set [chat words v] to [1]\n        say (item (1) of [chat v])\n        wait (2) seconds\n        say []\n        set [chat words v] to [0]\n    else\n        if <key (2 v) pressed?> then\n            set [chat words v] to [2]\n            say (item (2) of [chat v])\n            wait (2) seconds\n            say []\n            set [chat words v] to [0]\n        else\n            if <key (3 v) pressed?> then\n                set [chat words v] to [3]\n                say (item () of [chat v])\n                wait (2) seconds\n                say []\n                set [chat v] to [0]\n            else\n                if <key (4 v) pressed?> then\n                    set [chat words v] to [4]\n                    say (item (4) of [chat v])\n                    wait (2) seconds\n                    say []\n                    set [chat words v] to [0]\n                else\n                    if <key (5 v) pressed?> then\n                        set [chat words v] to [5]\n                        say (item (5) of [chat v])\n                        wait (2) seconds\n                        say []\n                        set [chat words v] to [0]\n                    else\n                        if <key (6 v) pressed?> then\n                            set [chat words v] to [6]\n                            say (item (6) of [chat v])\n                            wait (2) seconds\n                            say []\n                            set [chat words v] to [0]\n                        else\n                            if <key (7 v) pressed?> then\n                                set [chat words v] to [7]\n                                say (item (7) of [chat v])\n                                wait (2) seconds\n                                say []\n                                set [chat words v] to [0]\n                            else\n                                if <key (8 v) pressed?> then\n                                    set [chat words v] to [8]\n                                    say (item (8) of [chat v])\n                                    wait (2) seconds\n                                    say []\n                                    set [chat words v] to [0]\n                                else\n                                    if <key (9 v) pressed?> then\n                                        set [chat words v] to [9]\n                                        say (item (9) of [chat v])\n                                        wait (2) seconds\n                                        say []\n                                        set [chat words v] to [0]\n                                    else\n                                        set [chat words v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [connected v]\nset [connected? v] to [1]\nshow\n\nwhen I receive [connecting v]\nhide\n\nwhen I receive [play game v]\nforever\n    if <(Connected?) = [1]> then\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            Game - Win\n        else\n            Game - Die\n        end\n    end\nend\n\nwhen I receive [connected v]\nset [level v] to [1]\n\ndefine Player Tick\n\nforever\n    switch costume to (right v)\nend\n\nwhen [timer v] > (0)\nhide\n\nset [ghost v] effect to (100)\n\n@Platforms\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((Platforms: x) - (SCROLL X)) ((Platforms: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [platforms: x v] to [0]\nset [platforms: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [480] y: [0]\n    Clone at x: [-480] y: [360]\n    Clone at x: [0] y: [300]\n    Clone at x: [240] y: [75]\n    Clone at x: [-575] y: [-125]\n    Clone at x: [-250] y: [125]\n    Clone at x: [-250] y: [175]\n    Clone at x: [-250] y: [215]\n    Clone at x: [250] y: [400]\n    Clone at x: [1375] y: [-600]\n    Clone at x: [220] y: [220]\n    Clone at x: [220] y: [-100]\n    Clone at x: [0] y: [100]\n    Clone at x: [500] y: [-50]\n    Clone at x: [-89] y: [150]\n    Clone at x: [89] y: [150]\n    Clone at x: [-200] y: [0]\n    Clone at x: [-200] y: [0]\n    Clone at x: [0] y: [175]\n    Clone at x: [200] y: [150]\n    Clone at x: [200] y: [150]\n    Clone at x: [200] y: [100]\n    Clone at x: [550] y: [0]\n    Clone at x: [150] y: [100]\n    Clone at x: [-150] y: [100]\n    Clone at x: [-150] y: [100]\n    Clone at x: [150] y: [100]\n    Clone at x: [150] y: [100]\n    Clone at x: [0] y: [150]\n    Clone at x: [0] y: [150]\n    Clone at x: [250] y: [100]\nend\n\ndefine Position (x) (y)\nset size to (100) %\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 [platforms: x v] by (x)\nchange [platforms: y v] by (y)\nnext costume\n\nnext costume\nnext costume\n\ncreate clone of (_myself_ v)\n\n@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\n        repeat (9)\n            change y by (-6)\n        end\n        repeat (5)\n            change y by (3)\n        end\n        repeat (5)\n            change y by (-1)\n        end\n        wait (2) seconds\n        repeat (15)\n            change y by (7)\n        end\n        hide\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n@Loading\n\nwhen flag clicked\ngo [forward v] (213) layers\nset size to (100) %\nhide\npoint in direction (90)\nclear graphic effects\ngo to x: (0) y: (-80)\n\nwhen I receive [connecting v]\nrepeat (11)\n    create clone of (_myself_ v)\n    turn right (40) degrees\nend\n\nwhen I receive [connected v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nforever\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (-6)\n        change size by (1)\n    end\n    repeat (20)\n        turn right (7.5) degrees\n        change [ghost v] effect by (6)\n        change size by (-1)\n    end\nend\n\n@Joining\n\nwhen flag clicked\nhide\n\nwhen I receive [begin v]\nhide\n\nwhen I receive [connecting v]\nswitch costume to (joining v)\nshow\n\nwhen I receive [connected v]\ngo [forward v] (1322) layers\nstart sound [Connect v]\n\nswitch costume to (connected v)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [full v]\n\nswitch costume to (full  v)\nshow\n\n@DANGER\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((DANGER: x) - (SCROLL X)) ((DANGER: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nswitch costume to (1 v)\nset [danger: x v] to [0]\nset [danger: y v] to [0]\nif <(LEVEL) = [1]> then\n    Clone at x: [300] y: [-50]\n    Clone at x: [25] y: [50]\n    Clone at x: [30] y: [0]\n    Clone at x: [390] y: [33]\n    Clone at x: [962] y: [1286]\n    Clone at x: [30] y: [0]\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\n    Clone at x: [30] y: []\nend\nhide\n\ndefine Position (x) (y)\ngo to [back v] layer\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 [danger: x v] by (x)\nchange [danger: y v] by (y)\nnext costume\n\nwhen I start as a clone\nshow\n\nshow\n\n@Collectables\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nnext costume\nPosition ((Collectables: x) - (SCROLL X)) ((Collectables: y) - (SCROLL Y))\nif <touching (player v)?> then\n    change [collected v] by (1)\n    start sound [Coin v]\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [coins v] to [0]\nhide\nset [collectables: x v] to [0]\nset [collectables: y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (coin1 v)\n    Clone at x: [-7] y: [63]\n    Clone at x: [400] y: [63]\n    Clone at x: [430] y: [93]\n    Clone at x: [460] y: [93]\n    Clone at x: [810] y: [50]\n    Clone at x: [1100] y: [150]\n    Clone at x: [900] y: [300]\n    Clone at x: [1275] y: [375]\n    Clone at x: [1000] y: [500]\n    Clone at x: [950] y: [600]\n    Clone at x: [1025] y: [700]\n    Clone at x: [950] y: [800]\n    Clone at x: [1100] y: [900]\n    Clone at x: [1375] y: [1100]\n    Clone at x: [1600] y: [1280]\n    Clone at x: [1825] y: [1185]\n    Clone at x: [2320] y: [1125]\n    Clone at x: [2230] y: [1265]\n    Clone at x: [2320] y: [1410]\n    Clone at x: [2120] y: [1410]\n    Clone at x: [1920] y: [1410]\n    Clone at x: [1920] y: [1585]\n    Clone at x: [2120] y: [1735]\n    Clone at x: [2320] y: [1885]\n    Clone at x: [3055] y: [2000]\n    Clone at x: [3205] y: [2100]\n    Clone at x: [3055] y: [2200]\n    Clone at x: [2905] y: [2300]\n    Clone at x: [3055] y: [2400]\n    Clone at x: [3205] y: [2500]\n    Clone at x: [3205] y: [2650]\n    Clone at x: [3205] y: [2800]\nend\nset [collectables: x v] to [-9999999999]\n\ncreate clone of (_myself_ v)\n\nnext costume\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)\nset [collectables: x v] to (x)\nset [collectables: y v] to (y)\ncreate clone of (_myself_ v)\n\n@登録推進\n\nwhen I receive [登録！ v]\ngo to x: (0) y: (0)\nset [登録用 v] to [0]\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム1 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム2 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム3 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム4 v)\ncreate clone of (_myself_ v)\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\nswitch costume to (4 v)\ncreate clone of (_myself_ v)\nswitch costume to (コスチューム5 v)\ncreate clone of (_myself_ v)\nswitch costume to (くうはく v)\ncreate clone of (_myself_ v)\nwait (1) seconds\nchange [登録用 v] by (1)\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nif <<(costume [number v]) = [5]> or <(costume [number v]) = [6]>> then\n    wait until <(登録用) = [1]>\n    if <(costume [number v]) = [6]> then\n        wait (0.2) seconds\n    end\n    start sound [High Whoosh v]\n    repeat until <(round (y position)) = [-20]>\n        change y by (((-20) - (y position)) / (4))\n        change [ghost v] effect by (15)\n    end\n    hide\n    set [登録用 v] to [2]\nelse\n    if <<(costume [number v]) = [7]> or <(costume [number v]) = [8]>> then\n        hide\n        go to x: (0) y: (30)\n        wait until <(登録用) = [2]>\n        if <(costume [number v]) = [8]> then\n            wait (0.2) seconds\n        end\n        show\n        repeat until <(round (y position)) = [0]>\n            change y by (((0) - (y position)) / (4))\n        end\n        wait until <(登録用) = [4]>\n        repeat until <(round (y position)) = [10]>\n            change y by (((10) - (y position)) / (4))\n        end\n        wait until <(登録用) = [5]>\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    else\n        if <<(costume [number v]) = [3]> or <(costume [number v]) = [4]>> then\n            hide\n            wait until <(登録用) = [2]>\n            if <(costume [number v]) = [4]> then\n                wait (0.2) seconds\n            end\n            show\n            set size to (150) %\n            repeat until <(round (size)) = [100]>\n                change size by (((100) - (size)) / (2))\n            end\n            start sound [Collect v]\n            set [登録用 v] to [3]\n            wait until <(登録用) = [4]>\n            repeat until <(round (y position)) = [10]>\n                change y by (((10) - (y position)) / (4))\n            end\n            wait until <(登録用) = [5]>\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n        else\n            if <(costume [number v]) = [2]> then\n                wait until <(登録用) = [3]>\n                hide\n                wait (1) seconds\n                start sound [Low Whoosh v]\n                set [登録用 v] to [4]\n            else\n                if <(costume [number v]) = [9]> then\n                    go to [back v] layer\n                    hide\n                    wait until <(登録用) = [4]>\n                    show\n                    go to x: (0) y: (30)\n                    repeat until <(round (y position)) = [0]>\n                        change y by (((0) - (y position)) / (4))\n                    end\n                    go to [front v] layer\n                    wait until <(登録用) = [5]>\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    repeat (10)\n                        change [音量 v] by (10)\n                    end\n                else\n                    if <(costume [number v]) = [1]> then\n                        wait until <(登録用) = [4]>\n                        repeat until <(round (y position)) = [10]>\n                            change y by (((10) - (y position)) / (4))\n                        end\n                        wait (2) seconds\n                        set [登録用 v] to [5]\n                        wait until <(登録用) = [5]>\n                        repeat (10)\n                            change [ghost v] effect by (10)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen I receive [とまれ〜 v]\n\nwhen [timer v] > (0)\nhide\nbroadcast (登録！ v)\n\n@スプライト1\n\nwhen flag clicked\nhide\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\n