Rocky Terrain || ☁ Scrolling Platformer ☁
@Stage\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (SCROLLX)) (join [, ] ((mouse y) + (SCROLLY))))\n\nwhen flag clicked\nswitch backdrop to (joining v)\nset volume to (40) %\nforever\n    play sound [Xaf - Goodbye \(1\) v] until done\nend\n\nwhen I receive [join game v]\nbroadcast (switch track v)\n\nwhen I receive [switch track v]\nrepeat (40)\n    change volume by (-1)\nend\nstop [other scripts in sprite v]\nset volume to (30) %\nwait (1) seconds\nforever\n    play sound [14 v] until done\n    play sound [Xaf - Nebula v] until done\nend\n\n@Blank\n\n@Player\n\ndefine Point Towards X: (x) Y: (y)\npoint in direction (((180) * <<(y position) > (y)> or <(y position) = (y)>>) + ([atan v] of (((x position) - (x)) / ((y position) - (y))) ))\n\nwhen flag clicked\nhide\ndelete all of [buffer v]\n\nset [my player # v] to [0]\nset [max players v] to [8]\nbroadcast (setup - opponents v) and wait\nswitch backdrop to (joining v)\nbroadcast (join game v) and wait\nif <(MY PLAYER #) > [0]> then\n    switch backdrop to (joined v)\nelse\n    switch backdrop to (full v)\nend\nwait (1) seconds\nswitch backdrop to (game v)\nbroadcast (begin v)\nbroadcast ( Green Flag v) and wait\nbroadcast (Play Game v) and wait\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\ndefine set cloud # (player) to (value)\nif <(player) = [1]> then\n    set [☁ p1 v] to (value)\nelse\n    if <(player) = [2]> then\n        set [☁ p2 v] to (value)\n    else\n        if <(player) = [3]> then\n            set [☁ p3 v] to (value)\n        else\n            if <(player) = [4]> then\n                set [☁ p4 v] to (value)\n            else\n                if <(player) = [5]> then\n                    set [☁ p5 v] to (value)\n                else\n                    if <(player) = [6]> then\n                        set [☁ p6 v] to (value)\n                    else\n                        if <(player) = [7]> then\n                            set [☁ p7 v] to (value)\n                        else\n                            if <(player) = [8]> then\n                                set [☁ p8 v] to (value)\n                            else\n                                if <(player) = [SpeedRuns]> then\n                                    set [☁ speed runs v] to (value)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine send cloud data\nif <(MY PLAYER #) < [1]> then\n    stop [this script v]\nend\nadd (x) to [buffer v]\nadd (y) to [buffer v]\nchange [cloud timer v] by (1)\nif <(cloud timer) < [3]> then\n    stop [this script v]\nend\nset [cloud timer v] to [0]\nset [encoded v] to []\nwrite (LEVEL) to encoded\nwrite (size) to encoded\nwrite (ghost effect) to encoded\nwrite (username) to encoded\nwrite (CHAT) to encoded\nwrite (round ((timer) * (10))) to encoded\nrepeat (length of [buffer v])\n    write (item (1) of [buffer v]) to encoded\n    delete (1) of [buffer v]\nend\nset cloud # (MY PLAYER #) to (encoded)\n\ndefine Tick\nif <(wait) < [1]> then\n    if <(chatting) < [1]> then\n        if <<(x position) < [-200]> and <<(y position) < [-140]> and <mouse down?>>> then\n            set [chatting v] to [50]\n            set [chat v] to (i)\n        end\n        if <key (any v) pressed?> then\n            key\n        end\n        say []\n    else\n        change [chatting v] by (-1)\n        if <(chatting) < [1]> then\n            set [chat v] to [0]\n        end\n        if <not <(Show Text) = [none]>> then\n            say (item (CHAT) of [chats v])\n        else\n            say []\n        end\n    end\n    if <(double clicked) > [0]> then\n        change [double clicked v] by (-1)\n    end\n    Zero Pressed?\n    Space Pressed?\n    if <(TELEPORTING) = [n/a]> then\n        double clicked\n        if <key (space v) pressed?> then\n            set [started level? v] to [yes]\n            if <(Attacking) = [no]> then\n                set [attacking v] to [yes]\n                broadcast (Attack v)\n            end\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n            set [started level? v] to [yes]\n            point in direction (-90)\n            change [speed x v] by (-1)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            set [started level? v] to [yes]\n            point in direction (90)\n            change [speed x v] by (1)\n        end\n        set [speed x v] to ((SPEED X) * (.9))\n        if <touching (moving platforms v)?> then\n            get out of moving platforms\n        end\n        change y by (-3)\n        if <touching (moving platforms v)?> then\n            set [touching platform v] to [yes]\n        else\n            if <(touching platform) = [yes]> then\n                change [speed x v] by ((GLIDESPEED) * (-1))\n            end\n            set [touching platform v] to [no]\n        end\n        change y by (3)\n        if <<([abs v] of (SPEED X) ) > [1]> or <(touching platform) = [yes]>> then\n            if <(touching platform) = [yes]> then\n                Change Player X by (round ((SPEED X) + ((GLIDESPEED) * (-1))))\n            else\n                Change Player X by (round (SPEED X))\n            end\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (15))>>> then\n            set [started level? v] to [yes]\n            if <<(in air) < [3]> and <(TRAMP - player) < [1]>> then\n                set [speed y v] to [12]\n            end\n        end\n        if <(SPEED Y) > [-19]> then\n            change [speed y v] by (-1)\n        end\n        if <(touching platform) = [yes]> then\n            change [x v] by (GLIDESPEED)\n        end\n        Change Player Y by (SPEED Y)\n        if <(touching platform) = [yes]> then\n            change [x v] by ((-1) * (GLIDESPEED))\n        end\n        test - die\n        Test - Restart\n        test - skip/back\n        test - reset levels\n        delete all of [enemydanger v]\n        if <(y) < [-180]> then\n            set [exit v] to [die]\n        end\n    else\n        if <(TELEPORTING) > [10]> then\n            change [teleporting v] by (-1)\n            set [x v] to (TELEPORT X)\n            set [y v] to (TELEPORT Y)\n            change size by (-3)\n            change [brightness v] effect by (8)\n        else\n            if <(TELEPORTING) > [0]> then\n                change [teleporting v] by (-1)\n                set [x v] to (TELEPORT X)\n                set [y v] to (TELEPORT Y)\n                change size by (3)\n                change [brightness v] effect by (-8)\n            else\n                set [brightness v] effect to (0)\n                set size to (100) %\n                set [teleporting v] to [n/a]\n                set [touching platform v] to [no]\n                set [speed x v] to [0]\n                set [speed y v] to [0]\n            end\n        end\n    end\nelse\n    change [wait v] by (-1)\nend\nif <(started level?) = [no]> then\n    set [start time v] to (Time)\nend\nchange [scrollx v] by (round (((x) - (SCROLLX)) / (9)))\nif <(SCROLLX) < [-50]> then\n    set [scrollx v] to [-50]\nend\nchange [scrolly v] by (round (((y) - (SCROLLY)) / (9)))\nif <(SCROLLY) < [0]> then\n    set [scrolly v] to [0]\nend\nposition\ndelete all of [player stuff v]\nadd (x position) to [player stuff v]\nadd (y position) to [player stuff v]\n\nwhen I receive [ green flag v]\nhide\ngo to [front v] layer\ndelete all of [platform speeds v]\ndelete all of [playerstartingpos v]\nChat - Help\nadd [0] to [playerstartingpos v]\nadd [0] to [playerstartingpos v]\n\nwhen I receive [play game v]\npoint in direction (90)\nset [show text v] to [all]\nswitch costume to (costume1 v)\nshow\nset [flymode v] to [off]\nset [levels v] to [4]\nset [clone type v] to [tri]\nset [time v] to [0]\nset [start time v] to [0]\nset [started level? v] to [no]\nset rotation style [all around v]\ncreate clone of (_myself_ v)\nset [clone type v] to [player]\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\nset rotation style [left-right v]\nforever\n    Game On\n    repeat until <(EXIT) > []>\n        if <(username) = [rudytudy]> then\n            if <key (1 v) pressed?> then\n                if <(key1pressed) = [no]> then\n                    if <(flymode) = [off]> then\n                        set [flymode v] to [on]\n                    else\n                        set [flymode v] to [off]\n                    end\n                end\n                set [key1pressed v] to [yes]\n            else\n                set [key1pressed v] to [no]\n            end\n            if <(flymode) = [on]> then\n                Fly\n            else\n                Tick\n            end\n        else\n            Tick\n        end\n        broadcast (tick v)\n        broadcast (move enemies v)\n        send cloud data\n    end\n    broadcast (Hide Clone v) and wait\n    if <(EXIT) = [win]> then\n        Game - Win\n    else\n        if <(EXIT) = [die]> then\n            Game - Die\n        else\n            if <(EXIT) = [restart]> then\n                Game - Restart\n            else\n                if <(EXIT) = [back]> then\n                    Skip [-1]\n                else\n                    if <(EXIT) = [skip]> then\n                        Skip [1]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Game On\nset [x v] to (item (1) of [playerstartingpos v])\nset [y v] to (item (2) of [playerstartingpos v])\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [in air v] to [5]\nset [exit v] to []\nset [scrollx v] to (item (1) of [playerstartingpos v])\nset [scrolly v] to (item (2) of [playerstartingpos v])\nset [wait v] to [5]\nset [touching platform v] to [no]\nset size to (100) %\nset [ghost effect v] to [0]\nset [ghost v] effect to (ghost effect)\nshow\n\ndefine Change Player Y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nif <(TRAMP - player) > [0]> then\n    change [tramp - player v] by (-1)\nend\nposition\nrepeat until <not <<touching (platforms v)?> or <touching (moving 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 [speed y v] to [0]\nend\n\ndefine position\ngo to x: ((x) - (SCROLLX)) y: ((y) - (SCROLLY))\nif <<((x) - (SCROLLX)) = (x position)> and <((y) - (SCROLLY)) = (y position)>> then\n    show\nelse\n    if <not <((x) - (SCROLLX)) = (x position)>> then\n        hide\n    end\nend\n\ndefine Change Player X by (sx)\nchange [x v] by (sx)\nposition\nif <<touching (platforms v)?> or <touching (moving platforms v)?>> then\n    repeat (10)\n        change [y v] by (1)\n        position\n        if <not <<touching (platforms v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-10)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (15))>>> then\n        if <(sx) > [0]> then\n            set [speed x v] to [-11]\n        else\n            set [speed x v] to [11]\n        end\n        set [in air v] to [0]\n    else\n        set [speed x v] to [0]\n    end\n    repeat until <not <<touching (platforms v)?> or <touching (moving 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\nset [exit v] to []\nstart sound [446115__justinvoke__wet-splat v]\nexplode\nhide\nDeath - Cloud\nwait (.5) seconds\nset size to (100) %\nset [ghost effect v] to [0]\nset [ghost v] effect to (ghost effect)\n\ndefine test - die\nif <<touching (saws v)?> or <touching (danger v)?>> then\n    set [exit v] to [die]\nend\nif <touching (enemies v)?> then\n    Check Enemies\nend\n\nwhen I start as a clone\nif <(clone type) = [death]> then\n    switch costume to (costume2 v)\n    set [ghost effect v] to [0]\n    set [ghost v] effect to (ghost effect)\n    show\n    if <(pick random (1) to (10)) = [1]> then\n        set [sy v] to (pick random (3.0) to (4.0))\n        set [sx v] to (pick random (-2.0) to (2.0))\n    else\n        set [sy v] to (pick random (4.0) to (7))\n        set [sx v] to (pick random (-5.0) to (5.0))\n    end\n    change x by (pick random (-8) to (8))\n    change y by (pick random (-8) to (8))\n    repeat (20)\n        switch costume to (costume4 v)\n        change x by (sx)\n        change y by (sy)\n        switch costume to (costume2 v)\n        change [ghost effect v] by (4)\n        set [ghost v] effect to (ghost effect)\n        change [sy v] by (-.5)\n    end\n    delete this clone\nelse\n    if <(clone type) = [highscore]> then\n        go to x: (((digits) * (21)) + (0)) y: (-80)\n        do letter stuff [190]\n    else\n        if <(clone type) = [letter]> then\n            go to x: (((digits) * (22)) - (((1) + (length of (ShowTimer))) * (11))) y: (-32)\n            do letter stuff [200]\n        end\n    end\nend\n\ndefine Game - Win\nstart sound [433635__tmpz-1__scifi-swoosh v]\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-2)\n    change [ghost effect v] by (2)\n    set [ghost v] effect to (ghost effect)\nend\nshow\nset [ghost v] effect to (100)\npoint in direction (90)\ngo to x: (0) y: (0)\nset size to (100) %\ngo to [front v] layer\nbroadcast (Highscores v) and wait\nif <(item (LEVEL) of [speed runs v]) > ((Time) - (START TIME))> then\n    switch costume to (highscore v)\n    replace item (LEVEL) of [speed runs v] with (REAL TIME)\n    replace item (LEVEL) of [speed run names v] with (username)\n    Set Highscore\n    broadcast (Highscores v) and wait\n    set [clone type v] to [highscore]\n    Show your time\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (2) seconds\n    switch costume to (costume1 v)\n    hide\nelse\n    switch costume to (highscore2 v)\n    set [clone type v] to [letter]\n    Show your time\n    repeat (10)\n        change [ghost v] effect by (-10)\n    end\n    wait (2) seconds\n    switch costume to (costume1 v)\n    hide\nend\nchange [level v] by (1)\nif <(LEVEL) > (Levels)> then\n    stop [all v]\nend\nset [time v] to [0]\nset [start time v] to [0]\nset [started level? v] to [no]\ndelete all of [playerstartingpos v]\nadd [0] to [playerstartingpos v]\nadd [-25] to [playerstartingpos v]\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\n\ndefine get out of moving platforms\nrepeat (10)\n    change [x v] by (2)\n    position\n    if <not <touching (moving platforms v)?>> then\n        stop [this script v]\n    end\nend\nchange [x v] by (-20)\nrepeat until <not <touching (moving platforms v)?>>\n    change [x v] by (-2)\n    position\nend\n\ndefine key\nif <key ((join [] [enter]) v) pressed?> then\n    set [i v] to [0]\n    repeat (length of [chats v])\n        change [i v] by (1)\n        set [pressed v] to (item (i) of [alphabet v])\n        if <key ((pressed) v) pressed?> then\n            set [chatting v] to [50]\n            set [chat v] to (i)\n            stop [this script v]\n        end\n    end\nend\nset [chat v] to [0]\n\ndefine Chat - Help\ndelete all of [chat - help v]\nset [i v] to [0]\nrepeat (length of [chats v])\n    change [i v] by (1)\n    add (join (join (join (item (i) of [alphabet v]) [ + ↵ ]) [= "]) (join (item (i) of [chats v]) ["])) to [chat - help v]\nend\n\ndefine Space Pressed?\nif <key (9 v) pressed?> then\n    if <(space pressed) = [no]> then\n        if <(Show Text) = [all]> then\n            set [show text v] to [some]\n        else\n            if <(Show Text) = [none]> then\n                set [show text v] to [all]\n            else\n                set [show text v] to [none]\n            end\n        end\n        broadcast (Space v)\n    end\n    set [space pressed v] to [yes]\nelse\n    set [space pressed v] to [no]\nend\n\ndefine Zero Pressed?\nif <key (0 v) pressed?> then\n    if <(0 pressed?) = [no]> then\n        if <(chat showing?) = [yes]> then\n            set [chat showing? v] to [no]\n            show list [chat - help v]\n        else\n            set [chat showing? v] to [yes]\n            hide list [chat - help v]\n        end\n    end\n    set [0 pressed? v] to [yes]\nelse\n    set [0 pressed? v] to [no]\nend\n\ndefine Fly\nif <key (left arrow v) pressed?> then\n    change [speed x v] by (-2)\nend\nif <key (right arrow v) pressed?> then\n    change [speed x v] by (2)\nend\nif <key (up arrow v) pressed?> then\n    change [speed y v] by (2)\nend\nif <key (down arrow v) pressed?> then\n    change [speed y v] by (-2)\nend\nset [speed y v] to ((SPEED Y) * (.9))\nset [speed x v] to ((SPEED X) * (.9))\nchange [x v] by (SPEED X)\nchange [y v] by (SPEED Y)\nchange [scrollx v] by (round (((x) - (SCROLLX)) / (8)))\nif <(SCROLLX) < [-50]> then\n    set [scrollx v] to [-50]\nend\nchange [scrolly v] by (round (((y) - (SCROLLY)) / (8)))\nif <(SCROLLY) < [0]> then\n    set [scrolly v] to [0]\nend\nposition\nshow\ndelete all of [player stuff v]\nadd (x position) to [player stuff v]\nadd (y position) to [player stuff v]\ntest - reset levels\n\ndefine double clicked\nif <mouse down?> then\n    if <(mouse down) = [no]> then\n        if <(double clicked) > [0]> then\n            set [started level? v] to [yes]\n            if <(Attacking) = [no]> then\n                set [attacking v] to [yes]\n                broadcast (Attack v)\n            end\n        end\n        set [double clicked v] to [6]\n    end\n    set [mouse down v] to [yes]\nelse\n    set [mouse down v] to [no]\nend\n\nwhen I receive [tick v]\nif <(clone type) = [tri]> then\n    if <(TELEPORTING) = [n/a]> then\n        show\n        set size to (100) %\n        go to [front v] layer\n        go [backward v] (4) layers\n        switch costume to (costume3 v)\n        go to x: (item (1) of [player stuff v]) y: (item (2) of [player stuff v])\n        turn right (round ((SPEED X) * (2))) degrees\n    else\n        hide\n    end\nend\n\ndefine Check Enemies\nrepeat (length of [enemydanger v])\n    if <(item (1) of [enemydanger v]) = [alive]> then\n        set [exit v] to [die]\n        stop [this script v]\n    end\n    delete (1) of [enemydanger v]\nend\n\nif <(TELEPORTING) = [n/a]> then\n    change [scrollx v] by (round (((x) - (SCROLLX)) / (1)))\nend\n\ndefine Set Highscore\nset [encoded v] to []\nset [i v] to [1]\nrepeat (Levels)\n    write (item (i) of [speed run names v]) to encoded\n    write (item (i) of [speed runs v]) to encoded\n    change [i v] by (1)\nend\nset cloud # [SpeedRuns] to (encoded)\n\ndefine explode\nrepeat (40)\n    set [clone type v] to [death]\n    create clone of (_myself_ v)\n    set [clone type v] to [player]\n    change size by (-3)\n    change [ghost effect v] by (3)\n    set [ghost v] effect to (ghost effect)\nend\n\ndefine Death - Cloud\nset size to (100) %\nset [ghost effect v] to [0]\nset [ghost v] effect to (ghost effect)\nrepeat (30)\n    set [clone type v] to [player]\n    change size by (-3)\n    change [ghost effect v] by (3)\n    set [ghost v] effect to (ghost effect)\n    send cloud data\nend\n\nwhen I receive [hide clone v]\nif <(clone type) = [tri]> then\n    hide\nend\n\ndefine Test - Restart\nif <<key (q v) pressed?> and <key (r v) pressed?>> then\n    set [exit v] to [restart]\nend\n\ndefine Game - Restart\nrepeat (3)\n    set [ghost effect v] to [100]\n    set [ghost v] effect to (ghost effect)\n    wait (.1) seconds\n    set [ghost effect v] to [0]\n    set [ghost v] effect to (ghost effect)\n    wait (.1) seconds\nend\nset [time v] to [0]\nset [start time v] to [0]\nset [started level? v] to [no]\ndelete all of [playerstartingpos v]\nadd [0] to [playerstartingpos v]\nadd [-25] to [playerstartingpos v]\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\n\nSet Highscore\n\ndefine Show your time\nset [digits v] to [0]\nrepeat (length of (ShowTimer))\n    change [digits v] by (1)\n    create clone of (_myself_ v)\nend\n\ndefine do letter stuff (size)\nif <(length of (ShowTimer)) < (digits)> then\n    hide\nelse\n    show\n    switch costume to (letter (digits) of (ShowTimer))\nend\nset size to (size) %\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [reset v]\nif <<(clone type) = [highscore]> or <(clone type) = [letter]>> then\n    delete this clone\nend\n\ndefine test - reset levels\nif <key (x v) pressed?> then\n    broadcast (Reset v) and wait\n    broadcast (Setup v)\nend\n\ndefine test - skip/back\nif <(LEVEL) < (Levels)> then\n    if <<key (q v) pressed?> and <key (o v) pressed?>> then\n        set [exit v] to [skip]\n    end\nend\nif <[1] < (LEVEL)> then\n    if <<key (q v) pressed?> and <key (p v) pressed?>> then\n        set [exit v] to [back]\n    end\nend\n\ndefine Skip (how many)\nchange [level v] by (how many)\nif <<(LEVEL) > (Levels)> or <[1] > (LEVEL)>> then\n    stop [all v]\nend\nset [time v] to [0]\nset [start time v] to [0]\nset [started level? v] to [no]\ndelete all of [playerstartingpos v]\nadd [0] to [playerstartingpos v]\nadd [-25] to [playerstartingpos v]\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\n\ndefine Wait\nwait until <key (r v) pressed?>\nwait until <not <key (r v) pressed?>>\n\nreplace item (2) of [speed run names v] with [cantankerousmaams]\nreplace item (3) of [speed run names v] with [cantankerousmaams]\n\nreplace item (3) of [speed run names v] with [No-name]\nreplace item (3) of [speed runs v] with [50.00]\n\nreplace item (4) of [speed run names v] with [moipanp1]\n\nreplace item (2) of [speed runs v] with [11.79]\nreplace item (3) of [speed runs v] with [8.68]\n\nreplace item (4) of [speed runs v] with [26.26]\n\nSet Highscore\n\nset [time v] to [0]\nset [start time v] to [0]\nset [started level? v] to [no]\n\nwhen [r v] key pressed\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\n\n@Other players\n\ndefine setup players\ndelete all of [buffer v]\nhide\nset [offline v] to [100]\nset [player # v] to [1]\nset [original sprite v] to [no]\nrepeat ((MAX PLAYERS) - (1))\n    create clone of (_myself_ v)\n    change [player # v] by (1)\nend\nset [original sprite v] to [yes]\n\nwhen I receive [tick v]\nif <(MY PLAYER #) = (player #)> then\n    set [offline v] to [100]\n    set [x v] to [-999]\n    hide\nelse\n    tick\nend\n\nwhen I receive [setup - opponents v]\nUpdate highscores\nsetup players\n\ndefine tick\nhide\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    change [offline v] by (1)\n    if <(Offline) = [100]> then\n        hide\n    end\nelse\n    set [last value v] to (join [A] (value))\n    if <(Offline) > [99]> then\n        show\n    end\n    set [offline v] to [0]\n    Begin decode of (value)\n    value = read from encoded\n    set [my level v] to (value)\n    value = read from encoded\n    set size to (value) %\n    value = read from encoded\n    set [ghost v] effect to (value)\n    value = read from encoded\n    if <(Show Text) = [all]> then\n        say (join (player #) (join [: ] (value)))\n    else\n        say []\n    end\n    value = read from encoded\n    if <(value) > [0]> then\n        if <not <(Show Text) = [none]>> then\n            say (item (value) of [chats v])\n        else\n            say []\n        end\n    end\n    value = read from encoded\n    value = read from encoded\n    repeat until <(value) = []>\n        add (value) to [buffer v]\n        value = read from encoded\n    end\nend\nif <(length of [buffer v]) > [0]> then\n    set [x v] to (item (1) of [buffer v])\n    delete (1) of [buffer v]\n    set [y v] to (item (1) of [buffer v])\n    delete (1) of [buffer v]\nend\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\n\ndefine Begin decode of (encoded)\nset [encoded v] to (encoded)\nset [letter # v] to [1]\n\nwhen I receive [join game v]\nvalue = cloud # (player #)\nset [last value v] to (join [A] (value))\nwait (2) seconds\nvalue = cloud # (player #)\nif <(join [A] (value)) = (last value)> then\n    set [my player # v] to (player #)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<<(x) = (x position)> and <(y) = (y position)>> and <<[100] > (Offline)> and <(my level) = (LEVEL)>>> then\n    show\nelse\n    hide\nend\n\ndefine value = read from encoded\nset [value v] to []\nforever\n    set [idx v] to (join (letter (letter #) of (encoded)) (letter ((letter #) + (1)) of (encoded)))\n    change [letter # v] by (2)\n    if <(idx) < [1]> then\n        stop [this script v]\n    end\n    set [value v] to (join (value) (item (idx) of [code v]))\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [highscores v]\nif <(original sprite) = [yes]> then\n    Update highscores\nend\n\ndefine Update highscores\nBegin decode of (☁ Speed Runs)\ndelete all of [speed run names v]\ndelete all of [speed runs v]\nrepeat (Levels)\n    value = read from encoded\n    add (value) to [speed run names v]\n    value = read from encoded\n    add (value) to [speed runs v]\nend\n\nwhen flag clicked\nwait (.5) seconds\nUpdate highscores\n\ndefine value = cloud # (player)\nif <(player) = [1]> then\n    set [value v] to (☁ P1)\nelse\n    if <(player) = [2]> then\n        set [value v] to (☁ P2)\n    else\n        if <(player) = [3]> then\n            set [value v] to (☁ P3)\n        else\n            if <(player) = [4]> then\n                set [value v] to (☁ P4)\n            else\n                if <(player) = [5]> then\n                    set [value v] to (☁ P5)\n                else\n                    if <(player) = [6]> then\n                        set [value v] to (☁ P6)\n                    else\n                        if <(player) = [7]> then\n                            set [value v] to (☁ P7)\n                        else\n                            set [value v] to (☁ P8)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@Platforms\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\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 (level 1 1 v)\n    set [costume v] to (costume [number v])\n    Clone at X: [1000] Y: [0]\n    Clone at X: [-900] Y: [300]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        set [costume v] to (costume [number v])\n        Clone at X: [1200] Y: [373]\n        Clone at X: [1200] Y: [-150]\n        Clone at X: [-1700] Y: [-270]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            set [costume v] to (costume [number v])\n            Clone at X: [1150] Y: [450]\n            Clone at X: [-500] Y: [319]\n            Clone at X: [360] Y: [230]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (level 4 1 v)\n                set [costume v] to (costume [number v])\n                Clone at X: [450] Y: [100]\n                Clone at X: [880] Y: [490]\n                Clone at X: [840] Y: [200]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\nswitch costume to (big v)\ngo to x: (x) y: (y)\nswitch costume to (costume)\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\nset [costume v] to (costume [number v])\n\nwhen flag clicked\nhide\n\ndelete this clone\n\n@Coins\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nif <(collecting) = [n/a]> then\n    set [addedx v] to (round ((([sin v] of ((Time) * (200)) ) * (float)) + (4)))\n    position ((x) - (SCROLLX)) (((y) - (SCROLLY)) + (addedX))\n    if <touching (player v)?> then\n        start sound [554346__deephazed__silver-coin-flip-l-ayex v]\n        set [collecting v] to [15]\n        change [collected v] by (1)\n        if <(COLLECTED) = (COLLECTED MAX)> then\n            broadcast (Open Portal v)\n        end\n    end\nelse\n    if <(collecting) > [0]> then\n        change [collecting v] by (-1)\n        position ((x) - (SCROLLX)) ((((y) - (SCROLLY)) + ((60) - ((collecting) * (4)))) + (addedX))\n        set [ghost v] effect to ((100) - ((collecting) * (8)))\n    else\n        delete this clone\n    end\nend\nif <(wait) < [1]> then\n    next costume\n    set [wait v] to [1]\nelse\n    change [wait v] by (-1)\nend\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\nset [float v] to [8]\nset [x v] to [0]\nset [y v] to [0]\nset [collecting v] to [n/a]\nset [collected v] to [0]\nset [collected max v] to [0]\nswitch costume to (1 v)\nif <(LEVEL) = [1]> then\n    Clone at X: [56] Y: [-72] Float: [5]\n    Clone at X: [136] Y: [-72] Float: [-5]\n    Clone at X: [319] Y: [-72] Float: [5]\n    Clone at X: [890] Y: [-72] Float: [5]\n    Clone at X: [980] Y: [-72] Float: [5]\n    Clone at X: [1070] Y: [-72] Float: [5]\n    Clone at X: [1162] Y: [23] Float: [5]\n    Clone at X: [1132] Y: [113] Float: [5]\n    Clone at X: [1105] Y: [203] Float: [5]\n    Clone at X: [1080] Y: [293] Float: [5]\n    Clone at X: [296] Y: [232] Float: [-5]\n    Clone at X: [102] Y: [232] Float: [-5]\n    Clone at X: [-85] Y: [232] Float: [-5]\n    Clone at X: [205] Y: [308] Float: [5]\n    Clone at X: [14] Y: [308] Float: [5]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at X: [133] Y: [10] Float: [5]\n        Clone at X: [57] Y: [174] Float: [-5]\n        Clone at X: [-168] Y: [174] Float: [5]\n        Clone at X: [660] Y: [257] Float: [5]\n        Clone at X: [745] Y: [257] Float: [-5]\n        Clone at X: [830] Y: [257] Float: [5]\n        Clone at X: [1400] Y: [263] Float: [-5]\n        Clone at X: [1600] Y: [263] Float: [5]\n        Clone at X: [1700] Y: [263] Float: [-5]\n        Clone at X: [1800] Y: [263] Float: [5]\n        Clone at X: [1900] Y: [263] Float: [-5]\n        Clone at X: [2000] Y: [263] Float: [5]\n        Clone at X: [2308] Y: [263] Float: [-5]\n        Clone at X: [2458] Y: [263] Float: [5]\n        Clone at X: [2600] Y: [327] Float: [5]\n        Clone at X: [2600] Y: [387] Float: [5]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at X: [60] Y: [-10] Float: [5]\n            Clone at X: [-15] Y: [95] Float: [-5]\n            Clone at X: [54] Y: [231] Float: [-5]\n            Clone at X: [148] Y: [231] Float: [5]\n            Clone at X: [350] Y: [231] Float: [-5]\n            Clone at X: [470] Y: [231] Float: [5]\n            Clone at X: [750] Y: [231] Float: [-5]\n            Clone at X: [1081] Y: [411] Float: [5]\n            Clone at X: [997] Y: [481] Float: [5]\n            Clone at X: [1081] Y: [560] Float: [5]\n            Clone at X: [892] Y: [665] Float: [-5]\n            Clone at X: [611] Y: [665] Float: [-5]\n            Clone at X: [511] Y: [737] Float: [5]\n            Clone at X: [627] Y: [811] Float: [-5]\n            Clone at X: [707] Y: [811] Float: [5]\n            Clone at X: [787] Y: [811] Float: [-5]\n            Clone at X: [867] Y: [811] Float: [5]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at X: [2091] Y: [1032] Float: [5]\n                Clone at X: [2172] Y: [1032] Float: [-5]\n                Clone at X: [199] Y: [-13] Float: [5]\n                Clone at X: [368] Y: [156] Float: [-5]\n                Clone at X: [545] Y: [156] Float: [5]\n                Clone at X: [740] Y: [156] Float: [-5]\n                Clone at X: [840] Y: [156] Float: [5]\n                Clone at X: [940] Y: [156] Float: [-5]\n                Clone at X: [1106] Y: [392] Float: [5]\n                Clone at X: [1206] Y: [392] Float: [-5]\n                Clone at X: [1300] Y: [482] Float: [5]\n                Clone at X: [1472] Y: [611] Float: [-5]\n                Clone at X: [1472] Y: [711] Float: [-5]\n                Clone at X: [1900] Y: [950] Float: [5]\n                Clone at X: [1622] Y: [950] Float: [-5]\n                Clone at X: [915] Y: [625] Float: [5]\n                Clone at X: [815] Y: [625] Float: [-5]\n                Clone at X: [715] Y: [625] Float: [5]\n            end\n        end\n    end\nend\nset [x v] to [-1000]\n\ndefine position (x) (y)\nset size to (150) %\ngo to x: (x) y: (y)\nset size to (100) %\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) Float: (float)\nset [float v] to (float)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\nhide\nforever\n    set [timer v] to ((timer) + (.1))\nend\n\nwhen [timer v] > (TIMER)\nshow list [chat - help v]\nstart sound [Xaf - Inferno v]\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nset volume to (40) %\nforever\n    switch costume to (costume2 v)\n    set y to (([sin v] of ((timer) * (200)) ) * (8))\n    point in direction ((([sin v] of ((timer) * (100)) ) * (2)) + (90))\n    switch costume to (costume1 v)\n    set [timer v] to ((timer) + (.1))\nend\n\n@Saws\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nif <(cos/sin) = [cos]> then\n    position (((x) - (SCROLLX)) + (round (([cos v] of ((Time) * (speedx)) ) * (widthx)))) (((y) - (SCROLLY)) + (round (([cos v] of ((Time) * (speedy)) ) * (widthy))))\nelse\n    position (((x) - (SCROLLX)) + (round (([sin v] of ((Time) * (speedx)) ) * (widthx)))) (((y) - (SCROLLY)) + (round (([sin v] of ((Time) * (speedy)) ) * (widthy))))\nend\nturn right (15) degrees\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\ngo to [back v] layer\nset [x v] to [0]\nset [y v] to [0]\nset [cos/sin v] to [sin]\nif <(LEVEL) = [1]> then\n    switch costume to (1 v)\n    Clone at X: [189] Y: [-95] speedx [60] widthx [100] speedy [0] widthy [0] size [75] cos/sin [sin]\n    Clone at X: [15] Y: [192] speedx [0] widthx [0] speedy [-100] widthy [120] size [75] cos/sin [sin]\n    Clone at X: [205] Y: [192] speedx [0] widthx [0] speedy [100] widthy [120] size [75] cos/sin [sin]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (1 v)\n        Clone at X: [1200] Y: [231] speedx [75] widthx [190] speedy [0] widthy [0] size [75] cos/sin [sin]\n        Clone at X: [1200] Y: [300] speedx [75] widthx [-190] speedy [0] widthy [0] size [75] cos/sin [sin]\n        Clone at X: [2233] Y: [236] speedx [0] widthx [0] speedy [-100] widthy [100] size [75] cos/sin [sin]\n        Clone at X: [2383] Y: [236] speedx [0] widthx [0] speedy [100] widthy [100] size [75] cos/sin [sin]\n        Clone at X: [2533] Y: [236] speedx [0] widthx [0] speedy [-100] widthy [100] size [75] cos/sin [cos]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (1 v)\n            Clone at X: [-15] Y: [69] speedx [-100] widthx [50] speedy [0] widthy [0] size [75] cos/sin [sin]\n            Clone at X: [183] Y: [69] speedx [0] widthx [0] speedy [100] widthy [100] size [75] cos/sin [sin]\n            Clone at X: [-184] Y: [69] speedx [0] widthx [0] speedy [100] widthy [100] size [75] cos/sin [sin]\n            Clone at X: [580] Y: [220] speedx [0] widthx [0] speedy [0] widthy [0] size [80] cos/sin [sin]\n            Clone at X: [1105] Y: [615] speedx [0] widthx [0] speedy [0] widthy [0] size [80] cos/sin [sin]\n            Clone at X: [966] Y: [540] speedx [0] widthx [0] speedy [0] widthy [0] size [80] cos/sin [sin]\n            Clone at X: [1105] Y: [465] speedx [0] widthx [0] speedy [0] widthy [0] size [80] cos/sin [sin]\n            Clone at X: [966] Y: [390] speedx [0] widthx [0] speedy [0] widthy [0] size [80] cos/sin [sin]\n            Clone at X: [468] Y: [765] speedx [0] widthx [0] speedy [0] widthy [0] size [40] cos/sin [sin]\n            Clone at X: [1079] Y: [1003] speedx [0] widthx [0] speedy [90] widthy [100] size [75] cos/sin [sin]\n            Clone at X: [941] Y: [1003] speedx [0] widthx [0] speedy [-90] widthy [100] size [75] cos/sin [sin]\n            Clone at X: [914] Y: [1003] speedx [0] widthx [0] speedy [-160] widthy [100] size [75] cos/sin [cos]\n        else\n            if <(LEVEL) = [4]> then\n                switch costume to (1 v)\n                Clone at X: [354] Y: [52] speedx [0] widthx [0] speedy [90] widthy [60] size [75] cos/sin [sin]\n                Clone at X: [546] Y: [130] speedx [200] widthx [100] speedy [0] widthy [0] size [75] cos/sin [sin]\n                Clone at X: [1427] Y: [707] speedx [0] widthx [0] speedy [250] widthy [80] size [85] cos/sin [sin]\n                Clone at X: [1514] Y: [707] speedx [0] widthx [0] speedy [250] widthy [-80] size [85] cos/sin [sin]\n                Clone at X: [2133] Y: [985] speedx [200] widthx [80] speedy [0] widthy [0] size [60] cos/sin [sin]\n                Clone at X: [1760] Y: [930] speedx [100] widthx [60] speedy [0] widthy [0] size [70] cos/sin [cos]\n                Clone at X: [1290] Y: [746] speedx [100] widthx [100] speedy [0] widthy [0] size [70] cos/sin [cos]\n                Clone at X: [1290] Y: [746] speedx [100] widthx [100] speedy [0] widthy [0] size [70] cos/sin [sin]\n            end\n        end\n    end\nend\nset [x v] to [-1000]\n\ndefine position (x) (y)\nset size to ((size) + (50)) %\ngo to x: (x) y: (y)\nset size to (size) %\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) speedx (speedx) widthx (widthx) speedy (speedy) widthy (widthy) size (size) cos/sin (cos/sin)\nset [x v] to (x)\nset [y v] to (y)\nset [speedx v] to (speedx)\nset [widthx v] to (widthx)\nset [speedy v] to (speedy)\nset [widthy v] to (widthy)\nset [size v] to (size)\nset [cos/sin v] to (cos/sin)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\ndelete this clone\n\nwhen [g v] key pressed\nreplace item (1) of [speed runs v] with [100]\nreplace item (2) of [speed runs v] with [100]\nreplace item (3) of [speed runs v] with [100]\nreplace item (4) of [speed runs v] with [100]\n\n@Portal\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLLX)) ((y) - (SCROLLY))\nset size to (round ((([sin v] of ((Time) * (100)) ) * (14)) + (100))) %\nif <<touching (player v)?> and <(costume [name v]) = [Open]>> then\n    set [exit v] to [win]\nend\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [collecting v] to [n/a]\nswitch costume to (closed v)\nif <(LEVEL) = [1]> then\n    Clone at X: [-173] Y: [207]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at X: [2600] Y: [460]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at X: [1010] Y: [1500]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at X: [450] Y: [712]\n            else\n                Clone at X: [800] Y: [50]\n            end\n        end\n    end\nend\n\ndefine position (x) (y)\nset size to (150) %\ngo to x: (x) y: (y)\nset size to (100) %\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]\nswitch costume to (open v)\n\nwhen flag clicked\nhide\n\nClone at X: [2500] Y: [1025] Float: [8]\n\n@Moving Platforms\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nposition (((x) - (SCROLLX)) + (last x)) ((y) - (SCROLLY))\nset [last speed v] to ((last x) - (round (([cos v] of (((Time) - (+glide)) * (speedx)) ) * (widthx))))\nreplace item (clone#) of [platform speeds v] with (last speed)\nif <(start glide) = [no]> then\n    if <((widthx) * (speedx)) = ([abs v] of ((widthx) * (speedx)) )> then\n        set [last x v] to ([abs v] of (widthx) )\n    else\n        set [last x v] to ((-1) * ([abs v] of (widthx) ))\n    end\n    set [+glide v] to (Time)\nelse\n    set [last x v] to (round (([cos v] of (((Time) - (+glide)) * (speedx)) ) * (widthx)))\nend\nchange y by (2)\nif <touching (player v)?> then\n    set [glidespeed v] to (item (clone#) of [platform speeds v])\n    set [start glide v] to [yes]\nend\nchange y by (-2)\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\nset [x v] to [0]\nset [y v] to [0]\nset [clone# v] to [0]\nswitch costume to (1 v)\nif <(LEVEL) = [1]> then\n    Clone at X: [572] Y: [-110] speedx [-75] widthx [75] size [2] wait for player? [no]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at X: [700] Y: [217] speedx [90] widthx [-110] size [2] wait for player? [yes]\n        Clone at X: [1800] Y: [217] speedx [75] widthx [-200] size [2] wait for player? [yes]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at X: [580] Y: [190] speedx [75] widthx [-230] size [2] wait for player? [yes]\n            Clone at X: [826] Y: [770] speedx [90] widthx [-200] size [2] wait for player? [yes]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at X: [350] Y: [-55] speedx [90] widthx [-200] size [2] wait for player? [yes]\n                Clone at X: [889] Y: [116] speedx [125] widthx [-150] size [1] wait for player? [yes]\n                Clone at X: [1760] Y: [911] speedx [100] widthx [100] size [3] wait for player? [no]\n                Clone at X: [763] Y: [581] speedx [100] widthx [150] size [2] wait for player? [yes]\n            end\n        end\n    end\nend\nset [x v] to [-1000]\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) speedx (speedx) widthx (widthx) size (size) wait for player? (wait for player?)\nset [x v] to (x)\nset [y v] to (y)\nset [speedx v] to (speedx)\nset [widthx v] to (widthx)\nset [speedy v] to (speedy)\nset [widthy v] to (widthy)\nif <(wait for player?) = [yes]> then\n    set [start glide v] to [no]\nelse\n    set [+glide v] to [0]\n    set [start glide v] to [yes]\nend\nchange [clone# v] by (1)\nadd [] to [platform speeds v]\nswitch costume to (size)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\n\ndelete this clone\n\n@Checkpoints\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nset [color v] effect to (0)\nif <(collecting) = [n/a]> then\n    position ((x) - (SCROLLX)) (((y) + (([sin v] of ((Time) * (200)) ) * (float))) - (SCROLLY))\n    if <<touching (player v)?> and <(already touched) = [no]>> then\n        start sound [500912__bertsz__squish-impact v]\n        set [already touched v] to [yes]\n        switch costume to (1 v)\n        replace item (1) of [playerstartingpos v] with (x)\n        replace item (2) of [playerstartingpos v] with (y)\n        explode\n    end\nelse\n    if <(collecting) > [0]> then\n        switch costume to (3 v)\n        change [collecting v] by (-1)\n        change [yv v] by (-1)\n        change [x v] by (xv)\n        change [y v] by (yv)\n        turn right (rotate) degrees\n        position ((x) - (SCROLLX)) ((y) - (SCROLLY))\n        set [ghost v] effect to ((100) - ((collecting) * (10)))\n    else\n        delete this clone\n    end\nend\n\nwhen I receive [setup v]\nhide\npoint in direction (90)\nhide\nset [float v] to [8]\nset [x v] to [0]\nset [y v] to [0]\nset [collecting v] to [n/a]\nset [already touched v] to [no]\nswitch costume to (2 v)\nif <(LEVEL) = [1]> then\nelse\n    if <(LEVEL) = [2]> then\n        Clone at X: [931] Y: [265] Float: [8]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at X: [1041] Y: [327] Float: [8]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at X: [2135] Y: [950] Float: [8]\n            end\n        end\n    end\nend\nset [x v] to [-1000]\n\nClone at X: [-155] Y: [527] Float: [8]\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) Float: (float)\nset [float v] to (float)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\ndefine explode\nset [y v] to ((y) + ())\nset [collecting v] to [15]\nrepeat (5)\n    set [xv v] to (pick random (0) to (6))\n    set [yv v] to (pick random (8) to (14))\n    set [rotate v] to (pick random (-10) to (10))\n    set size to (pick random (80) to (120)) %\n    create clone of (_myself_ v)\nend\nrepeat (5)\n    set [xv v] to (pick random (-6) to (0))\n    set [yv v] to (pick random (8) to (14))\n    set [rotate v] to (pick random (-10) to (10))\n    set size to (pick random (80) to (120)) %\n    create clone of (_myself_ v)\nend\nset size to (100) %\nset [collecting v] to [n/a]\n\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Clouds\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 (cloud-a v)\n    Clone at X: [400] Y: [250]\n    Clone at X: [40] Y: [100]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at X: [180] Y: [200]\n        Clone at X: [800] Y: [600]\n        Clone at X: [2000] Y: [520]\n    else\n        if <(LEVEL) = [3]> then\n            switch costume to (level 3 1 v)\n            Clone at X: [0] Y: [0]\n            Clone at X: [320] Y: [300]\n        end\n    end\nend\nset [x v] to [-9999]\n\nClone at X: [40] Y: [100]\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)\nset [ghost v] effect to (50)\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 [tick v]\nposition (round ((x) - ((SCROLLX) / (6)))) (round ((y) - ((SCROLLY) / (6))))\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen flag clicked\n\nhide\n\n@Coin Counter\n\nwhen I receive [setup v]\nsetup\n\ndefine setup\nset [digits v] to [0]\ngo to [front v] layer\nrepeat (6)\n    change [digits v] by (1)\n    create clone of (_myself_ v)\nend\nchange [digits v] by (1)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [tick v]\ngo to x: (((220) + ((digits) * (18))) - ((length of (join (COLLECTED) (join [/] (COLLECTED MAX)))) * (18))) y: (155)\nset size to (23) %\nif <(length of (join (COLLECTED) (join [/] (COLLECTED MAX)))) < (digits)> then\n    hide\nelse\n    show\n    switch costume to (letter (digits) of (join (COLLECTED) (join [/] (COLLECTED MAX))))\nend\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen I receive [space v]\ngo to [front v] layer\nshow\ngo to x: (0) y: (-100)\nswitch costume to (Show Text)\nset [showing v] to [45]\nset [ghost v] effect to (0)\n\nwhen I receive [tick v]\nif <<(showing) > [0]> and <(showing) < [21]>> then\n    change [ghost v] effect by (5)\nend\nif <(showing) > [0]> then\n    change [showing v] by (-1)\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\n@Tramp\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nset [color v] effect to (0)\nif <(collecting) = [n/a]> then\n    set size to (200) %\n    position ((x) - (SCROLLX)) ((y) - (SCROLLY))\n    set size to (80) %\n    switch costume to (1 v)\n    if <<touching (player v)?> and <(already touched) = [no]>> then\n        set [tramp - player v] to [4]\n        set [already touched v] to [yes]\n        set [speed x v] to (xv)\n        set [speed y v] to (yv)\n        set [collecting v] to [4]\n    end\nelse\n    if <(collecting) > [0]> then\n        next costume\n        change [collecting v] by (-1)\n        set size to (200) %\n        position ((x) - (SCROLLX)) ((y) - (SCROLLY))\n        set size to (80) %\n    else\n        set [collecting v] to [n/a]\n        set [already touched v] to [no]\n    end\nend\n\nwhen I receive [setup v]\nhide\nset [float v] to [8]\nset [x v] to [0]\nset [y v] to [0]\nset [collecting v] to [n/a]\nset [already touched v] to [no]\nswitch costume to (1 v)\nif <(LEVEL) = [1]> then\n    Clone at X: [1209] Y: [-96] sx [-14] sy [30] direction [90]\nelse\n    if <(LEVEL) = [2]> then\n        Clone at X: [2619] Y: [237] sx [0] sy [20] direction [90]\n        Clone at X: [847] Y: [-148] sx [0] sy [30] direction [90]\n    else\n        if <(LEVEL) = [3]> then\n            Clone at X: [1116] Y: [1138] sx [-11] sy [28] direction [90]\n            Clone at X: [904] Y: [1138] sx [11] sy [28] direction [90]\n        else\n            if <(LEVEL) = [4]> then\n                Clone at X: [1471] Y: [541] sx [0] sy [22] direction [90]\n            end\n        end\n    end\nend\nset [x v] to [-1000]\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) sx (sx) sy (sy) direction (dir)\nset [xv v] to (sx)\nset [yv v] to (sy)\nset [x v] to (x)\nset [y v] to (y)\npoint in direction (dir)\ncreate clone of (_myself_ v)\n\ndefine explode\n\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Enemies\n\ndefine Tick\nif <(wait) < [1]> then\n    if <(clone type) = [enemy]> then\n        if <(x position) > ([x position v] of [player v])> then\n            change [sx v] by (-.5)\n        end\n        if <([x position v] of [player v]) > (x position)> then\n            change [sx v] by (.5)\n        end\n    end\n    set [sx v] to ((sx) * (.9))\n    if <touching (moving platforms v)?> then\n        get out of moving platforms\n    end\n    if <([abs v] of (sx) ) > [1]> then\n        Change Player X by (round (sx))\n    end\n    if <([y position v] of [player v]) > (y position)> then\n        if <(in air) < [3]> then\n            set [sy v] to [11]\n        end\n    end\n    if <(sy) > [-19]> then\n        change [sy v] by (-1)\n    end\n    Change Player Y by (sy)\n    if <(clone type) = [enemy]> then\n        if <[1] > (hurt)> then\n            test - die\n            switch costume to (costume1 v)\n        else\n            change [hurt v] by (-1)\n            switch costume to (costume4 v)\n        end\n        if <(y) < [-180]> then\n            replace item (enemy#) of [enemies v] with [dead]\n            delete this clone\n        end\n        if <<(health) < [0]> and <(health) > [0]>> then\n    else\n        change [hurt v] by (-1)\n        if <(hurt) < [1]> then\n            delete this clone\n        end\n        change [ghost v] effect by (4)\n        switch costume to (costume3 v)\n    end\n    if <touching (player v)?> then\n        add (item (enemy#) of [enemies v]) to [enemydanger v]\n    end\nelse\n    change [wait v] by (-1)\nend\nposition\n\nwhen I receive [ green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [setup v]\npoint in direction (90)\nswitch costume to (costume1 v)\nshow\ndelete all of [enemydanger v]\ndelete all of [enemies v]\nset [enemy# v] to [0]\nset [sy v] to [0]\nset [sx v] to [0]\nset [clone type v] to [enemy]\nif <(LEVEL) = [1]> then\n    Enemy at x: [867] y: [-73] health: [1]\n    Enemy at x: [960] y: [-73] health: [1]\nelse\n    if <(LEVEL) = [2]> then\n        Enemy at x: [670] y: [-9] health: [1]\n        Enemy at x: [760] y: [-9] health: [2]\n        Enemy at x: [850] y: [-9] health: [2]\n    else\n        if <(LEVEL) = [3]> then\n            Enemy at x: [183] y: [220] health: [2]\n            Enemy at x: [1085] y: [312] health: [1]\n            Enemy at x: [850] y: [681] health: [4]\n            Enemy at x: [542] y: [650] health: [2]\n        else\n            if <(LEVEL) = [4]> then\n                Enemy at x: [1187] y: [397] health: [1]\n                Enemy at x: [1308] y: [475] health: [1]\n                Enemy at x: [2066] y: [954] health: [1]\n                Enemy at x: [1476] y: [845] health: [2]\n                Enemy at x: [875] y: [615] health: [1]\n                Enemy at x: [946] y: [615] health: [1]\n            end\n        end\n    end\nend\nset [x v] to [-999]\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)?> or <touching (moving 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) - (SCROLLX)) y: ((y) - (SCROLLY))\n\ndefine Change Player X by (sx)\nchange [x v] by (sx)\nposition\nif <<touching (platforms v)?> or <touching (moving platforms v)?>> then\n    repeat (10)\n        change [y v] by (1)\n        position\n        if <not <<touching (platforms v)?> or <touching (moving platforms v)?>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-10)\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (15))>>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-10]\n        else\n            set [sx v] to [10]\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)?> or <touching (moving 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 test - die\nif <<touching (saws v)?> or <<touching (sprite5 v)?> or <touching (danger v)?>>> then\n    change [health v] by (-1)\n    start sound [547035__eponn__hit-impact-sword v]\n    if <(health) < [1]> then\n        Explode\n        replace item (enemy#) of [enemies v] with [dead]\n        delete this clone\n    else\n        set [hurt v] to [6]\n        set [sy v] to [8]\n        if <([x position v] of [player v]) > (x position)> then\n            set [sx v] to [-17]\n        else\n            set [sx v] to [17]\n        end\n    end\nend\n\ndefine get out of moving platforms\nrepeat (10)\n    change [x v] by (2)\n    position\n    if <not <touching (moving platforms v)?>> then\n        stop [this script v]\n    end\nend\nchange [x v] by (-20)\nrepeat until <not <touching (moving platforms v)?>>\n    change [x v] by (-2)\n    position\nend\n\nwhen I receive [tick v]\nchange [y v] by (sy)\nchange [x v] by (sx)\nposition\nset [is visible v] to <<((x) - (SCROLLX)) = (x position)> and <((y) - (SCROLLY)) = (y position)>>\nchange [y v] by ((sy) * (-1))\nchange [x v] by ((sx) * (-1))\n\nchange [y v] by (SPEED Y)\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Enemy at x: (x) y: (y) health: (health)\nset [hurt v] to [0]\nset [health v] to (health)\nset [x v] to (x)\nset [y v] to (y)\nchange [enemy# v] by (1)\nadd [alive] to [enemies v]\nset [is visible v] to [true]\ncreate clone of (_myself_ v)\n\nwhen I receive [move enemies v]\nif <(is visible) = [true]> then\n    show\n    Tick\nelse\n    hide\nend\n\ndefine Explode\nset [clone type v] to [animation]\nrepeat (8)\n    set [in air v] to [200]\n    set [sy v] to (pick random (5) to (12))\n    set [sx v] to (pick random (-18) to (18))\n    set [hurt v] to [20]\n    create clone of (_myself_ v)\nend\nset [clone type v] to [enemy]\n\nstart sound [446115__justinvoke__wet-splat v]\n\n@Sprite5\n\nwhen I receive [attack v]\nset [weaponused v] to (WeaponType)\nset [sword swinging v] to [14]\nset size to (100) %\nset [ghost v] effect to (0)\ngo to [back v] layer\nshow\nset [direction v] to ([direction v] of [player v])\nstart sound [380488__deleted-user-6479820__sword-swipes v]\nif <([direction v] of [player v]) = [90]> then\n    switch costume to (costume1 v)\n    point in direction (-75)\nelse\n    switch costume to (costume2 v)\n    point in direction (75)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\ngo to (player v)\nif <(Sword swinging) > [6]> then\n    change [sword swinging v] by (-1)\n    if <(direction) = [90]> then\n        turn right (22) degrees\n    else\n        turn right (-22) degrees\n    end\nelse\n    if <(Sword swinging) > [0]> then\n        hide\n    else\n        set [attacking v] to [no]\n        set [sword swinging v] to [0]\n    end\n    change [sword swinging v] by (-1)\nend\n\nwhen I receive [death v]\nhide\n\n@Time\n\ndefine Setup\nset [digits v] to [0]\nrepeat (10)\n    go to [front v] layer\n    change [digits v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [ green flag v]\nhide\nset [spacing v] to [18]\nset [originalsprite v] to [no]\nSetup\nset [originalsprite v] to [yes]\n\nwhen I receive [tick v]\nif <(originalsprite) = [yes]> then\n    set [real time v] to (([floor v] of (((Time) - (START TIME)) * (100)) ) / (100))\n    set [showtimer v] to []\n    if <([floor v] of ((REAL TIME) / (60)) ) > [0]> then\n        set [showtimer v] to (join ([floor v] of ((REAL TIME) / (60)) ) [:])\n        if <(length of (([floor v] of (REAL TIME) ) mod (60))) < [2]> then\n            set [showtimer v] to (join (ShowTimer) (join [0] ([floor v] of ((REAL TIME) mod (60)) )))\n        else\n            set [showtimer v] to (join (ShowTimer) ([floor v] of ((REAL TIME) mod (60)) ))\n        end\n    else\n        set [showtimer v] to ([floor v] of (REAL TIME) )\n    end\n    Take away the zero ((REAL TIME) - ([floor v] of (REAL TIME) ))\n    change [time v] by (.03333)\nend\nif <(originalsprite) = [no]> then\n    set [color v] effect to (80)\n    set size to (23) %\n    go to x: (((digits) * (spacing)) - (230)) y: (155)\n    if <(digits) > (length of (ShowTimer))> then\n        hide\n    else\n        show\n        switch costume to (letter (digits) of (ShowTimer))\n    end\nend\n\ndefine Take away the zero (decimal)\nset [showtimer v] to (join (ShowTimer) (join (letter (2) of (decimal)) (join (letter (3) of (decimal)) (letter (4) of (decimal)))))\n\n@Teleports\n\nwhen I receive [ green flag v]\nhide\n\nwhen I receive [tick v]\nset [color v] effect to (0)\nposition (((x) + (([sin v] of ((timer) * (200)) ) * (float))) - (SCROLLX)) ((y) - (SCROLLY))\nif <(collecting) = [n/a]> then\n    if <touching (player v)?> then\n        start sound [220193__gameaudio__teleport-spacey v]\n        set [teleport x v] to (pair x)\n        set [teleport y v] to (pair y)\n        set [teleporting v] to [20]\n        add (x) to [teleport pos v]\n        add (y) to [teleport pos v]\n        broadcast (Teleport v)\n        set [collecting v] to [20]\n    end\nelse\n    if <(collecting) > [10]> then\n        change [collecting v] by (-1)\n        change [brightness v] effect by (10)\n    else\n        if <(collecting) > [0]> then\n            change [collecting v] by (-1)\n            change [brightness v] effect by (-10)\n        else\n            set [brightness v] effect to (0)\n            if <not <touching (player v)?>> then\n                set [collecting v] to [n/a]\n            end\n        end\n    end\nend\n\nexplode\n\nswitch costume to (3 v)\nchange [collecting v] by (-1)\nchange [yv v] by (-1)\nchange [x v] by (xv)\nchange [y v] by (yv)\nturn right (rotate) degrees\nset [ghost v] effect to ((100) - ((collecting) * (10)))\n\nwhen I receive [setup v]\nhide\npoint in direction (90)\nhide\nset [float v] to [8]\nset [x v] to [0]\nset [y v] to [0]\nset [collecting v] to [n/a]\nset [already touched v] to [no]\nswitch costume to (2 v)\nif <(LEVEL) = [1]> then\n    Pair at x1: [1063] y1: [348] x2: [298] y2: [270] Float: [2]\nelse\n    if <(LEVEL) = [2]> then\n        Pair at x1: [-236] y1: [216] x2: [590] y2: [270] Float: [2]\n    else\n        if <(LEVEL) = [4]> then\n            Pair at x1: [1035] y1: [160] x2: [1035] y2: [400] Float: [2]\n            Pair at x1: [1474] y1: [767] x2: [2300] y2: [900] Float: [2]\n        end\n    end\nend\nset [x v] to [-1000]\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 Pair at x1: (x1) y1: (y1) x2: (x2) y2: (y2) Float: (float)\nset [float v] to (float)\nset [x v] to (x1)\nset [y v] to (y1)\nset [pair x v] to (x2)\nset [pair y v] to (y2)\ncreate clone of (_myself_ v)\nset [x v] to (x2)\nset [y v] to (y2)\nset [pair x v] to (x1)\nset [pair y v] to (y1)\ncreate clone of (_myself_ v)\n\ndefine explode\nset [y v] to ((y) + ())\nset [collecting v] to [15]\nrepeat (5)\n    set [xv v] to (pick random (0) to (6))\n    set [yv v] to (pick random (8) to (14))\n    set [rotate v] to (pick random (-10) to (10))\n    set size to (pick random (80) to (120)) %\n    create clone of (_myself_ v)\nend\nrepeat (5)\n    set [xv v] to (pick random (-6) to (0))\n    set [yv v] to (pick random (8) to (14))\n    set [rotate v] to (pick random (-10) to (10))\n    set size to (pick random (80) to (120)) %\n    create clone of (_myself_ v)\nend\nset size to (100) %\nset [collecting v] to [n/a]\n\ndelete this clone\n\nwhen flag clicked\nhide\n\nset [☁ p1 v] to [0]\n\nwhen I receive [teleport v]\nif <<(x) = (TELEPORT X)> and <(y) = (TELEPORT Y)>> then\n    set [collecting v] to [20]\nend\n\n@Front Screen\n\nwhen flag clicked\ngo to [back v] layer\nshow\nswitch costume to (bg v)\ngo to x: (0) y: (0)\nset [startstate v] to [front]\nQuick Stuff\nSetup\n\ndefine Setup\nset [clone type v] to [button]\nset [button type v] to [info]\ncreate clone of (_myself_ v)\nset [button type v] to [play]\ncreate clone of (_myself_ v)\nset [button type v] to [speed runs]\ncreate clone of (_myself_ v)\nset [button type v] to [back]\ncreate clone of (_myself_ v)\nset [button type v] to [screen]\n\nwhen I start as a clone\nif <(clone type) = [button]> then\n    switch costume to (button type)\n    go to [front v] layer\n    hide\n    set [first... v] to [6]\n    forever\n        if <(first...) > [0]> then\n            change [first... v] by (-1)\n        else\n            clicked\n        end\n        if <(StartState) = [front]> then\n            show\n        end\n        if <(button type) = [play]> then\n            go to x: (-120) y: (-10)\n            if <(button clicked?) = [yes]> then\n                set [startstate v] to [play]\n                setup - level select\n                broadcast (play v) and wait\n            end\n        else\n            if <(button type) = [info]> then\n                go to x: (120) y: (-10)\n                if <(button clicked?) = [yes]> then\n                    set [clone type v] to [hover]\n                    create clone of (_myself_ v)\n                    set [clone type v] to [button]\n                    broadcast (info v) and wait\n                end\n            else\n                if <(button type) = [speed runs]> then\n                    go to x: (0) y: (-110)\n                    if <(button clicked?) = [yes]> then\n                        setup - highscores\n                        broadcast (speed runs v) and wait\n                    end\n                else\n                    if <(button type) = [back]> then\n                        go to x: (208) y: (152)\n                        if <(StartState) = [front]> then\n                            hide\n                        end\n                    else\n                        if <(button type) = [right]> then\n                            go to x: (180) y: (0)\n                            if <(StartState) = [play]> then\n                                show\n                            end\n                            if <(just pressed) < [1]> then\n                                if <(button clicked?) = [yes]> then\n                                    if <((Levels) - (1)) > (Level Select +)> then\n                                        change [level select + v] by (1)\n                                        set [just pressed v] to [6]\n                                    end\n                                end\n                            else\n                                change [just pressed v] by (-1)\n                            end\n                        else\n                            if <(button type) = [left]> then\n                                go to x: (-180) y: (0)\n                                if <(StartState) = [play]> then\n                                    show\n                                end\n                                if <(just pressed) < [1]> then\n                                    if <(button clicked?) = [yes]> then\n                                        if <(Level Select +) > [0]> then\n                                            change [level select + v] by (-1)\n                                            set [just pressed v] to [6]\n                                        end\n                                    end\n                                else\n                                    change [just pressed v] by (-1)\n                                end\n                            else\n                                if <(button type) = [level]> then\n                                    switch costume to (button type)\n                                    switch costume to ((costume [number v]) + (Level Select +))\n                                    go to x: (0) y: (0)\n                                    if <(StartState) = [play]> then\n                                        show\n                                    end\n                                    if <(button clicked?) = [yes]> then\n                                        set [level v] to ((Level Select +) + (1))\n                                        set [my player # v] to [0]\n                                        set [max players v] to [8]\n                                        broadcast (begin v)\n                                        broadcast ( Green Flag v) and wait\n                                        broadcast (setup - opponents v) and wait\n                                        switch backdrop to (joining v)\n                                        broadcast (join game v) and wait\n                                        if <(MY PLAYER #) > [0]> then\n                                            switch backdrop to (joined v)\n                                        else\n                                            switch backdrop to (full v)\n                                        end\n                                        wait (1) seconds\n                                        switch backdrop to (game v)\n                                        broadcast (Play Game v)\n                                        delete this clone\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nelse\n    if <(clone type) = [letters]> then\n        forever\n            set [brightness v] effect to (0)\n            go to x: (((digits) * (13)) + (-105)) y: (((letter level #) * (-50)) + (130))\n            set [value thing v] to (join (item (letter level #) of [speed run names v]) (join [: ] (item (letter level #) of [speed runs v])))\n            switch costume to (z v)\n            if <(length of (value thing)) < (digits)> then\n                hide\n            else\n                show\n                switch costume to (letter (digits) of (value thing))\n            end\n        end\n    else\n        forever\n            set size to (100) %\n            switch costume to (hover v)\n            go to x: (240) y: (0)\n            wait until <touching (mouse-pointer v)?>\n            go to [front v] layer\n            repeat (6)\n                change x by (-40)\n            end\n            go to x: (0) y: (0)\n            wait until <not <touching (mouse-pointer v)?>>\n            repeat (6)\n                change x by (40)\n            end\n        end\n    end\nend\n\ndefine clicked\nif <<(StartState) = [front]> or <<<<(button type) = [back]> or <(button type) = [right]>> or <(button type) = [left]>> or <(button type) = [level]>>> then\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-5)\n        set [button clicked? v] to [no]\n        if <mouse down?> then\n            set [button clicked? v] to [yes]\n        end\n    else\n        set [brightness v] effect to (0)\n        set [button clicked? v] to [no]\n    end\nend\n\nwhen I receive [info v]\nhide\nif <(button type) = [screen]> then\n    show\n    switch costume to (bg2 v)\nend\nif <(button type) = [back]> then\n    show\n    set [startstate v] to [info]\n    wait until <(button clicked?) = [yes]>\n    set [startstate v] to [front]\n    broadcast (back to start v)\n    hide\nend\nif <(clone type) = [hover]> then\n    show\n    wait until <(StartState) = [front]>\n    delete this clone\nend\n\nwhen I start as a clone\nif <(clone type) = [button]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            repeat (5)\n                change size by (2)\n            end\n            wait until <not <touching (mouse-pointer v)?>>\n            repeat (5)\n                change size by (-2)\n            end\n        end\n    end\nend\n\nwhen I receive [back to start v]\nif <(button type) = [screen]> then\n    switch costume to (bg v)\n    show\nend\nif <<<(clone type) = [letters]> or <<(button type) = [right]> or <<(button type) = [left]> or <(button type) = [level]>>>> or <(clone type) = [number]>> then\n    delete this clone\nend\n\nwhen I receive [speed runs v]\nhide\nif <(button type) = [screen]> then\n    show\n    switch costume to (bg3 v)\nend\nif <(button type) = [back]> then\n    show\n    set [startstate v] to [speed runs]\n    wait until <(button clicked?) = [yes]>\n    set [startstate v] to [front]\n    broadcast (back to start v)\n    hide\nend\n\nwhen I receive [play v]\nset [level select + v] to [0]\nshow\nif <(button type) = [back]> then\n    wait until <(button clicked?) = [yes]>\n    set [startstate v] to [front]\n    broadcast (back to start v)\nend\nhide\nif <(button type) = [screen]> then\n    show\n    switch costume to (bg5 v)\nend\n\ndefine setup - highscores\nset [clone type v] to [letters]\nset [letter level # v] to [1]\nrepeat (Levels)\n    set [digits v] to [1]\n    repeat (length of (join (item (letter level #) of [speed run names v]) (join [: ] (item (letter level #) of [speed runs v]))))\n        create clone of (_myself_ v)\n        change [digits v] by (1)\n    end\n    change [letter level # v] by (1)\nend\nset [clone type v] to [button]\n\ndefine setup - level select\nshow\ngo to [back v] layer\nset [button clicked? v] to [no]\nset [clone type v] to [button]\nset [button type v] to [right]\ncreate clone of (_myself_ v)\nset [button type v] to [left]\ncreate clone of (_myself_ v)\nset [button type v] to [level]\ncreate clone of (_myself_ v)\ngo to [front v] layer\nhide\nset [button clicked? v] to [yes]\nset [button type v] to [play]\n\nwhen I receive [begin v]\nhide\nif <not <(button type) = [level]>> then\n    delete this clone\nend\n\ndefine Fix Nums for Cloud\nset [i v] to [0]\nrepeat (Levels)\n    change [i v] by (1)\n    replace item (i) of [player nums v] with [0]\nend\n\ndefine Quick Stuff\nrepeat (Levels)\n    add [0] to [player nums v]\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nshow\ngo to [back v] layer\ngo to x: ((SCROLLX) / (-6)) y: ((SCROLLY) / (-6))\n\n
~~~~~~~~~~~~~~~~~~INTRO~~~~~~~~~~~~~~~~~~\nRocky Terrain || etc. has saws, moving platforms, checkpoints, coins, trampolines, teleports, enemies, a sword, world records, and 27 cloud chats. Quick heads up—THIS GAME IS HARD!\n~~~~~~~~~~~~~~~~CONTROLS~~~~~~~~~~~~~~~~\nQ+R - Restarts the level.\nQ+O - Skips the level.\nQ+P - Goes back a level.\nThe rest of the instructions are in the game. Collect all of the coins to open the portal and touch checkpoints to save your progress. If you see me playing, comment down below!\n~~~~~~~~~~~~~~~~HEADS UP~~~~~~~~~~~~~~~~\nUnfortunately, because everyone's timer starts when they click the flag, it may appear as though people are floating when they are on their moving platforms.\n~~~~~~~~~~~~~~~~CHATTING~~~~~~~~~~~~~~~~~\n0 to open up the chat help, although you can chat when it's closed as well. Press nine to turn off usernames. Nine again to turn of chats as well. Nine again to turn it all back on.\n~~~~~~~GETTING TIRED OF THE MUSIC??~~~~~~~\nIf you want to actually stop the project, hit stop super fast twice.