Twilight - A Scrolling Platformer 
@Stage\n\nwhen [m v] key pressed\nhide variable [mouse v]\n\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\nshow variable [mouse v]\n\nwhen I receive [green flag v]\nswitch backdrop to (best one v)\n\nwhen flag clicked\nswitch backdrop to (best one v)\n\nwhen I receive [green flag v]\nhide variable [collected v]\nswitch backdrop to (best one v)\n\n@Blank\n\n@Splash1\n\nset [level v] to [77]\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\n\nwhen I receive [game won v]\nshow\ngo to [front v] layer\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\nset [playing? v] to [0]\nset [mouse touching? v] to [0]\nbroadcast (green flag v) and wait\nbroadcast (play game v)\ngo to [front v] layer\nscroll in\nrepeat until <(playing?) = [1]>\n    point in direction ((([sin v] of ((timer) * (250)) ) * (5)) + (90))\n    if <touching (mouse-pointer v)?> then\n        set [mouse touching? v] to [1]\n        set [brightness v] effect to (10)\n        set size to (195) %\n    else\n        set [mouse touching? v] to [0]\n        set [brightness v] effect to (0)\n        set size to (175) %\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        wait until <not <mouse down?>>\n        if <touching (mouse-pointer v)?> then\n            set [level v] to [1]\n            broadcast (Level Chosen v)\n            set [playing? v] to [1]\n        end\n    end\nend\n\nset [brightness v] effect to (10)\nset size to (110) %\n\nhide\n\ndefine scroll in\nhide\nswitch costume to (play v)\nwait (.1) seconds\ngo to x: (0) y: (-200)\nshow\nrepeat (11)\n    change y by (((-130) - (y position)) / (4))\nend\ngo to x: (0) y: (-130)\nclear graphic effects\nset [brightness v] effect to (0)\n\n\n\nif <(playing?) = [0]> then\n    broadcast (menu animate v)\nend\n\nif <(playing?) = [0]> then\n    broadcast (menu animate v)\nelse\n    broadcast (animate v)\nend\n\nwhen flag clicked\n\n    if <(playing?) = [0]> then\n        broadcast (menu animate v)\n    else\n        broadcast (animate v)\n    end\nend\n\nforever\nend\n\nwhen flag clicked\n\n@Splash2\n\nwhen flag clicked\nhide\n\nbroadcast (green flag v) and wait\nbroadcast (play game v)\ngo to [front v] layer\nshow\nset [level v] to [77]\nswitch costume to (2 v)\ngo to x: (0) y: (-50)\n\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        set size to (110) %\n    else\n        set [brightness v] effect to (0)\n        set size to (100) %\n    end\nend\n\nwhen I receive [green flag v]\n\ngo to [front v] layer\nshow\n\nwhen I receive [game won v]\n\nshow\ngo to [front v] layer\n\nwhen I receive [level chosen v]\nhide\n\n@Splash\n\nwhen I start as a clone\n\ngo to [front v] layer\nshow\nforever\n    repeat until <touching (mouse-pointer v)?>\n        wait (0) seconds\n    end\n    set [brightness v] effect to (10)\n    set size to (110) %\n    repeat until <not <touching (mouse-pointer v)?>>\n        if <mouse down?> then\n            set [level v] to (id)\n            broadcast (Level Chosen v)\n        end\n        wait (0) seconds\n    end\n    set [brightness v] effect to (0)\n    set size to (100) %\nend\n\ndefine Clone Button (id) x: (x)\n\nset [id v] to (id)\nswitch costume to (id)\ngo to x: (x) y: (-137)\ncreate clone of (_myself_ v)\n\ndefine Clone Buttons\n\ngo to [back v] layer\nshow\nset [level v] to [77]\n\nwhen flag clicked\n\nShow Buttons [Splash]\ngo to x: (0) y: (0)\n\ndefine Show Buttons (splash costume)\n\nClone Buttons\ngo to x: (0) y: (0)\nset [id v] to [0]\nswitch costume to (splash costume)\nrepeat until <[77] > (LEVEL)>\n    wait (0) seconds\nend\nhide\n\nwhen I receive [level chosen v]\n\ndelete this clone\n\nwhen I receive [game won v]\n\nShow Buttons (costume [name v])\n\nwhen I receive [back v]\n\nShow Buttons (costume [name v])\nbroadcast (back player v)\n\n@Player\n\nwhen flag clicked\nhide variable [time v]\n\nwhen I receive [green flag v]\nset [omg you just won v] to [1]\nhide\ngo [forward v] (10) layers\n\nwhen I receive [level chosen v]\nset [exit v] to []\nset [y v] to [14]\nset [x v] to [0]\nrepeat until <(EXIT) = [win]>\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    reset timer\n    repeat until <(EXIT) > []>\n        set [sy of player v] to (sy)\n        set [time v] to ((round ((timer) * (10))) / (10))\n        Tick\n        broadcast (Tick v)\n        broadcast (pre-tick v)\n        if <key (r v) pressed?> then\n            set [exit v] to [die]\n        end\n        if <(Lag?) = [1]> then\n        end\n    end\n    if <(EXIT) = [Win]> then\n        Game-Win\n    else\n        Game-Die\n        broadcast (count down scroll v)\n    end\nend\n\nwait (0) seconds\n\ndefine Game On\nset [y v] to (player spawn y)\nset [x v] to (player spawn x)\nset [sy v] to [0]\nset [sx v] to [0]\nset [in air v] to [5]\nset [exit v] to []\nset size to (50) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    if <not <<touching (sliding hitbox platforms v)?> and <<key (down arrow v) pressed?> or >>> then\n        if <touching (platforms2 v)?> then\n            change [sx v] by (-1)\n        else\n            change [sx v] by (-2)\n        end\n    end\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    if <not <<touching (sliding hitbox platforms v)?> and <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n        if <touching (platforms2 v)?> then\n            change [sx v] by (1)\n        else\n            change [sx v] by (2)\n        end\n    end\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<key (up arrow v) pressed?> or <<key (space v) pressed?> or <key (w v) pressed?>>> then\n    if <touching (platforms2 v)?> then\n        if <(up) = [0]> then\n            set [sy v] to [5]\n            broadcast (up v)\n        end\n    else\n        if <(in air) < [4]> then\n            if <<(last touched) = [0]> or <(last touched) = [2]>> then\n                set [sy v] to [16]\n            end\n        end\n    end\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    if <(last touched) = [2]> then\n        Change Player y by [-2]\n    end\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    if <touching (sliding hitbox platforms v)?> then\n        change [sx v] by (3)\n        set [sx v] to ((sx) * (0.8))\n        if <([abs v] of (sx) ) > [0.9]> then\n            Change Player x by (round (sx))\n        end\n        if <not <touching (trampoline hitbox v)?>> then\n            Change Player y by [-100]\n        end\n    end\nend\nif <touching (platforms2 v)?> then\n    change [sy v] by (-0.2)\n    if <(sy) < [-3]> then\n        set [sy v] to [-3]\n    end\nelse\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]\nend\n\nchange [scroll x v] by (round (((x) - (SCROLL X)) / (5)))\nif <(x position) < [-220]> then\n    hide\nelse\n    show\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nif <touching (platforms v)?> then\n    set [last touched v] to [0]\nelse\n    if <touching (trampoline v)?> then\n        set [last touched v] to [1]\n    else\n        if <touching (drop through platforms v)?> then\n            set [last touched v] to [2]\n        end\n    end\nend\nif <not <<(last touched) = [2]> and <<key (down arrow v) pressed?> or <key (s v) pressed?>>>> then\n    if <touching (drop through platforms v)?> then\n        repeat until <not <<touching (platforms v)?> or <touching (drop through platforms v)?>>>\n            if <<(sy) > [0]> and <touching (drop through platforms v)?>> then\n                stop [this script v]\n            end\n            if <(sy) > [0]> then\n                if <not <touching (platforms v)?>> then\n                    change [y v] by (1)\n                else\n                    change [y v] by (-1)\n                end\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]\n        end\n    else\n        repeat until <not <touching (platforms v)?>>\n            if <<(sy) > [0]> and <touching (drop through platforms v)?>> then\n                stop [this script v]\n            end\n            if <(sy) > [0]> then\n                if <<not <touching (drop through platforms v)?>> or <touching (platforms v)?>> then\n                    change [y v] by (-1)\n                end\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]\n        end\n    end\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nif <not <touching (drop through platforms v)?>> then\n    change [x v] by (sx)\n    Position\n    if <not <<touching (platforms v)?> or <touching (drop through platforms v)?>>> then\n        set [moving? v] to [1]\n    end\n    if <<touching (platforms v)?> or <touching (drop through platforms v)?>> then\n        repeat (11)\n            change [y v] by (1)\n            Position\n            if <not <<touching (platforms v)?> or <touching (drop through platforms v)?>>> then\n                set [moving? v] to [1]\n                stop [this script v]\n            end\n        end\n        change [y v] by (-11)\n        set [moving? v] to [0]\n        repeat until <not <<touching (platforms v)?> or <touching (drop through 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\n    end\nend\n\ndefine Game-Die\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\nbroadcast (Die v)\n\ndefine Test-Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\n    broadcast (Die v)\nend\n\ndefine Game-Win\nset [sx v] to [0]\nset [omg you just won v] to [1]\nrepeat until <touching (_edge_ v)?>\n    change [sx v] by (1)\n    if <(sx) > [15]> then\n        set [sx v] to [15]\n    end\n    change x by (sx)\nend\nhide\nwait (.5) seconds\nbroadcast (Close Portal v)\nbroadcast (Yay! v)\n\nmove (10) steps\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [level 77 v]\ngo to [back v] layer\nhide\n\nwhen I receive [level chosen v]\ngo to x: (0) y: (14)\nshow\nrepeat until \n    set [y of player v] to (y)\n    set [x of player v] to (x)\n    set [sy player v] to (sx)\n    if <touching (trampoline hitbox v)?> then\n        set [sy v] to [35]\n        set [last touched v] to [1]\n        broadcast (Bounce v)\n    end\n    if <(sy) < [-16]> then\n        set [sy v] to [-16]\n    end\nend\n\nwhen [l v] key pressed\nif <(Lag?) = [1]> then\n    set [lag? v] to [0]\nelse\n    if <(Lag?) = [0]> then\n        set [lag? v] to [1]\n    end\nend\nwait (.5) seconds\n\nwhen I receive [up v]\nset [up v] to [1]\nwait (1) seconds\nset [up v] to [0]\n\nwhen I receive [green flag v]\nset [up v] to [0]\n\ndefine Position (x) (y)\n\nswitch costume to (costume9 v)\nset [ghost v] effect to (10)\nrepeat (10)\n    if <<touching (platforms v)?> or <touching (drop through platforms v)?>> then\n        delete this clone\n    end\n    change size by (-1)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I receive [count down scroll v]\nset [exit v] to [1]\nwait (1) seconds\nset [exit v] to [0]\n\nwhen I receive [level chosen v]\npoint in direction (-90)\nrepeat until <(EXIT) = [win]>\n    if <(EXIT) = []> then\n        if <key (r v) pressed?> then\n            Game-Die\n            broadcast (count down scroll v)\n            set [exit v] to []\n            Position\n            set [y v] to (player spawn y)\n            set [x v] to (player spawn x)\n            set [scroll x v] to (x)\n            set [scroll y v] to (y)\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <<(sx) > [.5]> and <(sy) > [.5]>> then\n    switch costume to (costume8 v)\nend\n\n\n\n\n    switch costume to (costume2 v)\nelse\n    if <(sx) < [-1]> then\n        switch costume to (costume3 v)\n    else\n        switch costume to (costume4 v)\n    end\nend\n\n\n    switch costume to (costume3 v)\nelse\n    switch costume to (costume4 v)\nend\n\nwhen I receive [tick v]\nif <<(sx) < [-.5]> and <(sy) > [.5]>> then\n    switch costume to (costume7 v)\nend\n\nwhen I receive [tick v]\nif <<<[-.5] < (sx)> and <(sx) < [.5]>> and <<[-.5] < (sy)> and <(sy) < [.5]>>> then\n    switch costume to (costume4 v)\nend\n\nwhen I receive [tick v]\nif <<<[-.5] < (sx)> and <(sx) < [.5]>> and <[.5] < (sy)>> then\n    switch costume to (costume5 v)\nend\n\nwhen I receive [tick v]\nif <<(sx) < [-.5]> and <[.5] > (sy)>> then\n    switch costume to (costume3 v)\nend\n\nwhen I receive [tick v]\nif <<[.5] < (sx)> and <[.5] > (sy)>> then\n    switch costume to (costume2 v)\nend\n\n@Platforms\n\nwhen I receive [level beat v]\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nClone at x: [0] y: [0]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [570] y: [10]\n    Clone at x: [570] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [740] y: [0]\n    Clone at x: [300] y: [505]\n    Clone at x: [220] y: [-505]\n    Clone at x: [474] y: [-105]\n    Clone at x: [700] y: [60]\n    Clone at x: [630] y: [300]\n    Clone at x: [850] y: [40]\n    Clone at x: [360] y: [-40]\n    Clone at x: [463] y: [-193]\n    Clone at x: [670] y: [20]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [540] y: [0]\n        Clone at x: [230] y: [-50]\n        Clone at x: [470] y: [0]\n        Clone at x: [400] y: [0]\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@Danger\n\nwhen I receive [game won v]\ngo to [back v] layer\nhide\n\nClone at x: [6342] y: [135]\nClone at x: [6540] y: [12]\nClone at x: [6722] y: [-63]\n\nClone at x: [6623] y: [239]\n\nClone at x: [] y: [158]\n\nClone at x: [4020] y: [35]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nset size to (80) %\nif <(Lag?) = [1]> then\n    turn left (5) degrees\nelse\n    switch costume to (costume1 v)\nend\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    set [x v] to [2661]\n    set [y v] to [297]\n    Clone at x: [2960] y: [-14]\n    Clone at x: [4020] y: [35]\n    Clone at x: [4200] y: [35]\n    Clone at x: [1100] y: [-18]\n    Clone at x: [1269] y: [-18]\n    Clone at x: [4373] y: [-60]\n    Clone at x: [4600] y: [-60]\n    Clone at x: [4730] y: [101]\n    Clone at x: [4860] y: [-60]\n    Clone at x: [4550] y: [190]\n    Clone at x: [4969] y: [96]\n    Clone at x: [5150] y: [-60]\n    Clone at x: [5700] y: [410]\n    Clone at x: [4700] y: [475]\n    Clone at x: [4910] y: [475]\n    Clone at x: [6297] y: [-83]\n    Clone at x: [6551] y: [-84]\n    Clone at x: [6724] y: [45]\n    Clone at x: [6460] y: [148]\n    Clone at x: [7051] y: [-43]\n    Clone at x: [7171] y: [-43]\n    Clone at x: [6623] y: [239]\n    Clone at x: [6816] y: [239]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (costume1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [360] y: [0]\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(y) = (y position)> and <(x) = (x 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)\nset [x v] to (x)\nset [y v] to (y)\n\n@Trampoline\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [level beat v]\ngo to [back v] layer\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 [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    set [x v] to [2740]\n    set [y v] to [111]\n    Clone at x: [3920] y: [16]\n    Clone at x: [5620] y: [220]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nClone at x: [360] y: [0]\n\nwhen I receive [bounce v]\nswitch costume to (costume1 v)\nif <(Lag?) = [1]> then\n    repeat (4)\n        next costume\n    end\nelse\n    switch costume to (costume1 v)\nend\n\nClone at x: [5530] y: [375]\n\n@Trampoline Hitbox\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [level beat v]\ngo to [back v] layer\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 [setup v]\nset [ghost v] effect to (100)\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    set [x v] to [2740]\n    set [y v] to [111]\n    Clone at x: [3919] y: [15]\n    Clone at x: [5620] y: [220]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level chosen v]\nrepeat until <<(EXIT) = [win]> or <key (b v) pressed?>>\n    if <touching (player v)?> then\n        broadcast (Bounce v)\n        wait (1) seconds\n    end\nend\n\n@Collectables\n\nClone at x: [175] y: [1756]\n\nwhen I receive [green flag v]\n\nClone at x: [4585] y: [1250]\nClone at x: [4937] y: [1609]\nClone at x: [4846] y: [1004]\nClone at x: [5182] y: [1472]\nClone at x: [5244] y: [1517]\nClone at x: [5381] y: [1252]\nClone at x: [5302] y: [1160]\nClone at x: [5119] y: [1010]\nClone at x: [5022] y: [1382]\nClone at x: [5150] y: [1248]\nClone at x: [5069] y: [1065]\n\nClone at x: [3474] y: [1530]\n\nwhen I receive [tick v]\nset size to (130) %\npoint in direction (90)\nif <(Lag?) = [1]> then\n    next costume\nelse\n    switch costume to (costume13 v)\nend\n\nClone at x: [643] y: [39]\n\nwhen flag clicked\nset [lag? v] to [1]\n\ndelete this clone\n\nClone at x: [5310] y: [375]\nClone at x: [5460] y: [530]\nClone at x: [5350] y: [470]\n\nClone at x: [5426] y: [552]\n\nClone at x: [5385] y: [381]\nClone at x: [5453] y: [545]\nClone at x: [5402] y: [486]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    create clone of (collectables2 v)\n    delete this clone\nend\n\nchange [collected v] by (1)\n\nwhen I receive [level chosen v]\nset [y v] to [0]\nset [x v] to [0]\nset [collected v] to [0]\nset [collected max v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (dot v)\n    hide\n    Clone at x: [200] y: [135]\n    Clone at x: [457] y: [167]\n    Clone at x: [575] y: [167]\n    Clone at x: [693] y: [167]\n    Clone at x: [1453] y: [100]\n    Clone at x: [1513] y: [130]\n    Clone at x: [1573] y: [74]\n    Clone at x: [1895] y: [195]\n    Clone at x: [2170] y: [60]\n    Clone at x: [2230] y: [100]\n    Clone at x: [2290] y: [60]\n    Clone at x: [2650] y: [90]\n    Clone at x: [2740] y: [130]\n    Clone at x: [2830] y: [90]\n    Clone at x: [3540] y: [-15]\n    Clone at x: [3620] y: [-70]\n    Clone at x: [3460] y: [30]\n    Clone at x: [4112] y: [170]\n    Clone at x: [4380] y: [430]\n    Clone at x: [4525] y: [30]\n    Clone at x: [4725] y: [0]\n    Clone at x: [4625] y: [41]\n    Clone at x: [4825] y: [41]\n    Clone at x: [4454] y: [123]\n    Clone at x: [4925] y: [30]\n    Clone at x: [5025] y: [0]\n    Clone at x: [5215] y: [63]\n    Clone at x: [5485] y: [403]\n    Clone at x: [5418] y: [315]\n    Clone at x: [5396] y: [235]\n    Clone at x: [5671] y: [538]\n    Clone at x: [5851] y: [630]\n    Clone at x: [5955] y: [440]\n    Clone at x: [6010] y: [405]\n    Clone at x: [6065] y: [370]\n    Clone at x: [6120] y: [335]\n    Clone at x: [6175] y: [300]\n    Clone at x: [6342] y: [135]\n    Clone at x: [6540] y: [12]\n    Clone at x: [6377] y: [7]\n    Clone at x: [6722] y: [-63]\n    Clone at x: [6712] y: [375]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (dot v)\n        Clone at x: [17] y: [-29]\n        Clone at x: [78] y: [-26]\n        Clone at x: [316] y: [-32]\n        Clone at x: [424] y: [40]\n        Clone at x: [-189] y: [7]\n        Clone at x: [-189] y: [59]\n        Clone at x: [-8] y: [157]\n        Clone at x: [50] y: [190]\n        Clone at x: [103] y: [157]\n    else\n        set [x v] to [-999999999]\n    end\n    set [x v] to [-999999999]\nend\nset [x v] to [-999999999]\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]\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [level chosen v]\nforever\n    go to [front v] layer\nend\n\nglide (1) secs to (sprite1 v)\n\nglide (1) secs to x: (341) y: (190)\n\n@Background win\n\nwhen I receive [yay! v]\nswitch costume to (costume2 v)\nset [ghost v] effect to (0)\nAnimation\n\nwhen this sprite clicked\n\nwhen I receive [green flag v]\nhide\n\nswitch costume to (finished background v)\nset [ghost v] effect to (0)\ngo to x: (0) y: (0)\nshow\n\nif <<(LEVEL) = [1]> or <(LEVEL) = [2]>> then\n\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Game Won v)\nhide\n\ndefine Animation\nshow\ngo to x: (0) y: (300)\nrepeat (20)\n    change y by (((40) - (y position)) / (10))\nend\nwait until <mouse down?>\nwait until <not <mouse down?>>\nbroadcast (Stats for level 1 v)\nrepeat (5)\n    change y by (((200) - (y position)) / (4))\nend\nhide\n\n@Sliding hitbox platforms\n\nwhen I receive [level beat v]\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [ghost v] effect to (100)\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume22 v)\n    set [x v] to [3524]\n    set [y v] to [-95]\n    Clone at x: [6064] y: [265]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [540] y: [0]\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nClone at x: [360] y: [0]\n\n@Words and artwork\n\nwhen I receive [level beat v]\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\ngo [forward v] (5) layers\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [570] y: [10]\n    Clone at x: [570] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [740] y: [0]\n    Clone at x: [300] y: [505]\n    Clone at x: [220] y: [-505]\n    Clone at x: [380] y: [20]\n    Clone at x: [380] y: [20]\n    Clone at x: [360] y: [70]\n    Clone at x: [2010] y: [70]\n    Clone at x: [550] y: [120]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [540] y: [0]\n        Clone at x: [230] y: [-50]\n        Clone at x: [470] y: [0]\n        Clone at x: [400] y: [0]\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\ngo [backward v] (100) layers\n\nClone at x: [380] y: [20]\nClone at x: [380] y: [20]\nClone at x: [380] y: [20]\n\nClone at x: [570] y: [10]\n\ngo to [front v] layer\n\n@Drop through Platforms\n\nwhen I receive [level beat v]\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [570] y: [10]\n    Clone at x: [570] y: [0]\n    Clone at x: [650] y: [0]\n    Clone at x: [740] y: [0]\n    Clone at x: [300] y: [505]\n    Clone at x: [220] y: [-505]\n    Clone at x: [3413] y: [254]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\nClone at x: [360] y: [0]\nClone at x: [540] y: [0]\nClone at x: [230] y: [-50]\nClone at x: [470] y: [0]\nClone at x: [400] y: [0]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\n@10 coins\n\nClone at x: [175] y: [1756]\n\nwhen I receive [level chosen v]\nforever\n    go to [front v] layer\nend\n\nClone at x: [4585] y: [1250]\nClone at x: [4937] y: [1609]\nClone at x: [4846] y: [1004]\nClone at x: [5182] y: [1472]\nClone at x: [5244] y: [1517]\nClone at x: [5381] y: [1252]\nClone at x: [5302] y: [1160]\nClone at x: [5119] y: [1010]\nClone at x: [5022] y: [1382]\nClone at x: [5150] y: [1248]\nClone at x: [5069] y: [1065]\n\nClone at x: [3474] y: [1530]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    create clone of (10 coins3 v)\n    delete this clone\nend\n\nchange [collected v] by (10)\n\nif <(COLLECTED) = (COLLECTED MAX)> then\n    broadcast (Open Portal v)\nend\n\nwhen I receive [level chosen v]\nset [y v] to [0]\nset [x v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (dot v)\n    hide\n    Clone at x: [2760] y: [600]\n    Clone at x: [3230] y: [-20]\n    Clone at x: [4810] y: [621]\n    Clone at x: [6878] y: [-31]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (dot v)\n    else\n        set [x v] to [-999999999]\n    end\n    set [x v] to [-999999999]\nend\nset [x v] to [-999999999]\n\nset [collected v] to [0]\nset [collected max v] to [0]\n\nClone at x: [17] y: [-29]\nClone at x: [78] y: [-26]\nClone at x: [316] y: [-32]\nClone at x: [424] y: [40]\nClone at x: [-189] y: [7]\nClone at x: [-189] y: [59]\nClone at x: [-8] y: [157]\nClone at x: [50] y: [190]\nClone at x: [103] y: [157]\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]\n\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (10)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\nset size to (250) %\npoint in direction (90)\nif <(Lag?) = [1]> then\n    next costume\nelse\n    switch costume to (costume2 v)\nend\n\n@Platforms2\n\nwhen I receive [level beat v]\n\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nClone at x: [0] y: [0]\n\nwhen I receive [level chosen v]\nhide\n\n    set [y v] to ((([cos v] of ((timer) * (170)) ) * (12)) + (175))\nend\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    set [x v] to [5000]\n    set [y v] to [160]\n    go to [back v] layer\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n        Clone at x: [360] y: [0]\n        Clone at x: [540] y: [0]\n        Clone at x: [230] y: [-50]\n        Clone at x: [470] y: [0]\n        Clone at x: [400] y: [0]\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\n    set [ghost v] effect to (10)\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)\nset [x v] to (x)\nset [y v] to (y)\n\nClone at x: [570] y: [0]\nClone at x: [650] y: [0]\nClone at x: [740] y: [0]\nClone at x: [300] y: [505]\nClone at x: [220] y: [-505]\nClone at x: [474] y: [-105]\nClone at x: [700] y: [60]\nClone at x: [630] y: [300]\n\nClone at x: [5200] y: [20]\n\nwhen I receive [green flag v]\nhide\n\n@Platforms4\n\nwhen I receive [level beat v]\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nClone at x: [0] y: [0]\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    set [x v] to [3360]\n    set [y v] to [122]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\n\nnext costume\n\ndefine animation\nswitch costume to (costume1 v)\nrepeat (12)\n    next costume\nend\nswitch costume to (costume15 v)\n\nwait (0) seconds\n\nwhen I receive [level chosen v]\nset [checkpoint # v] to [0]\nset [player spawn x v] to [0]\nset [player spawn y v] to [14]\nwait until <touching (player v)?>\nset [checkpoint # v] to [1]\nset [player spawn x v] to [3348]\nset [player spawn y v] to [126]\nif <(Lag?) = [1]> then\n    animation\nend\n\npoint in direction (90)\n\nwait (.1) seconds\nhide\n\nshow\n\n@Platforms5\n\nwhen I receive [level beat v]\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume14 v)\n    set [x v] to [5305]\n    set [y v] to [135]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (level 2 1 v)\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (level 77 1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\n\ndefine animation\nswitch costume to (costume1 v)\nrepeat (12)\n    next costume\nend\nswitch costume to (costume15 v)\n\nwhen I receive [level chosen v]\nwait until <touching (player v)?>\nset [checkpoint # v] to [2]\nset [player spawn x v] to [5295]\nset [player spawn y v] to [170]\nif <(Lag?) = [1]> then\n    animation\nend\n\n@Platforms3\n\nwhen I receive [level beat v]\ngo to [back v] layer\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\nset [y v] to [0]\nset [x v] to [0]\nset [p timer v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (costume1 v)\n    set [x v] to [7623]\n    set [y v] to [126]\nelse\n    if <(LEVEL) = [2]> then\n        switch costume to (costume1 v)\n    else\n        if <(LEVEL) = [77]> then\n            switch costume to (costume1 v)\n            broadcast (Level 77 v)\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\n\ndefine animation\nswitch costume to (costume1 v)\nwait (.2) seconds\nrepeat (17)\n    next costume\nend\nswitch costume to (costume18 v)\n\nwhen I receive [level chosen v]\nwait until <touching (player v)?>\nif <(Lag?) = [1]> then\n    animation\nend\nset [exit v] to [win]\n\n@Sprite1\n\nwhen I receive [green flag v]\nset [r u done? v] to [0]\nhide\n\nwhen I receive [game won v]\nhide\n\nwhen I receive [level chosen v]\ngo [forward v] (100) layers\ngo to x: (171) y: (157)\nshow\nrepeat until <(EXIT) = [win]>\n    switch costume to ((COLLECTED) - (-1))\nend\n\nwhen I receive [stats for level 1 v]\nset size to (90) %\ngo [forward v] (100) layers\ngo to x: (60) y: (37)\nshow\ngo to [front v] layer\nset [r u done? v] to [1]\nrepeat (100)\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\n    go to [front v] layer\nend\n\n@Sprite2\n\nwhen flag clicked\n\n    go to x: (mouse x) y: (mouse y)\n    if <(playing?) = [0]> then\n        if <(mouse touching?) = [1]> then\n            show\n            go to [front v] layer\n            set [ghost v] effect to (10)\n        else\n            hide\n        end\n    else\n        hide\n    end\nend\n\n@Effec\n\nwhen I start as a clone\ngo [forward v] (1) layers\nset [ghost v] effect to (0)\nif <(CloneID) = [1]> then\n    hide\n    set [color v] effect to (0)\n    set [coloreffec v] to (pick random (2) to (3))\n    go to x: (pick random (-200) to (200)) y: (-185)\n    set [y v] to (pick random (-320) to (-180))\n    fly\n    boom\nelse\n    change [color v] effect by (pick random (0) to (15))\n    set [xv v] to (pick random (-12) to (12))\n    set [yv v] to (pick random (0) to (20))\n    show\n    repeat until <(y position) < [-170]>\n        Physics\n    end\nend\ndelete this clone\n\ndefine boom\nbroadcast (boom v)\nset [cloneid v] to [2]\nrepeat (10)\n    create clone of (_myself_ v)\nend\n\ndefine Physics\nset size to ((190) + ((Yv) * (8))) %\nchange [yv v] by (-1)\nset [xv v] to ((Xv) * (0.92))\nset [yv v] to ((Yv) * (0.92))\nchange x by (Xv)\nchange y by (Yv)\n\nwhen I start as a clone\nif <(CloneID) = [2]> then\n    wait (0.5) seconds\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\n\nwhen flag clicked\nhide\ndelete this clone\n\ndefine fly\nrepeat (16)\n    change [y v] by (14)\n    set y to (Y)\n    if <(y position) > [-175]> then\n        show\n    end\nend\n\nwhen I receive [yay! v]\nset [cloneid v] to [1]\nrepeat (25)\n    create clone of (_myself_ v)\n    wait (0) seconds\nend\n\n@Sprite4\n\nwhen I receive [animate v]\ngo to [back v] layer\ngo to x: ([floor v] of ((((SCROLL X) * (-.5)) mod (478)) - (Sprite4: ox)) ) y: (((SCROLL Y) * (-.3)) - (20))\n\nwhen I receive [menu animate v]\ngo to x: ([floor v] of (((SCROLL_X) mod (478)) - (Sprite4: ox)) ) y: (-50)\n\nwhen I receive [level chosen v]\ngo to [back v] layer\ngo [backward v] (1000) layers\n\nwhen flag clicked\nset [scroll_x v] to [0]\nforever\n    change [scroll_x v] by (1.5)\nend\n\nwhen flag clicked\ngo [backward v] (1000) layers\nset [ghost v] effect to (0)\ngo to x: (0) y: (-50)\nset [sprite4: ox v] to [0]\ncreate clone of (_myself_ v)\nset [sprite4: ox v] to [479]\nswitch costume to (costume1 v)\n\ngo [forward v] (1000) layers\n\n@Splash3\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\n\nwhen I receive [game won v]\nshow\ngo to [front v] layer\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\ngo to x: (-51) y: (-213)\nset [sy v] to [0]\nset [player mouse touching? v] to [0]\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        set [player mouse touching? v] to [1]\n        animation\n    else\n        set [player mouse touching? v] to [0]\n    end\nend\n\ndefine animation\nset y to (-205)\nwait (0) seconds\nset y to (-197)\nwait (0) seconds\nset y to (-190.5)\nwait (0) seconds\nset y to (-183)\nwait (0) seconds\nset y to (-176)\nwait (0) seconds\nset y to (-169)\nwait (0) seconds\nset y to (-162.5)\nwait (0) seconds\nset y to (-158)\nwait (0) seconds\nset y to (-153.5)\nwait (0) seconds\nset y to (-149.5)\nwait (0) seconds\nset y to (-145)\nwait (0) seconds\nset y to (-142)\nwait (0) seconds\nset y to (-141)\nwait (0) seconds\nset y to (-140.5)\nwait (0) seconds\nset y to (-140)\nwait (0) seconds\nset y to (-141)\nwait (0) seconds\nset y to (-142)\nwait (0) seconds\nset y to (-145)\nwait (0) seconds\nset y to (-149.5)\nwait (0) seconds\nset y to (-153.5)\nwait (0) seconds\nset y to (-158)\nwait (0) seconds\nset y to (-162.5)\nwait (0) seconds\nset y to (-169)\nwait (0) seconds\nset y to (-176)\nwait (0) seconds\nset y to (-183)\nwait (0) seconds\nset y to (-190.5)\nwait (0) seconds\nset y to (-197)\nwait (0) seconds\nset y to (-205)\nwait (0) seconds\nset y to (-213)\n\nwhen flag clicked\nset size to (55) %\nswitch costume to (costume2 v)\n\n@Splash4\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [game won v]\nshow\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\ngo to x: (-42) y: (17)\nset size to (115) %\n\nset [brightness v] effect to (0)\nset size to (175) %\n\n@Splash5\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\n\nwhen I receive [game won v]\nshow\ngo to [front v] layer\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\nswitch costume to (costume15 v)\ngo to x: (89) y: (25)\ngo to [front v] layer\n\n    if <(distance to [mouse-pointer v]) < [14]> then\n        next costume\n    else\n        next costume\n        wait (.05) seconds\n    end\nend\n\nset [touching coin? v] to [0]\n\nset [touching coin? v] to [1]\n\nset [touching coin? v] to [0]\n\nset [brightness v] effect to (0)\nset size to (175) %\n\n@Splash6\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [game won v]\nshow\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\nset [touching coin? v] to [1]\nswitch costume to (costume7 v)\ngo to x: (-119) y: (-97)\n\n    if <touching (mouse-pointer v)?> then\n        set [touching coin? v] to [1]\n    else\n        set [touching coin? v] to [0]\n        turn left (2) degrees\n    end\nend\n\ngo to [front v] layer\n\nnext costume\n\nwait (0) seconds\n\nset [brightness v] effect to (0)\nset size to (175) %\n\n@Sprite3\n\nwhen flag clicked\n\n    go to x: (mouse x) y: (mouse y)\n    if <(playing?) = [0]> then\n        if <(touching coin?) = [1]> then\n        else\n            hide\n        end\n    else\n        hide\n    end\nend\n\nshow\ngo to [front v] layer\nset [ghost v] effect to (10)\n\n@Sprite5\n\nwhen flag clicked\n\n\n    go to x: ([x position v] of [splash3 v]) y: (([y position v] of [splash3 v]) + (120))\n    if <(playing?) = [0]> then\n        if <(player mouse touching?) = [1]> then\n            show\n            go to [front v] layer\n            set [ghost v] effect to (10)\n            switch costume to (costume2 v)\n        else\n            hide\n        end\n    else\n        hide\n    end\nend\n\nif <(pick random (1) to (2)) = [1]> then\nelse\n    show\n    go to [front v] layer\n    set [ghost v] effect to (10)\n    switch costume to (costume3 v)\nend\n\n@Splash7\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [game won v]\nshow\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\npoint in direction (90)\nset [touching coin? v] to [1]\nswitch costume to (costume7 v)\ngo to x: (-42) y: (17)\n\n    if <<<(mouse x) > [0]> and <[202] > (mouse x)>> and <(mouse y) < [-90]>> then\n        set y to ((([sin v] of ((timer) * (250)) ) * (20)) - (-52))\n    else\n        set y to ((([sin v] of ((timer) * (250)) ) * (5)) - (-47))\n    end\nend\n\ngo to [front v] layer\n\nnext costume\n\nwait (0) seconds\n\nset [brightness v] effect to (0)\nset size to (175) %\n\n@Splash8\n\nwhen I receive [green flag v]\nset [ghost v] effect to (75)\nshow\n\nwhen I receive [game won v]\nshow\n\nwhen I receive [level chosen v]\ngo to x: (0) y: (0)\nset [ghost v] effect to (55)\nshow\n\ngo [forward v] (100) layers\n\n@Collectables2\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level chosen v]\ngo to [front v] layer\n\nglide (1) secs to (sprite1 v)\n\nwhen I start as a clone\n\nglide (pick random (.5) to (.8)) secs to (sprite1 v)\nhide\n\nwhen I start as a clone\ngo [backward v] (15) layers\nrepeat (50)\n    point in direction (90)\n    next costume\n    change size by (-3)\nend\n\nswitch costume to (costume2 v)\nset size to (130) %\ngo to (player v)\nset [y-vel v] to (pick random (15) to (-15))\nset [speed v] to (pick random (2.5) to (3.5))\nshow\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    set [y-vel v] to ((y-vel) * (.9))\n    set [x-vel v] to ((x-vel) * (.9))\n    set [speed v] to (round ((speed) * (1.2)))\n    next costume\n    if <(y-vel) < [1]> then\n        change x by (() - (y-vel))\n    else\n        change y by (y-vel)\n    end\n    move (speed) steps\n    change size by (-2)\n    next costume\nend\nhide\ndelete this clone\n\nhide\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nset size to (130) %\ngo to (player v)\nshow\nglide (0.5) secs to (sprite1 v)\nhide\nchange [collected v] by (1)\ndelete this clone\n\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    next costume\n    move (10) steps\nend\n\n@Collectables3\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [level chosen v]\ngo to [front v] layer\n\nglide (1) secs to (sprite1 v)\n\nwhen I start as a clone\nhide\n\nswitch costume to (costume2 v)\nset size to (130) %\ngo to (player v)\nset [y-vel v] to (pick random (5) to (-5))\nset [speed v] to (pick random (2.5) to (3.5))\nshow\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    set [y-vel v] to ((y-vel) * (.9))\n    set [x-vel v] to ((x-vel) * (.9))\n    set [speed v] to (round ((speed) * (1.2)))\n    next costume\n    if <(y-vel) < [1]> then\n        change x by (() - (y-vel))\n    else\n        change y by (y-vel)\n    end\n    move (speed) steps\n    change size by (-2)\n    next costume\nend\nhide\nchange [collected v] by (1)\ndelete this clone\n\nglide (pick random (.5) to (.8)) secs to (sprite1 v)\n\nwhen I start as a clone\n\nhide\nswitch costume to (costume2 v)\nset size to (130) %\ngo to (player v)\nshow\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    next costume\n    move (8) steps\nend\nhide\ndelete this clone\n\nswitch costume to (costume2 v)\nset size to (130) %\ngo to (player v)\nset [y-vel v] to (pick random (15) to (-15))\nset [speed v] to (pick random (2.5) to (3.5))\nshow\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    set [y-vel v] to ((y-vel) * (.9))\n    set [x-vel v] to ((x-vel) * (.9))\n    set [speed v] to (round ((speed) * (1.2)))\n    next costume\n    if <(y-vel) < [1]> then\n        change x by (() - (y-vel))\n    else\n        change y by (y-vel)\n    end\n    move (speed) steps\n    change size by (-2)\n    next costume\nend\nhide\ndelete this clone\n\n@10 coins2\n\nwhen I start as a clone\n\nswitch costume to (costume2 v)\nset size to (250) %\ngo to (player v)\nshow\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    next costume\n    move (7) steps\nend\nhide\ndelete this clone\n\nswitch costume to (costume2 v)\nset size to (230) %\ngo to (player v)\nset [y-vel v] to (pick random (15) to (-15))\nset [speed v] to (pick random (2.5) to (3.5))\nshow\nrepeat until <<touching (sprite1 v)?> or <touching (_edge_ v)?>>\n    point towards (sprite1 v)\n    set [y-vel v] to ((y-vel) * (.9))\n    set [x-vel v] to ((x-vel) * (.9))\n    set [speed v] to (round ((speed) * (1.2)))\n    next costume\n    if <(y-vel) < [1]> then\n        change x by (() - (y-vel))\n    else\n        change y by (y-vel)\n    end\n    move (speed) steps\n    change size by (-4)\n    next costume\nend\nhide\nrepeat (10)\n    change [collected v] by (1)\n    wait (0) seconds\nend\ndelete this clone\n\nwhen I start as a clone\nhide\n\nrepeat (50)\n    point in direction (90)\n    next costume\n    change size by (-3)\nend\n\nwhen I start as a clone\nhide\n\nswitch costume to (costume2 v)\nset size to (130) %\ngo to (player v)\nshow\nglide (0.5) secs to (sprite1 v)\nhide\ndelete this clone\n\n@Splash9\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\ngo to [front v] layer\n\nwhen I receive [game won v]\nshow\ngo to [front v] layer\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\ngo to x: (0) y: (100)\nset size to (115) %\npoint in direction (90)\nforever\n    point in direction ((([sin v] of ((timer) * (250)) ) * (3)) + (90))\n    if <(twilight hitbox) = [1]> then\n        if <(size) = [125]> then\n            set size to (125) %\n        else\n            size change\n        end\n    else\n        if <(size) = [115]> then\n            set size to (115) %\n        else\n            undo size change\n        end\n    end\nend\n\nset [brightness v] effect to (0)\nset size to (175) %\n\ndefine size change\nset size to (118) %\nwait (0) seconds\nset size to (120) %\nwait (0) seconds\nset size to (122) %\nwait (0) seconds\nset size to (123) %\nwait (0) seconds\nset size to (124) %\nwait (0) seconds\nset size to (125) %\n\ndefine undo size change\nset size to (125) %\nwait (0) seconds\nset size to (124) %\nwait (0) seconds\nset size to (123) %\nwait (0) seconds\nset size to (122) %\nwait (0) seconds\nset size to (120) %\nwait (0) seconds\nset size to (118) %\nwait (0) seconds\nset size to (115) %\n\n@Clouds\n\nwhen I receive [level chosen v]\nhide\n\n    hide\n    wait (pick random (1) to (2)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo [backward v] (500) layers\nset [y v] to (pick random (10) to (740))\nset [ghost v] effect to (pick random (60) to (70))\nswitch costume to (pick random (1) to (4))\nset size to (pick random (80) to (90)) %\nset [speed v] to (pick random (-.5) to (-1.3))\nset x to (250)\nset y to (y)\nPosition ((y) - (SCROLL Y))\nshow\nrepeat until <(x position) < [-265]>\n    Position ((y) - (SCROLL Y))\n    change x by (speed)\n    if <(SCROLL Y) > [0]> then\n        if <([abs v] of ((SCROLL Y) - (y of player)) ) > [5]> then\n            change y by (((SCROLL Y) - (y of player)) / (50))\n            Position ((y) - (SCROLL Y))\n        end\n    end\n    if <touching (platforms2 v)?> then\n        delete this clone\n    end\nend\ndelete this clone\n\nif <(SCROLL X) > [0]> then\n    if <([abs v] of ((SCROLL X) - (x of player)) ) > [5]> then\n        change x by (((SCROLL X) - (x of player)) / (5))\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nif <(SCROLL Y) > [0]> then\n    if <([abs v] of ((SCROLL Y) - (y of player)) ) > [5]> then\n        change y by (((SCROLL Y) - (y of player)) / (50))\n    end\nend\n\nset y to (28)\n\ndefine Position (y)\nset y to (y)\nif <(y) = (y position)> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\n\nif <<(EXIT) = []> and <key (right arrow v) pressed?>> then\n    change x by (-5)\nend\n\nif <<(EXIT) = []> and <key (left arrow v) pressed?>> then\nend\n\nwhen I start as a clone\nrepeat until <(x position) < [-265]>\n    if <(moving?) = [1]> then\n        if <(EXIT) = []> then\n            change x by (() - ((sy player) / (1.5)))\n        end\n    end\nend\n\ngo to x: (10) y: (((SCROLL Y) * (-.3)) - (20))\n\nchange x by (((SCROLL X) * (-.5)) mod (478))\n\nchange [speed v] by (100)\n\nchange [speed v] by (-100)\n\nwhen I start as a clone\nrepeat until <(x position) < [-265]>\nend\n\n@Splash10\n\nwhen I receive [green flag v]\ngo to [front v] layer\nshow\ngo to [front v] layer\n\nwhen I receive [game won v]\nshow\ngo to [front v] layer\n\nwhen I receive [level chosen v]\nhide\n\nwhen flag clicked\nset [twilight hitbox v] to [0]\nset [ghost v] effect to (100)\ngo to x: (0) y: (100)\nset size to (115) %\npoint in direction (90)\nforever\n    point in direction ((([sin v] of ((timer) * (250)) ) * (3)) + (90))\n    if <touching (mouse-pointer v)?> then\n        set [twilight hitbox v] to [1]\n    else\n        set [twilight hitbox v] to [0]\n    end\nend\n\nset [brightness v] effect to (0)\nset size to (175) %\n\n@Thumnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    switch costume to (real one v)\n    show\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n@10 coins3\n\nClone at x: [4585] y: [1250]\nClone at x: [4937] y: [1609]\nClone at x: [4846] y: [1004]\nClone at x: [5182] y: [1472]\nClone at x: [5244] y: [1517]\nClone at x: [5381] y: [1252]\nClone at x: [5302] y: [1160]\nClone at x: [5119] y: [1010]\nClone at x: [5022] y: [1382]\nClone at x: [5150] y: [1248]\nClone at x: [5069] y: [1065]\n\nClone at x: [3474] y: [1530]\n\nwhen I start as a clone\nrepeat (50)\n    point in direction (90)\n    next costume\n    change size by (-10)\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nset size to (250) %\ngo to (player v)\nshow\nglide (0.5) secs to (sprite1 v)\nhide\nrepeat (10)\n    change [collected v] by (1)\nend\ndelete this clone\n\ngo to [front v] layer\n\n@Clouds2\n\nwhen I receive [level chosen v]\nhide\n\n\n    hide\n    wait (pick random (1) to (3)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo [backward v] (500) layers\nset [x firelight v] to (pick random (-18) to (740))\nset [ghost v] effect to (pick random (20) to (25))\nset [ghost v] to (pick random (3) to (5))\nset size to (pick random (95) to (100)) %\nset [speed v] to (pick random (2) to (3))\npoint in direction (pick random (-45) to (45))\nset x to (x firelight)\nset [y pos v] to [-160]\nset y to (y pos)\nset [move x v] to (pick random (-3) to (3))\nset [move y v] to (pick random (2) to (3))\nPosition ((y pos) - (SCROLL Y)) ((x firelight) - (SCROLL X))\nshow\nrepeat until <(y pos) > [600]>\n    Position ((y pos) - (SCROLL Y)) ((x firelight) - (SCROLL X))\n    set [ghost v] to (() - (ghost))\n    repeat (9)\n        change [ghost v] effect by (ghost)\n    end\n    set [ghost v] to (() - (ghost))\n    repeat (9)\n        change [ghost v] effect by (ghost)\n    end\nend\nchange [x firelight v] by ((move x) - (pick random (-2) to (2)))\nchange [y pos v] by ((move y) - (pick random (0) to (-1)))\ndelete this clone\n\nswitch costume to (pick random (1) to (4))\n\nchange x by (speed)\n\nif <(SCROLL Y) > [0]> then\n    if <([abs v] of ((SCROLL Y) - (y of player)) ) > [5]> then\n        change y by (((SCROLL Y) - (y of player)) / (50))\n    end\nend\n\nPosition ((x firelight) - (SCROLL Y)) []\n\nif <(SCROLL X) > [0]> then\n    if <([abs v] of ((SCROLL X) - (x of player)) ) > [5]> then\n        change x by (((SCROLL X) - (x of player)) / (5))\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nif <(SCROLL Y) > [0]> then\n    if <([abs v] of ((SCROLL Y) - (y of player)) ) > [5]> then\n        change y by (((SCROLL Y) - (y of player)) / (50))\n    end\nend\n\nset y to (28)\n\ndefine Position (y) (x)\ngo to x: (x) y: (y)\nif <<(y) = (y position)> and <(x) = (x position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [tick v]\n\nset y to (y)\n\nPosition ((y pos) - (SCROLL Y)) ((x firelight) - (SCROLL X))\n\nmove (5) steps\n\nchange [y pos v] by (speed)\n\n@Mute/ Unmute\n\nwhen this sprite clicked\nnext costume\nwait (0.2) seconds\n\nwhen I receive [play game v]\nswitch costume to (costume5 v)\nshow\n\n    if <(costume [number v]) = [2]> then\n        set [mute button on off v] to [1]\n        set volume to (100) %\n    end\nend\n\nwhen I receive [play game v]\ngo to x: (-215) y: (160)\nset size to (35) %\n\n    if <key (m v) pressed?> then\n        next costume\n        wait (0.2) seconds\n    end\nend\n\nwhen I receive [play game v]\nshow\n\n    if <(costume [number v]) = [1]> then\n        set [mute button on off v] to [0]\n        set volume to (0) %\n    end\nend\n\nwhen I receive [play game v]\nforever\n    play sound [Part 1 v] until done\n    play sound [Part 2 v] until done\nend\n\n@Eyelashes\n\nwhen I receive [tick v]\ngo to (player v)\n\nwhen I receive [level chosen v]\nshow\nrepeat until <(OmG YOu jUsT wON) = [1]>\n    switch costume to (costume4 v)\n    wait (pick random (2) to (3)) seconds\n    repeat (14)\n        next costume\n    end\nend\nhide\nstop [this script v]\n\n@Sprite6\n\nwhen I receive [stats for level 1 v]\ngo to x: (0) y: (-500)\nset [ghost v] effect to (0)\nshow\ngo to [front v] layer\nrepeat (15)\n    change y by (30)\nend\nwait until <(R u done?) = [1]>\n\nwhen flag clicked\nhide\n\n
I placed first in @IcedSnow 's contest!\n\nPRESS "L" to toggle animations and reduce lag!\n\nWelcome to Twilight - A Scrolling Platformer. You will play as the little cube as you go on an adventure finding coins, spikes, mushrooms, and more.\n\nPlay here for less lag:\nhttps://forkphorus.github.io/#400589599\n\nPlease note: If you get stuck press "R" to go to the last checkpoint.\n\nThis may take a while to load because it has over 3000 blocks of code and a lot of costumes, so please be patient - it is worth the wait :P\n\n–––––––––––––––––– Storyline ––––––––––––––––––––\nYou were out watching the sunset, so beautiful and colorful, but it is getting late and you need to go back home. \n\n–––––––––––––––––– Instructions ––––––––––––––––––  \n• Everything is 100% possible\n• Hover over items in the title screen to see some special effects :D\n• Arrow keys or WASD to move\n• Down arrow/ "s" key to drop through some platforms\n• Up arrow to swim up\n• Bounce on mushrooms to jump higher\n• Get to the last flag to win\n• Don't touch spinning gears or fall down\n• Water slows you down, but you can still move in it\n• When you die, you will go to the last checkpoint you got to\n• Click on the mute button or press "M" to mute or unmute\n• Try to find the Easter Egg :P (Hint: read the all of the notes and credits, and it's not at the bottom of the notes and credits, by the way)