CUBIC - A Scrolling Platformer


@Stage\n\nwhen [m v] key pressed\nset [_mouse test v] to (join ((mouse x) + (SCROLL X)) (join [_] ((mouse y) + (SCROLL Y))))\n\nwhen I receive [play v]\nstop all sounds\nforever\n    play sound [astronomia v] until done\nend\n\nwhen I receive [start v]\nrepeat until <(_PLAY) = [1]>\n    play sound [pixel party v] until done\nend\n\nwhen I receive [start v]\nforever\n    set vol ((70) * (V MUS))\nend\n\ndefine set vol (v)\nif <not <(v) = (volume)>> then\n    set volume to (v) %\nend\n\nwhen I receive [start v]\nforever\n    if <(item (2) of [options v]) = [0]> then\n        if <(CHAPTER) < ((CHPT MAX) + (1))> then\n            if <(item (2) of [options v]) = [0]> then\n                switch backdrop to (join [background] (CHAPTER))\n            end\n        else\n            switch backdrop to (join [background] [0])\n        end\n    else\n        switch backdrop to (dark v)\n    end\nend\n\n@blank\n\n@start\n\ndefine delete (key)\nset [i v] to [1]\nrepeat until <(i) > (length of [key press v])>\n    if <(item (i) of [key press v]) = (key)> then\n        delete (i) of [key press v]\n    end\n    change [i v] by (1)\nend\n\ndefine detect pressed\nif <<key (w v) pressed?> and <not <[key press v] contains (join [up] [1])?>>> then\n    add (join [up] [1]) to [key press v]\nend\nif <<not <key (w v) pressed?>> and <[key press v] contains (join [up] [1])?>> then\n    delete (join [up] [1])\nend\nif <<key (s v) pressed?> and <not <[key press v] contains (join [down] [1])?>>> then\n    add (join [down] [1]) to [key press v]\nend\nif <<not <key (s v) pressed?>> and <[key press v] contains (join [down] [1])?>> then\n    delete (join [down] [1])\nend\nif <<key (a v) pressed?> and <not <[key press v] contains (join [left] [1])?>>> then\n    add (join [left] [1]) to [key press v]\nend\nif <<not <key (a v) pressed?>> and <[key press v] contains (join [left] [1])?>> then\n    delete (join [left] [1])\nend\nif <<key (d v) pressed?> and <not <[key press v] contains (join [right] [1])?>>> then\n    add (join [right] [1]) to [key press v]\nend\nif <<not <key (d v) pressed?>> and <[key press v] contains (join [right] [1])?>> then\n    delete (join [right] [1])\nend\nif <<key (up arrow v) pressed?> and <not <[key press v] contains (join [up] [2])?>>> then\n    add (join [up] [2]) to [key press v]\nend\nif <<not <key (up arrow v) pressed?>> and <[key press v] contains (join [up] [2])?>> then\n    delete (join [up] [2])\nend\nif <<key (down arrow v) pressed?> and <not <[key press v] contains (join [down] [2])?>>> then\n    add (join [down] [2]) to [key press v]\nend\nif <<not <key (down arrow v) pressed?>> and <[key press v] contains (join [down] [2])?>> then\n    delete (join [down] [2])\nend\nif <<key (left arrow v) pressed?> and <not <[key press v] contains (join [left] [2])?>>> then\n    add (join [left] [2]) to [key press v]\nend\nif <<not <key (left arrow v) pressed?>> and <[key press v] contains (join [left] [2])?>> then\n    delete (join [left] [2])\nend\nif <<key (right arrow v) pressed?> and <not <[key press v] contains (join [right] [2])?>>> then\n    add (join [right] [2]) to [key press v]\nend\nif <<not <key (right arrow v) pressed?>> and <[key press v] contains (join [right] [2])?>> then\n    delete (join [right] [2])\nend\n\ndefine update time (amount)\nchange [time last v] by (amount)\nset [time v] to ((round ((time last) * (100))) / (100))\nif <(letter ((length of (TIME)) - (1)) of (TIME)) = [.]> then\n    set [time v] to (join (TIME) [0])\nelse\n    if <not <(letter ((length of (TIME)) - (2)) of (TIME)) = [.]>> then\n        set [time v] to (join (TIME) [.00])\n    end\nend\n\nwhen flag clicked\nbroadcast (flag v)\nset [0] [0] [90] [cover] [100] [99999] [100]\nforever\n    go [forward v] (99999) layers\nend\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [flag v]\nsetup [1]\nbroadcast (setup v) and wait\nbroadcast (intro v)\nwait until <(INTRO) < [0]>\nbroadcast (buttons v)\nbroadcast (start v)\n\ndefine menu pos (x) (y)\nreplace item (X #) of [menu pos v] with (x)\nreplace item (Y #) of [menu pos v] with (y)\n\ndefine reset time\nset [time v] to [0]\nset [time last v] to [0]\nupdate time [0]\n\nwhen I receive [start v]\nforever\n    menu pos [0] ((-20) + (([sin v] of (((timer) + (1)) * (70)) ) * (12)))\n    mouse pos (mouse x) (mouse y)\nend\n\nwhen I receive [flag v]\nforever\n    if <mouse down?> then\n        set [mouse v] to [1]\n        wait (0) seconds\n        set [mouse v] to [0]\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine thumbnail (id)\nhide variable [time v]\nset [v mus v] to [1]\nset [v fx v] to [1]\nset [0] [0] [90] (join [thumbnail] (id)) [100] [99999] [0]\nstop [all v]\n\nthumbnail [2]\n\ndefine check wr\nif <(CHAPTER) = [1]> then\n    if <(TIME) < (☁ WR1)> then\n        set [☁ wr1 v] to (TIME)\n    end\nend\nif <(CHAPTER) = [2]> then\n    if <(TIME) < (☁ WR2)> then\n        set [☁ wr2 v] to (TIME)\n    end\nend\n\ndefine mouse pos (x) (y)\nreplace item (X #) of [mouse pos v] with (x)\nreplace item (Y #) of [mouse pos v] with (y)\n\ndefine setup (type)\nif <(type) = [1]> then\n    hide variable [time v]\n    set [_play v] to [0]\n    set [win v] to [0]\n    set [chapter v] to [1]\n    set [chpt max v] to [3]\n    set [creator v] to [PetrThePro]\n    set [checkpoint v] to [1]\n    set [x # v] to [1]\n    set [y # v] to [2]\n    delete all of [menu pos v]\n    repeat (2)\n        add [] to [menu pos v]\n    end\n    delete all of [mouse pos v]\n    repeat (2)\n        add [] to [mouse pos v]\n    end\n    delete all of [options v]\n    delete all of [options # v]\n    add [1] to [options v]\n    add [grid] to [options # v]\n    add [0] to [options v]\n    add [dark] to [options # v]\n    add [0] to [options v]\n    add [hitbox] to [options # v]\n    add [0] to [options v]\n    add [speed run] to [options # v]\n    add [0] to [options v]\n    add [key stroke] to [options # v]\nend\nif <(type) = [2]> then\n    hide variable [time v]\n    set [_play v] to [0]\n    set [win v] to [0]\n    set [chapter v] to ((CHAPTER) + (1))\n    set [checkpoint v] to [1]\nend\n\nwhen I receive [start v]\nreset time\nwait until <(_PLAY) = [1]>\nshow variable [time v]\nbroadcast (play v)\nrepeat until <(WIN) = [1]>\n    if <(item (4) of [options v]) = [1]> then\n        reset time\n        wait (3) seconds\n    end\n    reset timer\n    repeat until <<(DIE) = [1]> or <(WIN) = [1]>>\n        update time ((1) / (30))\n        detect pressed\n    end\n    if <(WIN) = [0]> then\n        wait until <(DIE) = [0]>\n    end\nend\nif <not <(username) = (CREATOR)>> then\n    check wr\nend\nwait (1) seconds\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nset [0] [-360] [90] [slide] [100] [99] [0]\nrepeat until <(y position) = [0]>\n    change y by (((0) - (y position)) / (3))\nend\nwait (2) seconds\nreset time\nsetup [2]\nbroadcast (start v)\ndelete this clone\n\n@player\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\ndefine setup\nif <(CHAPTER) = [1]> then\n    set [x v] to (item (CHECKPOINT) of [checkpoints1 v])\n    set [y v] to (item ((CHECKPOINT) + (1)) of [checkpoints1 v])\n    set [scroll x v] to (item (CHECKPOINT) of [checkpoints1 v])\n    set [scroll y v] to (item ((CHECKPOINT) + (1)) of [checkpoints1 v])\nend\nif <(CHAPTER) = [2]> then\n    set [x v] to (item (CHECKPOINT) of [checkpoints2 v])\n    set [y v] to (item ((CHECKPOINT) + (1)) of [checkpoints2 v])\n    set [scroll x v] to (item (CHECKPOINT) of [checkpoints2 v])\n    set [scroll y v] to (item ((CHECKPOINT) + (1)) of [checkpoints2 v])\nend\nif <(CHAPTER) = [3]> then\n    set [x v] to (item (CHECKPOINT) of [checkpoints3 v])\n    set [y v] to (item ((CHECKPOINT) + (1)) of [checkpoints3 v])\n    set [scroll x v] to (item (CHECKPOINT) of [checkpoints3 v])\n    set [scroll y v] to (item ((CHECKPOINT) + (1)) of [checkpoints3 v])\nend\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [die v] to [0]\nset [coin last v] to (COINS)\nshow\n\ndefine tick (chapter)\nif <(chapter) = [1]> then\n    set vol ((100) * (V FX))\n    switch costume to (hitbox v)\n    if <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>> then\n        if <not <touching (water v)?>> then\n            if <not <touching (bounce v)?>> then\n                change [sx v] by (-1.2)\n            end\n        else\n            change [sx v] by (-0.4)\n        end\n    end\n    if <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>> then\n        if <not <touching (water v)?>> then\n            if <not <touching (bounce v)?>> then\n                change [sx v] by (1.2)\n            end\n        else\n            change [sx v] by (0.4)\n        end\n    end\n    if <not <touching (water v)?>> then\n        set [sx v] to ((sx) * (0.85))\n    else\n        set [sx v] to ((sx) * (0.95))\n    end\n    if <([abs v] of (sx) ) > [0.9]> then\n        player x (sx) [0]\n    end\n    if <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> then\n        if <not <touching (water v)?>> then\n            if <(in air) < [5]> then\n                set [sy v] to [14]\n            end\n        else\n            change [sy v] by (1.3)\n        end\n    end\n    if <not <touching (water v)?>> then\n        if <(sy) > [-20]> then\n            change [sy v] by (-2)\n        end\n    else\n        if <(sy) < [2]> then\n            change [sy v] by (1)\n        end\n        if <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>> then\n            change [sy v] by (-1.5)\n        end\n    end\n    player y (sy)\n    pos\n    change [scroll x v] by (round (((x) - (SCROLL X)) / (8)))\n    if <(SCROLL X) < [-250]> then\n        set [scroll x v] to [-250]\n    end\n    if <(SCROLL X) > [4200]> then\n        set [scroll x v] to [4200]\n    end\n    change [scroll y v] by (round (((y) - (SCROLL Y)) / (4)))\n    if <(SCROLL Y) < [0]> then\n        set [scroll y v] to [0]\n    end\n    pos\n    if <touching (bounce v)?> then\n        start sound [bounce v]\n        set [sy v] to [38]\n    end\n    if <not <(COINS) = (coin last)>> then\n        start sound [coin v]\n    end\n    set [coin last v] to (COINS)\n    if <not <(CHECKPOINT) = (point last)>> then\n        start sound [checkpoint v]\n    end\n    set [point last v] to (CHECKPOINT)\n    if <(item (item # of [hitbox] in [options # v]) of [options v]) = [0]> then\n        set costume\n        switch costume to (join [player ] (costume))\n    else\n        switch costume to (outline v)\n    end\nend\nif <(chapter) = [2]> then\n    set vol ((100) * (V FX))\n    switch costume to (hitbox v)\n    if <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>> then\n        change [sx v] by (-0.5)\n    end\n    if <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>> then\n        change [sx v] by (0.5)\n    end\n    set [sx v] to ((sx) * (0.95))\n    if <([abs v] of (sx) ) > [0.9]> then\n        player x (sx) [1]\n    end\n    if <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> then\n        if <(in air) < [8]> then\n            set [sy v] to [14]\n        end\n    end\n    if <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>> then\n        change [sy v] by (-4)\n    else\n        change [sx v] by (-0.1)\n    end\n    if <(sy) > [-20]> then\n        change [sy v] by (-1)\n    end\n    player y (sy)\n    pos\n    change [scroll x v] by (round (((x) - (SCROLL X)) / (10)))\n    if <(SCROLL X) < [-700]> then\n        set [scroll x v] to [-700]\n    end\n    change [scroll y v] by (round (((y) - (SCROLL Y)) / (3)))\n    if <(SCROLL Y) < [0]> then\n        set [scroll y v] to [0]\n    end\n    pos\n    if <touching (bounce v)?> then\n        start sound [bounce v]\n        set [sy v] to [30]\n    end\n    if <not <(COINS) = (coin last)>> then\n        start sound [coin v]\n    end\n    set [coin last v] to (COINS)\n    if <(item (item # of [hitbox] in [options # v]) of [options v]) = [0]> then\n        set costume\n        switch costume to (join [player ] (costume))\n    else\n        switch costume to (outline v)\n    end\nend\nif <(chapter) = [3]> then\n    set vol ((100) * (V FX))\n    switch costume to (hitbox v)\n    if <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>> then\n        change [sx v] by (-9)\n    end\n    if <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>> then\n        change [sx v] by (9)\n    end\n    set [sx v] to ((sx) * (0.4))\n    if <([abs v] of (sx) ) > [0.9]> then\n        player x (sx) [0]\n    end\n    if <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> then\n        if <(in air) < [2]> then\n            set [sy v] to [19]\n        end\n    end\n    if <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>> then\n        change [sy v] by (-3)\n    end\n    if <(sy) > [-20]> then\n        change [sy v] by (-2)\n    end\n    player y (sy)\n    pos\n    change [scroll x v] by (round (((x) - (SCROLL X)) / (3)))\n    if <(SCROLL X) < [-50]> then\n        set [scroll x v] to [-50]\n    end\n    change [scroll y v] by (round (((y) - (SCROLL Y)) / (4)))\n    if <(SCROLL Y) < [0]> then\n        set [scroll y v] to [0]\n    end\n    pos\n    if <touching (bounce v)?> then\n        start sound [bounce v]\n        set [sy v] to [30]\n    end\n    if <not <(COINS) = (coin last)>> then\n        start sound [coin v]\n    end\n    set [coin last v] to (COINS)\n    if <(item (item # of [hitbox] in [options # v]) of [options v]) = [0]> then\n        set costume\n        switch costume to (join [player ] (costume))\n    else\n        switch costume to (outline v)\n    end\nend\n\ndefine player y (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\npos\nif <not <<touching (bounce v)?> or <touching (spike v)?>>> then\n    repeat until <not <touching (platformes 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        pos\n        set [sy v] to [0]\n    end\nend\n\ndefine pos\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine player x (sx) (wall jump)\nchange [x v] by (sx)\npos\nif <touching (platformes v)?> then\n    repeat (10)\n        change [y v] by (1)\n        pos\n        if <not <touching (platformes v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-10)\n    if <(wall jump) = [1]> then\n        if <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> then\n            if <(sx) > [0]> then\n                set [sx v] to [-5]\n            else\n                set [sx v] to [5]\n            end\n            set [in air v] to [0]\n        else\n            set [sx v] to [0]\n        end\n    end\n    repeat until <not <touching (platformes v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        pos\n    end\nend\n\nwhen I receive [setup v]\nset [point last v] to [1]\nset [0] [0] [90] (join [player ] [m]) [55] [999] [0]\nhide\n\nwhen I receive [play v]\nrepeat until <(WIN) = [1]>\n    broadcast (game reset v) and wait\n    broadcast (game setup v) and wait\n    setup\n    if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n        tick (CHAPTER)\n        broadcast (tick v)\n        if <(item (item # of [hitbox] in [options # v]) of [options v]) = [0]> then\n            switch costume to (join [player ] [m])\n        end\n        wait (3) seconds\n    end\n    repeat until <<(DIE) = [1]> or <(WIN) = [1]>>\n        tick (CHAPTER)\n        broadcast (tick v)\n    end\n    if <(WIN) = [0]> then\n        wait until <(DIE) = [0]>\n    end\nend\nbroadcast (game reset v)\nhide\n\ndefine die\nset [brightness v] effect to (0)\nrepeat (3)\n    set [brightness v] effect to (20)\n    start sound [die v]\n    wait (0.1) seconds\n    set [brightness v] effect to (0)\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\nwhen I receive [play v]\nforever\n    death\nend\n\ndefine death\nif <<<<touching (spike v)?> or <touching (enemy v)?>> or <touching (lava v)?>> or <(y) < [-170]>> then\n    set [die v] to [1]\n    die\n    set [die v] to [0]\n    set [y v] to [0]\n    set [x v] to [0]\nend\n\ndefine set costume\nif <<<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> and <<not <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>>> and <not <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>>>>> then\n    set [costume v] to [n]\nend\nif <<<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> and <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>>> then\n    set [costume v] to [ne]\nend\nif <<<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>> and <not <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>>>> then\n    set [costume v] to [e]\nend\nif <<<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>> and <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>>> then\n    set [costume v] to [se]\nend\nif <<<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>> and <<not <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>>> and <not <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>>>>> then\n    set [costume v] to [s]\nend\nif <<<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>> and <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>>> then\n    set [costume v] to [sw]\nend\nif <<<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>> and <not <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>>>> then\n    set [costume v] to [w]\nend\nif <<<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>> and <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>>> then\n    set [costume v] to [nw]\nend\nif <<<not <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>>> and <not <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>>>> and <<not <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>>> and <not <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>>>>> then\n    set [costume v] to [m]\nend\n\ndefine set vol (v)\nif <not <(v) = (volume)>> then\n    set volume to (v) %\nend\n\n@buttons1\n\ndefine box collide (x1) (y1) (x2) (y2) (w) (h)\nif <([abs v] of ((x1) - (x2)) ) < ((w) + (1))> then\n    if <([abs v] of ((y1) - (y2)) ) < ((h) + (1))> then\n        set [collide v] to [1]\n    else\n        set [collide v] to [0]\n    end\nelse\n    set [collide v] to [0]\nend\n\nwhen I receive [setup v]\nhide\n\ndefine clone (id)\nset [clone v] to (id)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(clone) = [title]> then\n    set ((0) + (item (X #) of [menu pos v])) ((120) + (item (Y #) of [menu pos v])) [90] (join [title] [2]) [90] [0] [0]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: ((0) + (item (X #) of [menu pos v])) y: ((120) + (item (Y #) of [menu pos v]))\n            show\n            box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((0) + (item (X #) of [menu pos v])) ((120) + (item (Y #) of [menu pos v])) [80] [40]\n            if <(collide) = [1]> then\n                if <<(MOUSE) = [1]> or <(SPACE) = [1]>> then\n                    change [combo v] by (1)\n                end\n            end\n            if <(COMBO) > [1]> then\n                change [combo v] by ((-1) / ((10) - ((5) * ((COMBO) / (100)))))\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [combo]> then\n    set ((0) + (item (X #) of [menu pos v])) ((165) + (item (Y #) of [menu pos v])) [90] (join [bar] [banana]) [100] [0] [100]\n    set [brightness v] effect to (100)\n    set [combo v] to [0]\n    set [delta v] to [0]\n    set [ghost v] to [0]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: ((0) + (item (X #) of [menu pos v])) y: ((165) + (item (Y #) of [menu pos v]))\n            show\n            if <(COMBO) > [1]> then\n                set [delta v] to ((COMBO) / (100))\n                switch costume to (join [bar] ([ceiling v] of ((delta) * (10)) ))\n                change [ghost v] by (((0) - (ghost)) * (0.4))\n            else\n                change [ghost v] by (((100) - (ghost)) * (0.4))\n            end\n            set [ghost v] effect to (ghost)\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [play]> then\n    set ((0) + (item (X #) of [menu pos v])) ((-90) + (item (Y #) of [menu pos v])) [90] [play] [90] [0] [30]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: ((0) + (item (X #) of [menu pos v])) y: ((-90) + (item (Y #) of [menu pos v]))\n            show\n            box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((0) + (item (X #) of [menu pos v])) ((-90) + (item (Y #) of [menu pos v])) [65] [30]\n            if <<(CHAPTER) < ((CHPT MAX) + (1))> and <not <<(CHAPTER) = [3]> and <not <(COINS) > ((2) - (1))>>>>> then\n                if <(collide) = [1]> then\n                    change [touch v] by (1)\n                    if <(MOUSE) = [1]> then\n                        set [_play v] to [1]\n                    end\n                end\n                point in direction ((90) + (((([sin v] of ((timer) * (100)) ) * (4)) * <(touch) < [1]>) + ((([sin v] of ((timer) * (100)) ) * (2)) * <(touch) > [1]>)))\n                set [ghost v] effect to ((30) - ((([sin v] of ((timer) * (50)) ) * (10)) + ((touch) * (8))))\n                set [size vel v] to ((size vel) + (((((90) + (<(touch) > [1]> * (15))) - (size)) * (0.4)) + (<not <(CHAPTER) = (last)>> * (10))))\n                set [last v] to (CHAPTER)\n                set size to ((size) + ((size vel) + ((([sin v] of ((timer) * (200)) ) * (4)) * <(touch) < [1]>))) %\n                set [size vel v] to ((size vel) * (0.8))\n                set [touch v] to ((touch) * (0.7))\n            else\n                point in direction (90)\n                set size to ((size) + (((70) - (size)) / (3))) %\n                set [ghost v] effect to (60)\n            end\n            switch costume to (join [play] ((item (item # of [dark] in [options # v]) of [options v]) + (1)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [map]> then\n    set ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [90] (join [chapter] (CHAPTER)) [80] [0] [15]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: ((0) + (item (X #) of [menu pos v])) y: ((10) + (item (Y #) of [menu pos v]))\n            show\n            box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [80] [50]\n            if <(collide) = [1]> then\n                set size to ((size) + (((95) - (size)) / (4))) %\n            else\n                set size to ((size) + (((80) - (size)) / (6))) %\n            end\n            if <(CHAPTER) < ((CHPT MAX) + (1))> then\n                switch costume to (join [chapter] (CHAPTER))\n            else\n                switch costume to (join [chapter] [0])\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [lock]> then\n    set ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [90] (join [locked] (CHAPTER)) [80] [0] [20]\n    forever\n        if <(_PLAY) = [0]> then\n            if <<(CHAPTER) = [3]> and <not <(COINS) > ((2) - (1))>>> then\n                go to x: ((0) + (item (X #) of [menu pos v])) y: ((10) + (item (Y #) of [menu pos v]))\n                show\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [80] [50]\n                if <(collide) = [1]> then\n                    set size to ((size) + (((95) - (size)) / (4))) %\n                else\n                    set size to ((size) + (((80) - (size)) / (6))) %\n                end\n                switch costume to (join [locked] (CHAPTER))\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [text]> then\n    set ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [90] (join [text] (CHAPTER)) [80] [0] [60]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: ((0) + (item (X #) of [menu pos v])) y: ((10) + (item (Y #) of [menu pos v]))\n            show\n            box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [80] [50]\n            if <(collide) = [1]> then\n                set size to ((size) + (((95) - (size)) / (4))) %\n            else\n                set size to ((size) + (((80) - (size)) / (6))) %\n            end\n            if <(CHAPTER) < ((CHPT MAX) + (1))> then\n                switch costume to (join [text] (CHAPTER))\n            else\n                switch costume to (join [text] [0])\n            end\n            set [ghost v] effect to ((size) - (10))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [arrow] [1])> then\n    set ((-115) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [90] (join [arrow] (join (join [1] [-]) ((item (2) of [options v]) + (1)))) [110] [0] [30]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: (((-115) + (toggle)) + (item (X #) of [menu pos v])) y: ((10) + (item (Y #) of [menu pos v]))\n            show\n            if <not <(CHAPTER) = [1]>> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((-115) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [20] [20]\n                if <(collide) = [1]> then\n                    set [brightness v] effect to (3)\n                    if <(MOUSE) = [1]> then\n                        change [chapter v] by (-1)\n                        change [toggle v] by (-10)\n                    end\n                else\n                    set [brightness v] effect to (0)\n                end\n                set [ghost v] effect to (20)\n            else\n                set [ghost v] effect to (60)\n            end\n            set [toggle v] to ((toggle) * (0.7))\n        else\n            hide\n        end\n        switch costume to (join [arrow] (join (join [1] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [arrow] [2])> then\n    set ((115) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [90] (join [arrow] (join (join [2] [-]) ((item (2) of [options v]) + (1)))) [110] [0] [30]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: (((115) + (toggle)) + (item (X #) of [menu pos v])) y: ((10) + (item (Y #) of [menu pos v]))\n            show\n            if <(CHAPTER) < ((CHPT MAX) + (1))> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) ((115) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [20] [20]\n                if <(collide) = [1]> then\n                    set [brightness v] effect to (3)\n                    if <(MOUSE) = [1]> then\n                        change [chapter v] by (1)\n                        change [toggle v] by (10)\n                    end\n                else\n                    set [brightness v] effect to (0)\n                end\n                set [ghost v] effect to (20)\n            else\n                set [ghost v] effect to (60)\n            end\n            set [toggle v] to ((toggle) * (0.7))\n        else\n            hide\n        end\n        switch costume to (join [arrow] (join (join [2] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = [music]> then\n    set [198] [168] [90] (join [music] [1]) [30] [99] [20]\n    if <(V MUS) = [1]> then\n        set [switch v] to [0]\n    else\n        set [switch v] to [1]\n    end\n    forever\n        go to x: (198) y: (168)\n        show\n        box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) [198] [168] [10] [10]\n        if <(collide) = [1]> then\n            set [brightness v] effect to (5)\n            if <(MOUSE) = [1]> then\n                if <(switch) = [1]> then\n                    set [switch v] to [0]\n                    set [v mus v] to [1]\n                else\n                    set [switch v] to [1]\n                    set [v mus v] to [0]\n                end\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n        switch costume to (join [music] (((V MUS) * (-1)) + (2)))\n    end\nend\nif <(clone) = [fx]> then\n    set [224] [168] [90] (join [fx] [1]) [35] [99] [20]\n    if <(V FX) = [1]> then\n        set [switch v] to [0]\n    else\n        set [switch v] to [1]\n    end\n    forever\n        go to x: (224) y: (168)\n        show\n        box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) [224] [168] [15] [9]\n        if <(collide) = [1]> then\n            set [brightness v] effect to (5)\n            if <(MOUSE) = [1]> then\n                if <(switch) = [1]> then\n                    set [switch v] to [0]\n                    set [v fx v] to [1]\n                else\n                    set [switch v] to [1]\n                    set [v fx v] to [0]\n                end\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n        switch costume to (join [fx] (((V FX) * (-1)) + (2)))\n    end\nend\nif <(clone) = [cover]> then\n    set [0] [0] [90] [cover] [100] [9] [50]\n    show\nend\nif <(clone) = (join [info] [1])> then\n    set [-210] [-150] [90] (join [icon] [1]) [10] [0] [20]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(CHAPTER) < ((CHPT MAX) + (1))> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) [-210] [-150] [20] [20]\n                if <(collide) = [1]> then\n                    set [show info v] to [1]\n                    set [ghost v] effect to (10)\n                    set size to ((size) + (((80) - (size)) / (3))) %\n                else\n                    set [show info v] to [0]\n                    set [ghost v] effect to (20)\n                    set size to ((size) + (((90) - (size)) / (5))) %\n                end\n            else\n                set [ghost v] effect to (40)\n            end\n            if <<(CHAPTER) < ((CHPT MAX) + (1))> and <not <(CHAPTER) = (last)>>> then\n                change [touch v] by (15)\n            end\n            set [last v] to (CHAPTER)\n            set [touch v] to ((touch) * (0.4))\n            change size by (touch)\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [info] [2])> then\n    set [-175] [-70] [90] (join [info] (CHAPTER)) [95] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW INFO) = [1]> then\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            switch costume to (join [info] (CHAPTER))\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [wr] [1])> then\n    set [-160] [-150] [90] (join [icon] [2]) [10] [0] [20]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(CHAPTER) < ((CHPT MAX) + (1))> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) [-160] [-150] [20] [20]\n                if <(collide) = [1]> then\n                    set [show wr v] to [1]\n                    set [ghost v] effect to (10)\n                    set size to ((size) + (((80) - (size)) / (3))) %\n                else\n                    set [show wr v] to [0]\n                    set [ghost v] effect to (20)\n                    set size to ((size) + (((90) - (size)) / (5))) %\n                end\n            else\n                set [ghost v] effect to (40)\n            end\n            if <<(CHAPTER) < ((CHPT MAX) + (1))> and <not <(CHAPTER) = (last)>>> then\n                change [touch v] by (15)\n            end\n            set [last v] to (CHAPTER)\n            set [touch v] to ((touch) * (0.4))\n            change size by (touch)\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [wr] [2])> then\n    set [-175] [-95] [90] (join [wr] (length of (☁ WR1))) [95] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW WR) = [1]> then\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            if <(CHAPTER) = [1]> then\n                set [record v] to (☁ WR1)\n            end\n            if <(CHAPTER) = [2]> then\n                set [record v] to (☁ WR2)\n            end\n            switch costume to (join [wr] (length of (record)))\n            set [wr ghost v] to ((100) - ((touch) * (2)))\n            set [ghost v] effect to (WR GHOST)\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [glow]> then\n    set ((0) + (item (X #) of [menu pos v])) ((10) + (item (Y #) of [menu pos v])) [90] [glow] [100] [-99] [90]\n    set [tick v] to [0]\n    forever\n        if <(_PLAY) = [0]> then\n            go to x: ((0) + (item (X #) of [menu pos v])) y: ((10) + (item (Y #) of [menu pos v]))\n            point in direction (((tick) + ([abs v] of (([sin v] of ((tick) * (8)) ) * (2)) )) mod (360))\n            set size to ((400) + (([sin v] of ((tick) * (8)) ) * (25))) %\n            show\n            change [tick v] by (1)\n        else\n            hide\n        end\n    end\nend\n\ndefine clones\nclone [title]\nclone [combo]\nclone [play]\nclone [map]\nclone [lock]\nclone (join [arrow] [1])\nclone (join [arrow] [2])\nclone [text]\nclone [music]\nclone [fx]\nclone [cover]\nclone (join [info] [1])\nclone (join [info] [2])\nclone (join [wr] [1])\nclone (join [wr] [2])\nclone [glow]\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [buttons v]\nclones\n\nwhen I receive [start v]\nrepeat until <(_PLAY) = [1]>\n    if <key (space v) pressed?> then\n        set [space v] to [1]\n        wait (0) seconds\n        set [space v] to [0]\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\n@buttons2\n\ndefine box collide (x1) (y1) (x2) (y2) (w) (h)\nif <([abs v] of ((x1) - (x2)) ) < ((w) + (1))> then\n    if <([abs v] of ((y1) - (y2)) ) < ((h) + (1))> then\n        set [collide v] to [1]\n    else\n        set [collide v] to [0]\n    end\nelse\n    set [collide v] to [0]\nend\n\nwhen I receive [setup v]\nsetup\n\ndefine setup\nhide\n\ndefine clone (id)\nset [clone v] to (id)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(clone) = (join [options] [1])> then\n    set [210] [-150] [90] (join [symbol] [3]) [10] [0] [20]\n    set [show opt v] to [0]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) [210] [-150] [20] [20]\n            if <(collide) = [1]> then\n                set [ghost v] effect to (10)\n                set size to ((size) + (((80) - (size)) / (3))) %\n                if <(MOUSE) = [1]> then\n                    if <(SHOW OPT) = [1]> then\n                        set [show opt v] to [0]\n                    else\n                        set [show opt v] to [1]\n                    end\n                    set size to ((size) + (((70) - (size)) / (2))) %\n                end\n            else\n                set [ghost v] effect to (20)\n                set size to ((size) + (((90) - (size)) / (5))) %\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [options] [2])> then\n    set [175] [-70] [90] [options] [95] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW OPT) = [1]> then\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [checkbox] [1])> then\n    set [box x v] to [220]\n    set [box y first v] to [-35]\n    set [box y add v] to [17.5]\n    set (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((1) - (1)))) [90] (join [checkbox] ((item (item # of [grid] in [options # v]) of [options v]) + (1))) [50] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW OPT) = [1]> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((1) - (1)))) [8] [8]\n                if <(collide) = [1]> then\n                    if <(MOUSE) = [1]> then\n                        if <(item (item # of [grid] in [options # v]) of [options v]) = [1]> then\n                            replace item (item # of [grid] in [options # v]) of [options v] with [0]\n                        else\n                            replace item (item # of [grid] in [options # v]) of [options v] with [1]\n                        end\n                    end\n                    set [brightness v] effect to (10)\n                else\n                    set [brightness v] effect to (0)\n                end\n                switch costume to (join [checkbox] ((item (item # of [grid] in [options # v]) of [options v]) + (1)))\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [checkbox] [2])> then\n    set (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((2) - (1)))) [90] (join [checkbox] ((item (item # of [dark] in [options # v]) of [options v]) + (1))) [50] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW OPT) = [1]> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((2) - (1)))) [8] [8]\n                if <(collide) = [1]> then\n                    if <(MOUSE) = [1]> then\n                        if <(item (item # of [dark] in [options # v]) of [options v]) = [1]> then\n                            replace item (item # of [dark] in [options # v]) of [options v] with [0]\n                        else\n                            replace item (item # of [dark] in [options # v]) of [options v] with [1]\n                        end\n                    end\n                    set [brightness v] effect to (10)\n                else\n                    set [brightness v] effect to (0)\n                end\n                switch costume to (join [checkbox] ((item (item # of [dark] in [options # v]) of [options v]) + (1)))\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [checkbox] [3])> then\n    set (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((3) - (1)))) [90] (join [checkbox] ((item (item # of [hitbox] in [options # v]) of [options v]) + (1))) [50] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW OPT) = [1]> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((3) - (1)))) [8] [8]\n                if <(collide) = [1]> then\n                    if <(MOUSE) = [1]> then\n                        if <(item (item # of [hitbox] in [options # v]) of [options v]) = [1]> then\n                            replace item (item # of [hitbox] in [options # v]) of [options v] with [0]\n                        else\n                            replace item (item # of [hitbox] in [options # v]) of [options v] with [1]\n                        end\n                    end\n                    set [brightness v] effect to (10)\n                else\n                    set [brightness v] effect to (0)\n                end\n                switch costume to (join [checkbox] ((item (item # of [hitbox] in [options # v]) of [options v]) + (1)))\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [checkbox] [4])> then\n    set [220] ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((4) - (1)))) [90] (join [checkbox] ((item (item # of [speed run] in [options # v]) of [options v]) + (1))) [50] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW OPT) = [1]> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((4) - (1)))) [8] [8]\n                if <(collide) = [1]> then\n                    if <(MOUSE) = [1]> then\n                        if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                            replace item (item # of [speed run] in [options # v]) of [options v] with [0]\n                        else\n                            replace item (item # of [speed run] in [options # v]) of [options v] with [1]\n                        end\n                    end\n                    set [brightness v] effect to (10)\n                else\n                    set [brightness v] effect to (0)\n                end\n                switch costume to (join [checkbox] ((item (item # of [speed run] in [options # v]) of [options v]) + (1)))\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [checkbox] [5])> then\n    set [220] ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((5) - (1)))) [90] (join [checkbox] ((item (item # of [key stroke] in [options # v]) of [options v]) + (1))) [50] [0] [100]\n    forever\n        if <(_PLAY) = [0]> then\n            show\n            if <(SHOW OPT) = [1]> then\n                box collide (item (X #) of [mouse pos v]) (item (Y #) of [mouse pos v]) (BOX X) ((BOX Y FIRST) + (((BOX Y ADD) * (-1)) * ((5) - (1)))) [8] [8]\n                if <(collide) = [1]> then\n                    if <(MOUSE) = [1]> then\n                        if <(item (item # of [key stroke] in [options # v]) of [options v]) = [1]> then\n                            replace item (item # of [key stroke] in [options # v]) of [options v] with [0]\n                        else\n                            replace item (item # of [key stroke] in [options # v]) of [options v] with [1]\n                        end\n                    end\n                    set [brightness v] effect to (10)\n                else\n                    set [brightness v] effect to (0)\n                end\n                switch costume to (join [checkbox] ((item (item # of [key stroke] in [options # v]) of [options v]) + (1)))\n                if <(touch) < [30]> then\n                    change [touch v] by (5)\n                end\n            else\n                if <(touch) > [0]> then\n                    change [touch v] by (-5)\n                end\n            end\n            set [ghost v] effect to ((100) - ((touch) * (2)))\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [number] [1])> then\n    set [0] [50] [90] (join [number] (join (join [1] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1)))) [300] [0] [100]\n    set [set play v] to [1]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                if <<(DIE) = [1]> or <(set play) = [1]>> then\n                    if <(DIE) = [1]> then\n                        wait (1.5) seconds\n                    end\n                    wait (0.1) seconds\n                    wait (2) seconds\n                    show\n                    set [ghost v] effect to (0)\n                    start sound [count down v]\n                    wait (0.5) seconds\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    if <(DIE) = [1]> then\n                        wait until <not <(DIE) = [1]>>\n                    end\n                end\n                set [set play v] to [0]\n            end\n        else\n            hide\n        end\n        switch costume to (join [number] (join (join [1] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [number] [2])> then\n    set [0] [50] [90] (join [number] (join (join [2] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1)))) [300] [0] [100]\n    set [set play v] to [1]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                if <<(DIE) = [1]> or <(set play) = [1]>> then\n                    if <(DIE) = [1]> then\n                        wait (1.5) seconds\n                    end\n                    wait (0.1) seconds\n                    wait (1) seconds\n                    show\n                    set [ghost v] effect to (0)\n                    start sound [count down v]\n                    wait (0.5) seconds\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    if <(DIE) = [1]> then\n                        wait until <not <(DIE) = [1]>>\n                    end\n                end\n                set [set play v] to [0]\n            end\n        else\n            hide\n        end\n        switch costume to (join [number] (join (join [2] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [number] [3])> then\n    set [0] [50] [90] (join [number] (join (join [3] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1)))) [300] [0] [100]\n    set [set play v] to [1]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                if <<(DIE) = [1]> or <(set play) = [1]>> then\n                    if <(DIE) = [1]> then\n                        wait (1.5) seconds\n                    end\n                    wait (0.1) seconds\n                    show\n                    set [ghost v] effect to (0)\n                    start sound [count down v]\n                    wait (0.5) seconds\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    if <(DIE) = [1]> then\n                        wait until <not <(DIE) = [1]>>\n                    end\n                end\n                set [set play v] to [0]\n            end\n        else\n            hide\n        end\n        switch costume to (join [number] (join (join [3] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [number] [1])> then\n    set [0] [50] [90] (join [number] (join (join [1] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1)))) [300] [0] [100]\n    set [set play v] to [1]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                if <<(DIE) = [1]> or <(set play) = [1]>> then\n                    if <(DIE) = [1]> then\n                        wait (1.5) seconds\n                    end\n                    wait (0.1) seconds\n                    wait (2) seconds\n                    show\n                    set [ghost v] effect to (0)\n                    start sound [count down v]\n                    wait (0.5) seconds\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    if <(DIE) = [1]> then\n                        wait until <not <(DIE) = [1]>>\n                    end\n                end\n                set [set play v] to [0]\n            end\n        else\n            hide\n        end\n        switch costume to (join [number] (join (join [1] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [number] [2])> then\n    set [0] [50] [90] (join [number] (join (join [2] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1)))) [300] [0] [100]\n    set [set play v] to [1]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                if <<(DIE) = [1]> or <(set play) = [1]>> then\n                    if <(DIE) = [1]> then\n                        wait (1.5) seconds\n                    end\n                    wait (0.1) seconds\n                    wait (1) seconds\n                    show\n                    set [ghost v] effect to (0)\n                    start sound [count down v]\n                    wait (0.5) seconds\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    if <(DIE) = [1]> then\n                        wait until <not <(DIE) = [1]>>\n                    end\n                end\n                set [set play v] to [0]\n            end\n        else\n            hide\n        end\n        switch costume to (join [number] (join (join [2] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [number] [3])> then\n    set [0] [50] [90] (join [number] (join (join [3] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1)))) [300] [0] [100]\n    set [set play v] to [1]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [speed run] in [options # v]) of [options v]) = [1]> then\n                if <<(DIE) = [1]> or <(set play) = [1]>> then\n                    if <(DIE) = [1]> then\n                        wait (1.5) seconds\n                    end\n                    wait (0.1) seconds\n                    show\n                    set [ghost v] effect to (0)\n                    start sound [count down v]\n                    wait (0.5) seconds\n                    repeat (10)\n                        change [ghost v] effect by (10)\n                    end\n                    if <(DIE) = [1]> then\n                        wait until <not <(DIE) = [1]>>\n                    end\n                end\n                set [set play v] to [0]\n            end\n        else\n            hide\n        end\n        switch costume to (join [number] (join (join [3] [-]) ((item (item # of [dark] in [options # v]) of [options v]) + (1))))\n    end\nend\nif <(clone) = (join [key] [1])> then\n    set [-175] [-115] [0] [key] [100] [99] [40]\n    forever\n        if <(_PLAY) = [1]> then\n            show\n            if <(item (item # of [key stroke] in [options # v]) of [options v]) = [1]> then\n                if <<[key press v] contains (join [up] [1])?> or <[key press v] contains (join [up] [2])?>> then\n                    change [size vel v] by (-3)\n                    if <(touch) < [10]> then\n                        change [touch v] by (5)\n                    end\n                else\n                    if <(touch) > [0]> then\n                        change [touch v] by (-1)\n                    end\n                end\n                change [size vel v] by (((100) - (size)) * (0.3))\n                change size by (size vel)\n                set [size vel v] to ((size vel) * (0.7))\n                set [brightness v] effect to (touch)\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [key] [2])> then\n    set [-175] [-155] [-180] [key] [100] [99] [40]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [key stroke] in [options # v]) of [options v]) = [1]> then\n                show\n                if <<[key press v] contains (join [down] [1])?> or <[key press v] contains (join [down] [2])?>> then\n                    change [size vel v] by (-3)\n                    if <(touch) < [10]> then\n                        change [touch v] by (5)\n                    end\n                else\n                    if <(touch) > [0]> then\n                        change [touch v] by (-1)\n                    end\n                end\n                change [size vel v] by (((100) - (size)) * (0.3))\n                change size by (size vel)\n                set [size vel v] to ((size vel) * (0.7))\n                set [brightness v] effect to (touch)\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [key] [3])> then\n    set [-215] [-155] [-90] [key] [100] [99] [40]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [key stroke] in [options # v]) of [options v]) = [1]> then\n                show\n                if <<[key press v] contains (join [left] [1])?> or <[key press v] contains (join [left] [2])?>> then\n                    change [size vel v] by (-3)\n                    if <(touch) < [10]> then\n                        change [touch v] by (5)\n                    end\n                else\n                    if <(touch) > [0]> then\n                        change [touch v] by (-1)\n                    end\n                end\n                change [size vel v] by (((100) - (size)) * (0.3))\n                change size by (size vel)\n                set [size vel v] to ((size vel) * (0.7))\n                set [brightness v] effect to (touch)\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = (join [key] [4])> then\n    set [-135] [-155] [90] [key] [100] [99] [40]\n    forever\n        if <(_PLAY) = [1]> then\n            if <(item (item # of [key stroke] in [options # v]) of [options v]) = [1]> then\n                show\n                if <<[key press v] contains (join [right] [1])?> or <[key press v] contains (join [right] [2])?>> then\n                    change [size vel v] by (-3)\n                    if <(touch) < [10]> then\n                        change [touch v] by (5)\n                    end\n                else\n                    if <(touch) > [0]> then\n                        change [touch v] by (-1)\n                    end\n                end\n                change [size vel v] by (((100) - (size)) * (0.3))\n                change size by (size vel)\n                set [size vel v] to ((size vel) * (0.7))\n                set [brightness v] effect to (touch)\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\nif <(clone) = [dark]> then\n    set [0] [0] [90] [dark] [100] [99] [60]\n    forever\n        if <(item (item # of [dark] in [options # v]) of [options v]) = [1]> then\n            show\n        else\n            hide\n        end\n    end\nend\n\ndefine clones\nclone (join [options] [1])\nclone (join [options] [2])\nclone (join [checkbox] [1])\nclone (join [checkbox] [2])\nclone (join [checkbox] [3])\nclone (join [checkbox] [4])\nclone (join [checkbox] [5])\nclone (join [number] [1])\nclone (join [number] [2])\nclone (join [number] [3])\nclone (join [key] [1])\nclone (join [key] [2])\nclone (join [key] [3])\nclone (join [key] [4])\nclone [dark]\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [buttons v]\nclones\n\n@wr\n\nwhen I receive [setup v]\nhide\n\nwhen I start as a clone\nrepeat until <(_PLAY) = [1]>\n    if <(SHOW WR) = [1]> then\n        print [-225] [-105] [100] [13] (digit) (record)\n        if <(CHAPTER) = [1]> then\n            set [record v] to (☁ WR1)\n        end\n        if <(CHAPTER) = [2]> then\n            set [record v] to (☁ WR2)\n        end\n        if <(CHAPTER) = [3]> then\n            set [record v] to (☁ WR3)\n        end\n        set [ghost v] effect to (WR GHOST)\n    else\n        hide\n    end\nend\ndelete this clone\n\ndefine clones\nset [digit v] to [1]\nrepeat (10)\n    create clone of (_myself_ v)\n    change [digit v] by (1)\nend\n\ndefine print (x) (y) (size) (space) (var1) (var2)\nset size to (size) %\ngo to x: (((var1) * (space)) + (x)) y: (y)\nif <(length of (var2)) < (var1)> then\n    hide\nelse\n    switch costume to (letter (var1) of (var2))\n    show\nend\n\nwhen I receive [start v]\nclones\n\n@platformes\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [0] [0] [1]\n    clone [340] [0] [2]\n    clone [600] [0] [3]\n    clone [600] [400] [4]\n    clone [-400] [0] [5]\n    clone [1150] [0] [6]\n    clone [1650] [0] [7]\n    clone [2200] [0] [8]\n    clone [2650] [0] [9]\n    clone [3300] [0] [10]\n    clone [3800] [0] [11]\n    clone [4200] [0] [12]\nend\nif <(CHAPTER) = [2]> then\n    clone [0] [0] [1]\n    clone [600] [0] [2]\n    clone [-650] [0] [3]\n    clone [1100] [0] [4]\n    clone [1600] [0] [5]\n    clone [2000] [0] [6]\n    clone [2500] [0] [7]\n    clone [3100] [0] [8]\nend\nif <(CHAPTER) = [3]> then\n    clone [0] [0] [1]\n    clone [400] [0] [2]\n    clone [600] [0] [3]\nend\nset [x v] to [-99999]\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine clone (x) (y) (id)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (join (join [platform] (join (CHAPTER) [-])) (id))\ncreate clone of (_myself_ v)\n\nwhen I receive [game reset v]\ndelete this clone\n\nwhen I receive [setup v]\nhide\n\n@text\n\ndefine clone (x) (y) (id)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (join (join [text] (join (CHAPTER) [-])) (id))\nset size to (80) %\ngo to [back v] layer\nset [ghost v] effect to (40)\ncreate clone of (_myself_ v)\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [50] [100] [1]\n    clone [700] [120] [2]\n    clone [650] [580] [3]\n    clone [1070] [100] [4]\n    clone [1425] [70] [5]\n    clone [1750] [60] [6]\n    clone [1930] [80] [7]\n    clone [2860] [100] [8]\n    clone [3950] [80] [9]\nend\nif <(CHAPTER) = [2]> then\n    clone [100] [80] [1]\n    clone [400] [90] [2]\n    clone [-200] [120] [3]\n    clone [-500] [60] [4]\n    clone [900] [170] [5]\n    clone [2300] [90] [7]\nend\nif <(CHAPTER) = [3]> then\n    clone [-100] [80] [1]\n    clone [200] [130] [2]\nend\nset [x v] to [-99999]\n\nwhen I receive [game reset v]\ndelete this clone\n\ndefine pos (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\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\n@spike\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine pos (x) (y)\nif <(id) = (join [spike] [1])> then\n    set [move v] to [0]\n    turn right (3) degrees\n    switch costume to (spike v)\n    set size to (100) %\nend\nif <(id) = (join [spike] [2])> then\n    set [move v] to [0]\n    turn right (5) degrees\n    switch costume to (spike v)\n    set size to (50) %\nend\nif <(id) = (join [spike] [3])> then\n    set [move v] to (([cos v] of ((timer) * (30)) ) * (60))\n    turn right (3) degrees\n    switch costume to (spike v)\n    set size to (100) %\nend\ngo to x: ((x) + (move)) y: (y)\ngo to [back v] layer\nif <<((x) + (move)) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [-100] [80] [2]\n    clone [700] [-25] [1]\n    clone [1538] [127] [2]\n    clone [2230] [-88] [3]\n    clone [2950] [-50] [3]\n    clone [3770] [-40] [1]\nend\nif <(CHAPTER) = [2]> then\n    clone [-85] [-15] [2]\n    clone [700] [135] [1]\n    clone [1000] [-110] [2]\n    clone [1150] [-110] [2]\nend\nif <(CHAPTER) = [3]> then\nend\nset [x v] to [-99999]\n\ndefine clone (x) (y) (id)\nset [x v] to (x)\nset [y v] to (y)\nset [id v] to (join [spike] (id))\ncreate clone of (_myself_ v)\n\nwhen I receive [game reset v]\ndelete this clone\n\nwhen I receive [setup v]\nhide\n\n@coin\n\nwhen I receive [setup v]\nset [coins v] to [0]\nhide\n\ndefine clone (x) (y) (id)\nset [x v] to (x)\nset [y v] to (y)\nswitch costume to (join [coin] (id))\nset [ghost v] effect to (20)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) (((y) + (([sin v] of ((timer) * (50)) ) * (15))) - (SCROLL Y))\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nset size to (80) %\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nif <touching (player v)?> then\n    if <(costume [name v]) = (join [coin] [1])> then\n        change [coins v] by (1)\n    end\n    switch costume to (join [coin] [2])\nend\n\nwhen I receive [play v]\nif <(CHAPTER) = [1]> then\n    clone [725] [500] [1]\n    clone [-430] [110] [1]\nend\nif <(CHAPTER) = [2]> then\n    clone [-820] [5] [1]\nend\nif <(CHAPTER) = [3]> then\nend\nset [x v] to [-99999]\n\n@enemy\n\nwhen I receive [setup v]\nhide\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [1050] [-23] [0]\n    clone [1260] [-5] [4]\nend\nif <(CHAPTER) = [2]> then\n    clone [3150] [15] [0]\nend\nif <(CHAPTER) = [3]> then\nset [x v] to [-99999]\n\ndefine clone (x) (y) (add)\nset [x v] to (x)\nset [y v] to (y)\nset [add v] to (add)\nset size to (55) %\ncreate clone of (_myself_ v)\n\nwhen I receive [game reset v]\ndelete this clone\n\nwhen I receive [tick v]\npos (((x) + (([cos v] of (((timer) + (add)) * (70)) ) * (50))) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@bounce\n\nwhen I receive [start v]\nhide\n\nwhen I receive [game reset v]\ndelete this clone\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [438] [-129]\n    clone [515] [165]\n    clone [1485] [6]\nend\nif <(CHAPTER) = [2]> then\n    clone [1560] [-28]\n    clone [2130] [-93]\nend\nif <(CHAPTER) = [3]> then\nend\nset [x v] to [-99999]\n\ndefine clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) ((y) - (SCROLL Y))\ntouch\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine touch\nif <touching (player v)?> then\n    switch costume to (bounce2 v)\nelse\n    switch costume to (bounce1 v)\nend\n\n@water\n\nwhen I receive [setup v]\nhide\n\nwhen I receive [game reset v]\ndelete this clone\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [0] [-280] [0]\n    clone [0] [-280] [0.5]\n    clone [0] [-280] [1]\n    clone [-300] [-270] [0]\n    clone [-300] [-270] [0.5]\n    clone [-300] [-270] [1]\n    clone [3000] [-200] [0]\n    clone [3000] [-200] [0.5]\n    clone [3000] [-200] [1]\n    clone [4000] [-270] [0]\n    clone [4000] [-270] [0.5]\n    clone [4000] [-270] [1]\nend\nif <(CHAPTER) = [2]> then\nif <(CHAPTER) = [3]> then\nset [x v] to [-99999]\n\ndefine clone (x) (y) (add)\nset [x v] to (x)\nset [y v] to (y)\nset [add v] to (add)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) (((y) + (([sin v] of (((timer) + (add)) * (200)) ) * (20))) - (SCROLL Y))\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nset size to (100) %\ngo [backward v] (99) layers\nset [ghost v] effect to (70)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@lava\n\nwhen I receive [setup v]\nhide\n\nwhen I receive [game reset v]\ndelete this clone\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\nif <(CHAPTER) = [2]> then\nend\nif <(CHAPTER) = [3]> then\n    clone [300] [-300] [0]\n    clone [300] [-300] [0.5]\n    clone [300] [-300] [1]\n    clone [300] [-300] [1.5]\nend\nset [x v] to [-99999]\n\ndefine clone (x) (y) (add)\nset [x v] to (x)\nset [y v] to (y)\nset [add v] to (add)\ncreate clone of (_myself_ v)\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) (((y) + (([sin v] of (((timer) + (add)) * (80)) ) * (25))) - (SCROLL Y))\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nset size to (100) %\ngo [backward v] (99) layers\nset [ghost v] effect to (80)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\n@checkpoint\n\nwhen I receive [setup v]\ndelete all of [checkpoints1 v]\nlist [0] [0] [1]\nlist [1750] [-15] [1]\ndelete all of [checkpoints2 v]\nlist [40] [0] [2]\nlist [2055] [50] [2]\ndelete all of [checkpoints3 v]\nlist [-30] [70] [3]\nswitch costume to (join [flag] [1])\nhide\n\ndefine list (x) (y) (chapter)\nif <(chapter) = [1]> then\n    add (x) to [checkpoints1 v]\n    add (y) to [checkpoints1 v]\nend\nif <(chapter) = [2]> then\n    add (x) to [checkpoints2 v]\n    add (y) to [checkpoints2 v]\nend\nif <(chapter) = [3]> then\n    add (x) to [checkpoints3 v]\n    add (y) to [checkpoints3 v]\nend\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nset size to (70) %\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nif <<<touching (player v)?> and <(CHECKPOINT) = [1]>> and <(item (4) of [options v]) = [0]>> then\n    change [checkpoint v] by (2)\n    switch costume to (join [flag] [2])\nend\n\ndefine clone (x) (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    clone [1750] [-30]\nend\nif <(CHAPTER) = [2]> then\n    clone [2055] [45]\nend\nif <(CHAPTER) = [3]> then\nend\nset [x v] to [-99999]\n\nwhen I receive [game reset v]\ndelete this clone\n\n@finish\n\nwhen I receive [setup v]\nswitch costume to (join [flag] [1])\nhide\n\nwhen I receive [tick v]\npos ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine pos (x) (y)\ngo to x: (x) y: (y)\nset size to (120) %\ngo to [back v] layer\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\nif <<touching (player v)?> and <(WIN) = [0]>> then\n    set [win v] to [1]\n    switch costume to (join [flag] [2])\nend\n\nwhen I receive [game setup v]\nif <(CHAPTER) = [1]> then\n    set [x v] to [4200]\n    set [y v] to [90]\nend\nif <(CHAPTER) = [2]> then\nif <(CHAPTER) = [3]> then\n\nwhen I receive [game reset v]\nhide\n\n@particles\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [setup v]\nhide\n\nwhen I receive [start v]\nset [clone v] to [1]\nrepeat until <(_PLAY) = [1]>\n    create clone of (_myself_ v)\n    wait (pick random (0) to (0.2)) seconds\nend\n\nwhen I start as a clone\nif <(clone) = [1]> then\n    set [speed v] to (pick random (0.5) to (10))\n    show\n    set [-235] (pick random (-170) to (170)) [90] (join [dot] ((CHAPTER) * <(CHAPTER) < ((CHPT MAX) + (1))>)) (pick random (50) to (100)) [-99] (pick random (80) to (90))\n    repeat until <<(x position) > [235]> or <(_PLAY) = [1]>>\n        change x by (speed)\n    end\n    delete this clone\nelse\n    set [speed v] to (pick random (10) to (15))\n    show\n    set [235] (pick random (-170) to (170)) [90] (join [dot] [2]) (pick random (80) to (100)) [-99] (pick random (90) to (95))\n    set [y v] to (y position)\n    repeat until <<(x position) < [-235]> or <(WIN) = [1]>>\n        change x by ((speed) * (-1))\n        set y to ((y) - (SCROLL Y))\n    end\n    delete this clone\nend\n\nwhen I receive [play v]\nif <(CHAPTER) = [2]> then\n    set [clone v] to [2]\n    repeat until <(WIN) = [1]>\n        create clone of (_myself_ v)\n        wait (pick random (0.5) to (1)) seconds\n    end\nend\n\n@background\n\nwhen I receive [setup v]\nerase all\nset [-240] [0] [90] (join [grid] ((item (2) of [options v]) + (1))) [100] [999] [96]\nhide\n\ndefine grid (xl) (yl) (change)\ngo to x: (xl) y: (yl)\nrepeat (((yl) / (10)) + (1))\n    repeat (((xl) / (10)) + (1))\n        stamp\n        change x by ((change) * (-1))\n    end\n    set x to (xl)\n    change y by ((change) * (-1))\nend\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [start v]\nshow\nforever\n    if <(item (1) of [options v]) = [1]> then\n        erase all\n        switch costume to (join [grid] ((item (2) of [options v]) + (1)))\n        grid [240] [180] [20.01]\n    end\nend\n\n@intro\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [intro v]\nforever\n    if <(INTRO) > [-1]> then\n        if <(clone) = [1]> then\n            if <(INTRO) = ((5) * (30))> then\n                start sound [dont leave me v]\n                set size to (100) %\n            end\n            change [intro v] by (-1)\n            show\n        else\n            if <(INTRO) < [105]> then\n                if <(INTRO) < [7]> then\n                    change [intro size v] by ((((10) - (size)) * (0.3)) + (round ((INTRO) * (0.1))))\n                    point in direction (((90) - (0.5)) + ((pick random (((INTRO) / (17)) * (-1)) to ((INTRO) / (17))) * (0.4)))\n                    set [ghost v] effect to (round (((1) - ((size) / (100))) * (100)))\n                else\n                    change [intro size v] by ((((55) - (size)) * (0.5)) + (round ((INTRO) * (0.15))))\n                    point in direction (((90) - (2)) + ((pick random (((INTRO) / (10)) * (-1)) to ((INTRO) / (10))) * (0.5)))\n                    set [ghost v] effect to (0)\n                end\n                set x to (pick random (((INTRO) / (10)) * (-1)) to ((INTRO) / (10)))\n                set y to (pick random (((INTRO) / (10)) * (-1)) to ((INTRO) / (10)))\n                change size by ((INTRO SIZE) + (pick random (-5) to (5)))\n                set [intro size v] to ((INTRO SIZE) * (0.6))\n                if <(INTRO) = [104]> then\n                    change size by (25)\n                end\n                if <(INTRO) = [65]> then\n                    change size by (30)\n                end\n                if <(INTRO) = [19]> then\n                    change size by (10)\n                end\n                if <(INTRO) = [12]> then\n                    change [intro size v] by ((INTRO) / ((1) / (4)))\n                end\n                show\n            else\n                hide\n            end\n        end\n        set volume to ((round (((INTRO) / (4)) + (45))) * (V MUS)) %\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nset [clone v] to [2]\nset [0] [0] ((90) - (0.5)) [logo] [100] [99] [0]\nhide\n\nwhen I receive [setup v]\nstop all sounds\nset volume to (0) %\nset [intro v] to ((5) * (30))\nset [clone v] to [1]\nset [0] [0] [90] [background] [100] [99] [0]\ncreate clone of (_myself_ v)\n\nwhen I receive [intro v]\nrepeat until <(INTRO) < [0]>\n    if <key (space v) pressed?> then\n        stop all sounds\n        set [intro v] to [0]\n    end\nend\n\n@love + fav\n\nwhen I receive [setup v]\nset [-190] [180] [90] [pop up] [50] [99] [20]\nset [tick v] to [0]\nhide\n\nwhen I receive [start v]\nwait (0.5) seconds\nshow\nforever\n    set y to ((320) - ([abs v] of (([sin v] of (((tick) / (60)) * (40)) ) * (200)) ))\n    set size to (([abs v] of (([sin v] of (((tick) / (60)) * (40)) ) * (200)) ) - (130)) %\n    set [ghost v] effect to (round (((y position) * (2)) - (230)))\n    change [tick v] by (1)\nend\n\ndefine set (x) (y) (dir) (costume) (size) (layer) (ghost)\ngo to x: (x) y: (y)\npoint in direction (dir)\nswitch costume to (costume)\nset size to (size) %\ngo [forward v] (layer) layers\nset [ghost v] effect to (ghost)\n\nwhen I receive [play v]\nhide\n\n