Adventure, a scrolling platformer
@Stage\n\nwhen [f v] key pressed\nshow variable [collected v]\nshow variable [target v]\nshow variable [save code v]\nshow variable [player exit v]\nshow variable [scroll x v]\nshow variable [scroll y v]\nshow variable [fps v]\nshow variable [mouse v]\nshow variable [currentskin v]\nshow variable [collected max v]\nshow variable [level v]\nshow variable [menu v]\nwait (0.1) seconds\nwait until <key (f v) pressed?>\nhide variable [collected v]\nhide variable [target v]\nhide variable [save code v]\nhide variable [player exit v]\nhide variable [mouse v]\nhide variable [fps v]\nhide variable [scroll x v]\nhide variable [scroll y v]\nhide variable [currentskin v]\nhide variable [collected max v]\nhide variable [level v]\nhide variable [menu v]\n\nwhen flag clicked\ndelete all of [levels v]\nset [$ v] to [0]\nhide variable [collected v]\nhide variable [collected max v]\nhide variable [$ v]\nset [level v] to [0]\nDo sounds and variables\nwait (1.4) seconds\nswitch backdrop to (menu level 1 v)\nif <(username) = [maxb196]> then\n    set [currentskin v] to [7]\nend\n\nwhen I receive [play game v]\nstop all sounds\n\nwhen I receive [menu open v]\nwait (.1) seconds\nstop all sounds\nwait until <(MENU) = [False]>\n\nwhen I receive [credits v]\nswitch backdrop to (credits v)\nstop all sounds\n\nwhen flag clicked\nforever\n    if <(MENU) = [True]> then\n        switch backdrop to (menu level 1 v)\n        play sound [Main Menu v] until done\n    else\n        if <(LEVEL) = [1]> then\n            play sound [Level 1 v] until done\n        end\n        if <(LEVEL) = [2]> then\n            play sound [Level 2 v] until done\n        end\n        if <(LEVEL) = [3]> then\n            play sound [Level 3 v] until done\n        end\n        if <(LEVEL) = [4]> then\n            play sound [Level 4 v] until done\n        end\n        if <(LEVEL) = [5]> then\n            play sound [Level 5 v] until done\n        end\n        if <(LEVEL) = [6]> then\n            play sound [Level 6 v] until done\n        end\n        if <(LEVEL) = [7]> then\n            play sound [Level 7 v] until done\n        end\n        if <(LEVEL) = [8]> then\n            play sound [Level 8 v] until done\n        end\n    end\n    if <(LEVEL) = [Credits]> then\n        play sound [Credits Music v] until done\n    end\nend\n\nwhen [m v] key pressed\nshow variable [mouse v]\nset [mouse v] to (join ((mouse x) + (SCROLL X)) (join [, ] ((mouse y) + (SCROLL Y))))\n\nwhen I receive [tick v]\nDo sounds and variables\n\ndefine Do sounds and variables\nset [display collected v] to (join (COLLECTED) (join [ / ] (COLLECTED MAX)))\nset [display target v] to (join (TARGET) (join [ / ] [8]))\nif <(MENU) = [True]> then\n    switch backdrop to (join [Menu Level ] (LevelHover))\n    set volume to (Background Music Volume) %\nelse\n    if <(LEVEL) = [1]> then\n        switch backdrop to (level1 v)\n    end\n    if <(LEVEL) = [2]> then\n        switch backdrop to (level2 v)\n    end\n    if <(LEVEL) = [3]> then\n        switch backdrop to (level3 v)\n    end\n    if <(LEVEL) = [4]> then\n        switch backdrop to (level4 v)\n    end\n    if <(LEVEL) = [5]> then\n        switch backdrop to (level5 v)\n    end\n    if <(LEVEL) = [6]> then\n        switch backdrop to (level6 v)\n    end\n    if <(LEVEL) = [7]> then\n        switch backdrop to (level7 v)\n    end\n    if <(LEVEL) = [8]> then\n        switch backdrop to (level8 v)\n    end\nend\nif <(LEVEL) = [Credits]> then\n    switch backdrop to (credits v)\nend\n\nwait (.1) seconds\n\n@Empty\n\n@Credits\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [credits v]\nswitch costume to (programming credits v)\nrepeat (25)\n    create clone of (_myself_ v)\n    next costume\n    wait (1) seconds\nend\nwait (6.5) seconds\nbroadcast (Menu Open v)\nset [menu v] to [True]\nbroadcast (Menu Update v)\nset [level v] to [0]\n\nwhen I start as a clone\nclear graphic effects\nshow\ngo to x: (0) y: (-180)\nrepeat (15)\n    change y by (2)\nend\nrepeat until <touching (_edge_ v)?>\n    change y by (2)\n    go to [front v] layer\nend\nrepeat (5)\n    change y by (2)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\ndelete this clone\n\n@To menu\n\nwhen flag clicked\ngo to x: (203) y: (170)\nhide\n\nwhen I receive [play game v]\nshow\n\nwhen this sprite clicked\nbroadcast (Menu Open v)\nbroadcast (Menu Update v)\nset [menu v] to [True]\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (7)\n            change size by (1)\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n        repeat (7)\n            change size by (-1)\n        end\n        set size to (50) %\n    end\n    go to [front v] layer\nend\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [credits v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nswitch costume to (thumbnail new v)\nshow\nwait (1.3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\n    go to [front v] layer\nend\n\nwhen I receive [play game v]\nclear graphic effects\nshow\nswitch costume to (thumbnail new v)\nwait (0.6) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nswitch costume to (thumbnail new v)\n\nwhen flag clicked\nbroadcast (Menu Open v)\n\n@Player\n\nwhen flag clicked\nset [currentskin v] to [1]\nhide\nhide variable [mouse v]\n\ndefine Game On\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [player exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\nset [scroll x v] to (CheckX)\nset [scroll y v] to (CheckY)\nset [x v] to (CheckX)\nset [y v] to (CheckY)\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nrepeat until <(MENU) = [False]>\n    Tick\n    broadcast (Tick v) and wait\nend\nforever\n    if <not <(LEVEL) = [Credits]>> then\n        broadcast (Reset v) and wait\n        broadcast (Setup v) and wait\n        Game On\n    end\n    repeat until <(Player EXIT) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(Player EXIT) = [win]> then\n        Game - Win\n    end\n    if <(Player EXIT) = [die]> then\n        Game - Die\n    end\nend\n\ndefine Tick\nswitch costume to (join [normal] (CurrentSkin))\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\n    switch costume to (join [left] (CurrentSkin))\n    point in direction (90)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [sx v] by (2)\n    switch costume to (join [right] (CurrentSkin))\n    point in direction (90)\nend\nif <(LEVEL) = [2]> then\n    set [sx v] to ((sx) * (0.84))\nelse\n    set [sx v] to ((sx) * (0.8))\nend\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <((mouse y) - (y position)) > [75]>>> then\n    if <<(IN AIR) < [4]> or <touching (bounce point v)?>> then\n        set [sy v] to [18]\n    end\n    if <touching (bounce point v)?> then\n        set [sx v] to ((sx) * (1.5))\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nPosition\nTest - Die\nset [scroll x v] to (x)\nif <(SCROLL X) < [5]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (9)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(MENU) = [False]> then\n    if <(y) < [-180]> then\n        set [player exit v] to [die]\n    end\nend\nif <(CurrentSkin) = [7]> then\n    change [color v] effect by (.5)\nelse\n    if <(CurrentSkin) = [6]> then\n        change [color v] effect by (.3)\n    else\n        set [color v] effect to (0)\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\nif <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n    show\n    go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\nelse\n    hide\nend\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nif <not <(LEVEL) = [Credits]>> then\n    start sound [Lose v]\n    repeat (4)\n        hide\n        wait (0.1) seconds\n        show\n        wait (0.1) seconds\n    end\n    hide\n    wait (0.5) seconds\n    set [player exit v] to []\nend\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [player exit v] to [die]\nend\nif <touching (attackthingboss v)?> then\n    set [player exit v] to [die]\n    broadcast (stop boss fight v)\nend\n\ndefine Game - Win\ngo to [front v] layer\nset [sy v] to [0]\nclear graphic effects\nrepeat (50)\n    change x by ((([x position v] of [next levels v]) - (x position)) / (4))\n    change y by (sy)\n    change [ghost v] effect by (2)\n    change [sy v] by (0.3)\n    if <touching (_edge_ v)?> then\n        change [ghost v] effect by (10)\n    end\nend\nhide\nclear graphic effects\nwait (1) seconds\nif <not <(LEVEL) = [8]>> then\n    add ((LEVEL) + (1)) to [levels v]\n    set [menu v] to [True]\n    broadcast (Menu Open v)\n    broadcast (Menu Update v)\nend\n\nwhen flag clicked\nset [counter v] to [0]\nreset timer\nforever\n    change [counter v] by (1)\n    if <(timer) > [1]> then\n        if <(DEBUG SCREEN) = [True]> then\n            reset timer\n        end\n        set [fps v] to ((Counter) / (2))\n        set [counter v] to [0]\n    end\nend\n\nwhen [f v] key pressed\nshow variable [checkx v]\nshow variable [checky v]\nshow variable [x v]\nshow variable [y v]\nshow variable [sx v]\nshow variable [sy v]\nshow variable [in air v]\nshow variable [debug screen v]\nset [debug screen v] to [True]\nwait (0.1) seconds\nwait until <key (f v) pressed?>\nhide variable [in air v]\nhide variable [x v]\nhide variable [y v]\nhide variable [sx v]\nhide variable [sy v]\nhide variable [checkx v]\nhide variable [checky v]\nhide variable [debug screen v]\nset [debug screen v] to [False]\n\nwhen I receive [setup v]\nset volume to (Sound Effects Volume) %\nwait (0.7) seconds\ngo to [front v] layer\n\nwhen [r v] key pressed\nbroadcast (Manual Reset v) and wait\nbroadcast (Reset v) and wait\nbroadcast (Setup v) and wait\n\n@Platforms\n\nwhen flag clicked\nhide\n\nwhen I receive [boss fight v]\ndelete this clone\n\nwhen I receive [credits v]\nhide\ndelete this clone\n\nwhen I start as a clone\ngo to [front v] layer\nset [prevcostume v] to (costume [name v])\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (level 2 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (level 3 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (level 4 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [180]\n    Clone at x: [360] y: [0]\n    Clone at x: [-360] y: [-540]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (level 5 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (level 6 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [-300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (level 7 1 v)\n    Clone at x: [360] y: [0]\n    repeat (6)\n        switch costume to (((pick random (24) to (26)) * (2)) + (1))\n        Clone at x: [360] y: [0]\n        Clone at x: [370] y: [0]\n    end\n    switch costume to (level 7 10 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (level 8 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nset [prevcostume v] to (costume [name v])\n\ndefine position (x) (y)\nswitch costume to (empty v)\nset size to (100) %\nswitch costume to (prevCostume)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\nif <<(dissapear frames) = [-1]> and <(letter (length of (costume [name v])) of (costume [name v])) = [x]>> then\n    change y by (2)\n    if <touching (player v)?> then\n        set [dissapear frames v] to [75]\n    end\n    change y by (-2)\nend\nif <(dissapear frames) > [-1]> then\n    change [dissapear frames v] by (-1)\n    if <(dissapear frames) < [51]> then\n        set [ghost v] effect to ([abs v] of ((100) - ((dissapear frames) * (2))) )\n        if <(dissapear frames) < [0]> then\n            delete this clone\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nset [dissapear frames v] to [-1]\nhide\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\ngo to [front v] layer\n\n@Danger\n\nwhen flag clicked\ngo to [back v] layer\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [credits 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 [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (level 3 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (level 6 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (level 4 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [180]\n    Clone at x: [360] y: [0]\n    Clone at x: [-360] y: [-540]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(MENU) = [False]> then\n        show\n    end\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@Boss Bar\n\ndefine position (x) (y)\nif <<(MENU) = [False]> and <(LEVEL) = [8]>> then\n    set [prev size v] to (size)\n    go to x: (x) y: (y)\n    set size to (10000000000000000000) %\n    set size to (Prev Size) %\nelse\n    hide\nend\n\nwhen I receive [boss fight v]\nset [x v] to [1446]\nset [y v] to [30]\nset [color v] effect to (80)\nswitch costume to (1 v)\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [targetet v]\nchange [color v] effect by (-10)\nnext costume\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nhide\n\n@Extra\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 [x v] to [0]\nset [y v] to [0]\ngo to [back v] layer\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (level 3 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (level 6 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (level 2 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [180]\n    Clone at x: [360] y: [0]\n    Clone at x: [-360] y: [-540]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [5]> then\nif <(LEVEL) = [6]> then\n    switch costume to (level 8 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [-300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (level 5 1 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (level 4 1 v)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ngo to [back v] layer\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [menu open v]\nhide\n\n@Background\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition (((x) - (SCROLL X)) / (2.5)) (((y) - (SCROLL Y)) / (2.5))\n\nwhen I receive [setup v]\nset size to (100) %\nhide\nset [x v] to [0]\nset [y v] to [0]\ngo to [back v] layer\nset [costume v] to (LEVEL)\nClone at x: [-200] y: [0]\nrepeat (15)\n    Clone at x: [900] y: [0]\nend\n\ndefine position (x) (y)\nswitch costume to (empty v)\nset size to (10000000000000000000) %\ngo to x: (x) y: (y)\nswitch costume to (join [level] (costume))\nset size to (100) %\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <(MENU) = [False]> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\ngo to [back v] layer\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nshow\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [credits v]\nhide\ndelete this clone\n\n@Skins\n\nwhen I receive [menu open v]\nshow\n\nwhen I receive [credits v]\nhide\n\nwhen flag clicked\nset [menu v] to [True]\nhide\ngo to x: (159) y: (-30)\nset [ghost v] effect to (100)\nshow\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nshow\nbroadcast (Open Skins v)\n\nwhen I receive [play game v]\nset [menu v] to [False]\nhide\nwait (1) seconds\nwait until <(MENU) = [True]>\nif <[levels v] contains [1]?> then\n    switch costume to (level v)\nelse\n    switch costume to (lock v)\nend\nshow\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n    end\nend\n\n@Next Levels\n\nwhen I receive [open portal v]\nset volume to (Sound Effects Volume) %\nif <(LEVEL) = [1]> then\n    switch costume to (open - snowy v)\nend\nif <(LEVEL) = [2]> then\n    switch costume to (open - cave v)\nend\nif <(LEVEL) = [3]> then\n    switch costume to (open - desert v)\nend\nif <(LEVEL) = [4]> then\n    switch costume to (open - clouds v)\nend\nif <(LEVEL) = [5]> then\n    switch costume to (open - jungle v)\nend\nif <(LEVEL) = [6]> then\n    switch costume to (open - mountains v)\nend\nif <(LEVEL) = [7]> then\n    switch costume to (open - lava v)\nend\nchange [$ v] by (round ((LEVEL) * (1.5)))\nstart sound [Win v]\nbroadcast (Game - Win v)\n\nwhen I receive [menu open v]\nhide\ndelete this clone\n\nwhen I receive [portal v]\nset [portal open v] to [2]\nswitch costume to (open - done v)\nClone at x: [1447] y: [90]\nset size to (1) %\nrepeat (5)\n    change size by (10)\nend\n\nwhen I receive [credits v]\nhide\ndelete this clone\n\nwhen flag clicked\nset [portal open v] to [1]\nset [effect? v] to [0]\nset [credits v] to [False]\n\ndefine Effect clone\nhide\nset [effect? v] to [1]\ncreate clone of (_myself_ v)\nset [effect? v] to [0]\nshow\n\nwhen I start as a clone\nhide\nset [ghost v] effect to (pick random (75) to (85))\nchange x by (pick random (-25) to (25))\nchange y by (10)\ngo to [front v] layer\nswitch costume to (((LEVEL) * (2)) + (4))\nshow\n\nwhen I receive [reset v]\nset [portal open v] to [1]\ndelete this clone\n\nwhen I receive [play game v]\nset volume to (Sound Effects Volume) %\n\nwhen I receive [green flag v]\nhide\ndelete this clone\n\nwhen I receive [tick v]\nif <(MENU) = [False]> then\n    position ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nelse\n    if <(Effect?) = [0]> then\n        set [credits v] to [False]\n    end\nend\n\nwhen I receive [setup v]\nset [portal open v] to [1]\nswitch costume to (closed v)\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [4629] y: [90]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (closed v)\n    Clone at x: [5211] y: [29]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (closed v)\n    Clone at x: [6072] y: [-85]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (closed v)\n    Clone at x: [2965] y: [-32]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (closed v)\n    Clone at x: [4934] y: [217]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (closed v)\n    Clone at x: [4303] y: [-93]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (closed v)\n    Clone at x: [4918] y: [-30]\nend\nif <(LEVEL) = [8]> then\n    switch costume to (closed v)\n    Clone at x: [-9999] y: [-9999]\nend\ngo to [front v] layer\ndelete this clone\n\ndefine position (x) (y)\nif <(Effect?) = [0]> then\n    if <not <(letter (1) of (costume [name v])) = [c]>> then\n        Effect clone\n    end\n    go to x: (x) y: (y)\n    if <<(x) = (x position)> and <(y) = (y position)>> then\n        if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n            go to [front v] layer\n            go [backward v] (3) layers\n            show\n        else\n            hide\n        end\n    else\n        hide\n    end\n    if <(Portal Open) > [1]> then\n        if <(size) < [100]> then\n            change size by (1)\n        end\n        if <touching (player v)?> then\n            set [level v] to [Credits]\n            broadcast (Credits v)\n            set [credits v] to [True]\n        end\n    else\n        if <<(costume [number v]) > [1]> and <touching (player v)?>> then\n            set [player exit v] to [win]\n        end\n    end\nelse\n    switch costume to (((LEVEL) * (2)) + (4))\n    change [ghost v] effect by (1)\n    change y by (10)\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    if <(CREDITS) = [True]> then\n        delete this clone\n    end\nend\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\n@Mini-Portals\n\nwhen I receive [menu open v]\nhide\n\nwhen I start as a clone\nLoop through dots\n\ndefine Loop through dots\nset [dot loop v] to [1]\nrepeat (length of [collected dots x v])\n    if <<(item (dot loop) of [collected dots x v]) = (x)> and <(item (dot loop) of [collected dots y v]) = (y)>> then\n        set [deleteable v] to [1]\n    end\n    change [dot loop v] by (1)\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [green flag v]\ndelete all of [collected dots x v]\ndelete all of [collected dots y v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [setup v]\nclear graphic effects\nhide\nset [collected v] to [0]\nset [collected max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (dot v)\nif <(LEVEL) = [1]> then\n    Clone at x: [389] y: [25]\n    Clone at x: [1080] y: [-101]\n    Clone at x: [1080] y: [10]\n    Clone at x: [2101] y: [-112]\n    Clone at x: [2568] y: [146]\n    Clone at x: [2972] y: [179]\n    Clone at x: [3980] y: [-53]\n    Clone at x: [4055] y: [-7]\n    Clone at x: [4055] y: [-53]\nend\nif <(LEVEL) = [2]> then\n    Clone at x: [292] y: [18]\n    Clone at x: [528] y: [60]\n    Clone at x: [375] y: [144]\n    Clone at x: [518] y: [244]\n    Clone at x: [937] y: [-116]\n    Clone at x: [1936] y: [-110]\n    Clone at x: [2098] y: [86]\n    Clone at x: [3008] y: [75]\n    Clone at x: [3239] y: [22]\n    Clone at x: [3598] y: [59]\n    Clone at x: [3946] y: [132]\n    Clone at x: [4314] y: [180]\n    Clone at x: [4671] y: [213]\n    Clone at x: [5027] y: [136]\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [239] y: [44]\n    Clone at x: [598] y: [-77]\n    Clone at x: [1084] y: [121]\n    Clone at x: [1725] y: [110]\n    Clone at x: [1821] y: [-110]\n    Clone at x: [2136] y: [-4]\n    Clone at x: [2579] y: [54]\n    Clone at x: [2776] y: [-79]\n    Clone at x: [2987] y: [20]\n    Clone at x: [3240] y: [-94]\n    Clone at x: [4216] y: [122]\n    Clone at x: [4641] y: [37]\n    Clone at x: [5139] y: [109]\n    Clone at x: [5594] y: [68]\n    Clone at x: [5714] y: [-14]\n    Clone at x: [5888] y: [-93]\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [1129] y: [503]\n    Clone at x: [1186] y: [505]\n    Clone at x: [767] y: [620]\n    Clone at x: [526] y: [371]\n    Clone at x: [178] y: [482]\n    Clone at x: [611] y: [580]\n    Clone at x: [168] y: [249]\n    Clone at x: [1067] y: [-96]\n    Clone at x: [1424] y: [153]\n    Clone at x: [2138] y: [-91]\n    Clone at x: [2092] y: [423]\n    Clone at x: [2708] y: [-16]\nend\nif <(LEVEL) = [5]> then\n    Clone at x: [362] y: [148]\n    Clone at x: [1466] y: [245]\n    Clone at x: [2109] y: [219]\n    Clone at x: [1270] y: [-147]\n    Clone at x: [2985] y: [352]\n    Clone at x: [3777] y: [128]\n    Clone at x: [5744] y: [-99]\n    Clone at x: [5744] y: [0]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [2600] y: [-25]\n    Clone at x: [2800] y: [-25]\n    Clone at x: [3000] y: [-25]\n    Clone at x: [3200] y: [-25]\n    Clone at x: [3772] y: [432]\n    Clone at x: [3444] y: [216]\n    Clone at x: [2383] y: [100]\n    Clone at x: [2383] y: [0]\n    Clone at x: [2383] y: [-100]\n    Clone at x: [1827] y: [471]\n    Clone at x: [1627] y: [146]\n    Clone at x: [360] y: [80]\n    Clone at x: [945] y: [77]\n    Clone at x: [576] y: [217r]\nend\nif <(LEVEL) = [7]> then\n    set [# v] to [1]\n    repeat (6)\n        Clone at x: (((#) * (720)) + (-520)) y: [-30]\n        change [# v] by (1)\n    end\nend\nif <(LEVEL) = [8]> then\n    Clone at x: [-99] y: [-99]\n    set [collected max v] to [0]\nend\nset [x v] to [-99999]\nwait (.1) seconds\ndelete all of [collected dots x v]\ndelete all of [collected dots y v]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\nset y to (((y) - (SCROLL Y)) + (([cos v] of (((timer) - (3)) * (400)) ) * (3)))\nif <touching (player v)?> then\n    set size to (100) %\n    clear graphic effects\n    change [collected v] by (1)\n    hide\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    add (x) to [collected dots x v]\n    add (y) to [collected dots y v]\n    delete this clone\nend\nif <(Deleteable) > [0]> then\n    change [deleteable v] by (1)\n    if <(Deleteable) > [15]> then\n        add (x) to [collected dots x v]\n        add (y) to [collected dots y v]\n        change [collected v] by (1)\n        if <(COLLECTED) = (COLLECTED MAX)> then\n            broadcast (Open Portal v)\n        end\n        delete this clone\n    end\nend\nLoop through dots\n\ndefine Clone at x: (x) y: (y)\nclear graphic effects\nset size to (100) %\nset [x v] to (x)\nset [y v] to (y)\nchange [collected max v] by (1)\nset [deleteable v] to [0]\ncreate clone of (_myself_ v)\n\nwhen I receive [game - win v]\ndelete this clone\n\n@Read Signs\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nSay\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\ngo to [front v] layer\ngo [backward v] (15) layers\nif <(LEVEL) = [1]> then\n    switch costume to (level 1 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [2]> then\n    switch costume to (level 3 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [3]> then\n    switch costume to (level 6 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (level 2 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [360]\n    Clone at x: [360] y: [180]\n    Clone at x: [360] y: [0]\n    Clone at x: [-360] y: [-540]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (level 7 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (level 8 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [0] y: [-300]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\nif <(LEVEL) = [7]> then\n    switch costume to (level 5 1 v)\nend\nif <(LEVEL) = [8]> then\n    switch costume to (level 4 1 v)\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\n    Clone at x: [360] y: [0]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\nnext costume\n\nwhen I receive [menu open v]\nhide\n\ndefine Say\nif <touching (player v)?> then\n    if <(LEVEL) = [1]> then\n        if <(costume [name v]) = [level 1 1]> then\n            say [Welcome to adventure: a scrolling platformer! Use arrow keys or w,a,d to move!]\n        end\n        if <(costume [name v]) = [level 1 2]> then\n            say [Collect all of the mini-portals to open the big portal at the end! You can see your progress left-hand corner.]\n        end\n        if <(costume [name v]) = [level 1 4]> then\n            say [Mini-portals are not always easy to find...]\n        end\n        if <(costume [name v]) = [level 1 5]> then\n            say [This is a checkpoint! Make it green to save your progress on a level when you die; like standing in the red lava over there...]\n        end\n        if <(costume [name v]) = [level 1 7]> then\n            say [Collect blue coins to buy stuff in the shop! Blue coins are not required to open the portal at the end! And if you complete a level, you get even more coins!]\n        end\n        if <(costume [name v]) = [level 1 8]> then\n            say [Pillar jumping!]\n        end\n        if <(costume [name v]) = [level 1 13]> then\n            say [Almost there...]\n        end\n    end\n    if <(LEVEL) = [4]> then\n        if <(costume [name v]) = [level 2 1]> then\n            say [A lot of mini-portals are everywhere... Should you go up?]\n        end\n        if <(costume [name v]) = [level 2 4]> then\n            say [Tricky jump... And a lot of mini-portals!]\n        end\n        if <(costume [name v]) = [level 2 5]> then\n            say [You made it to the top! Congrats!]\n        end\n        if <(costume [name v]) = [level 2 7]> then\n            say [A tricky jump with lava!]\n        end\n        if <(costume [name v]) = [level 2 11]> then\n            say [A loooooong jump!]\n        end\n    end\n    if <(LEVEL) = [2]> then\n        if <(costume [name v]) = [level 3 1]> then\n            say [Welcome to winter wonderland! Watch out, it's slippery!]\n        end\n        if <(costume [name v]) = [level 3 2]> then\n            say [Lots of mini-portals to collect in this level!]\n        end\n        if <(costume [name v]) = [level 3 4]> then\n            say [There are lots of hard jumps in this level as well!]\n        end\n        if <(costume [name v]) = [level 3 6]> then\n            say [Hint: There is a hidden mini-portal nearby...]\n        end\n        if <(costume [name v]) = [level 3 9]> then\n            say [Did you remember the pillar jumping from level 1? Harder version here...]\n        end\n        if <(costume [name v]) = [level 3 14]> then\n            say [Do you see the next platform?]\n        end\n    end\n    if <(LEVEL) = [8]> then\n        if <(costume [name v]) = [level 4 1]> then\n            say [It doesn't seem to be peaceful here... I think something is going to happen!]\n        end\n        if <(costume [name v]) = [level 4 2]> then\n            say [Tricky jumps!]\n        end\n        if <(costume [name v]) = [level 4 3]> then\n            say [You are going to fight the boss: go to it's weak points to destroy him! Dodge his attacks though... Many adventurers like you passed away here...]\n        end\n    end\n    if <(LEVEL) = [7]> then\n        if <(costume [name v]) = [level 5 1]> then\n            say [Finally... A peaceful level with no lava. After all your adventures so far, you've finally come across some high mountains.]\n        end\n    end\n    if <(LEVEL) = [3]> then\n        if <(costume [name v]) = [level 6 2]> then\n            say [Some say that the deep caves contain a lot of voids...]\n        end\n        if <(costume [name v]) = [level 6 6]> then\n            say [Lava is all around here! Be careful!]\n        end\n        if <(costume [name v]) = [level 6 10]> then\n            say [Those rumors about a deep void were true... Watch out!]\n        end\n        if <(costume [name v]) = [level 6 15]> then\n            say [Almost there, just a few more lava pools. Again, be careful!]\n        end\n    end\n    if <(LEVEL) = [5]> then\n        if <(costume [name v]) = [level 7 1]> then\n            say [It's very cloudy here! I hope that the clouds will last long enough for you to stand up on...]\n        end\n        if <(costume [name v]) = [level 7 3]> then\n            say [Watch out! Some other platforms might also be disappearing!]\n        end\n        if <(costume [name v]) = [level 7 6]> then\n            say [There's a secret portal in the opposite way you'd expect... \(go left\).]\n        end\n        if <(costume [name v]) = [level 7 8]> then\n            say [Tricky disappearing platform stairs...]\n        end\n    end\n    if <(LEVEL) = [6]> then\n        if <(costume [name v]) = [level 8 1]> then\n            say [These blobs give you an extra jump while being in the air! The closer you are in the center, the more boost you will get.]\n        end\n        if <(costume [name v]) = [level 8 8]> then\n            say [You made it down here... Nice!]\n        end\n        if <(costume [name v]) = [level 8 9]> then\n            say [Searching skills: 10/10]\n        end\n        if <(costume [name v]) = [level 8 10]> then\n            say [Bouncy parkour: bouncekour?]\n        end\n    end\nelse\n    say []\nend\n\n@Level Select\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nshow\nforever\n    if <[levels v] contains (ID)?> then\n        switch costume to (join [Level] (ID))\n        if <touching (mouse-pointer v)?> then\n            set [levelhover v] to (ID)\n            change size by (((85) - (size)) / (3))\n            set [ghost v] effect to (20)\n            point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n            switch backdrop to (join [Menu Level ] (ID))\n        else\n            point in direction (90)\n            change size by (((73) - (size)) / (3))\n        end\n    else\n        switch costume to (join [Lock] (ID))\n    end\n    if <<(LEVEL) = [Credits]> and <(MENU) = [False]>> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I receive [menu update v]\nif <(ID) = [0]> then\n    Create Level Icons\nend\n\nwhen I receive [menu update v]\ndelete this clone\n\nwhen flag clicked\nset [id v] to [0]\nwait (0.1) seconds\nadd [1] to [levels v]\nCreate Level Icons\n\nwhen this sprite clicked\nif <[levels v] contains (ID)?> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\n    clear graphic effects\n    set [level v] to (ID)\n    broadcast (Green Flag v)\n    broadcast (Play Game v)\nend\n\nwhen I receive [play game v]\ndelete this clone\n\ndefine Create Level Icons\nset [id v] to [0]\nset size to (73) %\ngo to x: (-35) y: (45)\nrepeat (4)\n    set x to (-105)\n    repeat (2)\n        change [id v] by (1)\n        change x by (70)\n        create clone of (_myself_ v)\n    end\n    change y by (-55)\nend\nset [id v] to [0]\n\n@Load\n\nwhen flag clicked\nswitch costume to (level v)\nset [menu v] to [True]\nhide\ngo to x: (-159) y: (-30)\nset [ghost v] effect to (100)\nshow\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nask [Please enter your save code.] and wait\nset [loop_# v] to [11]\ngo to [front v] layer\nshow\ngo to x: (0) y: (0)\nswitch costume to (succes v)\nset [ghost v] effect to (100)\nset size to (150) %\nrepeat (7)\n    change [ghost v] effect by (-10)\nend\nwait (pick random (0.5) to (2)) seconds\ndelete all of [levels v]\nrepeat until <(letter (loop_#) of (answer)) = [/]>\n    add (letter (loop_#) of (answer)) to [levels v]\n    change [loop_# v] by (1)\nend\nset [$ v] to []\nchange [loop_# v] by (1)\nrepeat until <(letter (loop_#) of (answer)) = [/]>\n    set [$ v] to (join ($) (letter (loop_#) of (answer)))\n    change [loop_# v] by (1)\nend\ndelete all of [skins unlocked v]\nrepeat (6)\n    add [0] to [skins unlocked v]\nend\nset [# v] to [1]\nchange [loop_# v] by (1)\nrepeat until <(letter (loop_#) of (answer)) = [/]>\n    replace item (#) of [skins unlocked v] with (letter (loop_#) of (answer))\n    change [loop_# v] by (1)\n    change [# v] by (1)\nend\nrepeat (7)\n    change [ghost v] effect by (10)\nend\nbroadcast (Menu Update v)\nhide\nclear graphic effects\nset size to (100) %\ngo to x: (-159) y: (-30)\nshow\nswitch costume to (level v)\n\nwhen I receive [play game v]\nset [menu v] to [False]\nhide\nwait (1) seconds\nwait until <(MENU) = [True]>\nswitch costume to (level v)\nshow\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <(costume [name v]) = [level]>> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [menu open v]\nshow\n\n@Save\n\nwhen flag clicked\nswitch costume to (level v)\nshow list [save code v]\nset [menu v] to [True]\nhide\ngo to x: (-159) y: (25)\nset [ghost v] effect to (100)\nshow\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nshow\ngo to x: (0) y: (0)\nswitch costume to (generating... v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nset size to (150) %\nrepeat (7)\n    change [ghost v] effect by (-10)\nend\nwait (pick random (0.5) to (2)) seconds\nrepeat (7)\n    change [ghost v] effect by (10)\nend\nswitch costume to (level v)\nhide\nclear graphic effects\nset size to (100) %\ngo to x: (-159) y: (25)\nset [save code v] to [SAVE_CODE/]\nset [loop_var v] to [1]\nrepeat (length of [levels v])\n    set [save code v] to (join (SAVE CODE) (loop_var))\n    change [loop_var v] by (1)\nend\nset [save code v] to (join (SAVE CODE) (join [/] (join ($) (join [/] (join (Skins Unlocked) [/])))))\nreplace item (2) of [save code v] with (SAVE CODE)\nhide list [save code v]\nwait (1) seconds\nwait until <mouse down?>\nshow list [save code v]\nshow\n\nwhen I receive [play game v]\nset [menu v] to [False]\nhide\nwait (1) seconds\nwait until <(MENU) = [True]>\nshow\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <(costume [name v]) = [level]>> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [menu open v]\nshow\n\n@AttackThingBoss\n\nwhen I receive [attack 2 v]\nset [x v] to ([x v] of [end boss v])\nset [y v] to (([y v] of [end boss v]) - (35))\nshow\nset [ghost v] effect to (50)\nswitch costume to (explosion v)\nset size to (0) %\ngo to (end boss v)\nstart sound [Boom Cloud v]\nset [attack type v] to [1]\nset [attack state v] to [1]\nset [attack tick v] to [0]\nset [attack finish v] to [50]\n\nwhen flag clicked\nhide\nclear graphic effects\n\ndefine position (x) (y)\nif <<(MENU) = [False]> and <(LEVEL) = [8]>> then\n    set [prev size v] to (size)\n    set size to (10000000000000000000) %\n    go to x: (x) y: (y)\n    set size to (Prev Size) %\nelse\n    hide\n    clear graphic effects\nend\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [attack 1 v]\ngo to [back v] layer\nset [x v] to ([x v] of [end boss v])\nset [y v] to (([y v] of [end boss v]) * (2))\npoint in direction (0)\nshow\nclear graphic effects\nset [ghost v] effect to (25)\nswitch costume to (laser v)\nset size to (100) %\nset [attack type v] to [2]\nset [attack state v] to [1]\nset [attack tick v] to [0]\nset [attack finish v] to [235]\n\nwhen I receive [attack 3 v]\ngo to [back v] layer\nset [x v] to ((([x position v] of [end boss v]) + (SCROLL X)) + (pick random (-150) to (150)))\nset [y v] to [500]\npoint in direction (90)\nshow\nclear graphic effects\nset [ghost v] effect to (25)\nswitch costume to (fireball v)\nset size to (45) %\nset [attack type v] to [3]\nset [attack state v] to [1]\nset [attack tick v] to [0]\nset [attack finish v] to [50]\n\nwhen I receive [targetet v]\nhide\nclear graphic effects\nReset Attack Variables\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [credits v]\nhide\nReset Attack Variables\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\nReset Attack Variables\n\nwhen I receive [stop boss fight v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [tick v]\nDo Tick\n\ndefine Do Tick\nchange [attack tick v] by (1)\nif <(Attack Type) = [1]> then\n    if <(Attack State) = [1]> then\n        change size by (10)\n        if <(Attack Tick) > [15]> then\n            change [attack state v] by (1)\n        end\n    end\n    if <(Attack State) = [2]> then\n        change size by (7)\n        if <(Attack Tick) > [30]> then\n            change [attack state v] by (1)\n        end\n    end\n    if <(Attack State) = [3]> then\n        change size by (3)\n        if <(Attack Tick) > [40]> then\n            change [attack state v] by (1)\n        end\n    end\n    if <(Attack State) = [4]> then\n        change [ghost v] effect by (10)\n        change [attack tick v] by (1)\n        if <(Attack Tick) > [43]> then\n            set size to (0) %\n            hide\n            clear graphic effects\n        end\n        if <(Attack Tick) > [49]> then\n            Reset Attack Variables\n            set size to (0) %\n            hide\n            clear graphic effects\n        end\n    end\nend\nif <(Attack Type) = [2]> then\n    if <(Attack State) = [1]> then\n        change [y v] by (-4)\n        if <(Attack Tick) > [55]> then\n            change [attack state v] by (1)\n        end\n    end\n    if <(Attack State) = [2]> then\n        turn right (2) degrees\n        if <(pick random (1) to (3)) = [3]> then\n            hide\n        else\n            show\n        end\n        if <(Attack Tick) > [235]> then\n            hide\n            Reset Attack Variables\n        end\n    end\nend\nif <(Attack Type) = [3]> then\n    if <(Attack State) = [1]> then\n        change [y v] by (-20)\n        if <(Attack Tick) > [49]> then\n            Reset Attack Variables\n        end\n    end\nend\nif <(Player EXIT) = [die]> then\n    Reset Attack Variables\n    hide\n    delete this clone\nend\n\ndefine Reset Attack Variables\nhide\nset size to (1) %\ngo to x: (-100000) y: (-100000)\nset [attack type v] to [0]\nset [attack state v] to [0]\nset [attack tick v] to [0]\nset [attack finish v] to [0]\n\nwhen I receive [play game v]\nset volume to (Sound Effects Volume) %\n\n@Settings\n\nwhen flag clicked\nset [menu v] to [True]\nhide\ngo to x: (159) y: (25)\nset [ghost v] effect to (100)\nshow\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nshow\nbroadcast (Open Settings v)\n\nwhen I receive [play game v]\nset [menu v] to [False]\nhide\nwait (1) seconds\nwait until <(MENU) = [True]>\nif <[levels v] contains [1]?> then\n    switch costume to (level v)\nelse\n    switch costume to (lock v)\nend\nshow\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [menu open v]\nshow\n\n@End Boss\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\nif <(LEVEL) = [8]> then\n    if <(MENU) = [False]> then\n        set [prev size v] to (size)\n        set size to (10000000000000000000) %\n        go to x: (x) y: (y)\n        set size to (Prev Size) %\n    else\n        hide\n    end\nelse\n    hide\nend\n\ndefine Clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\ngo to [back v] layer\nif <(LEVEL) = [8]> then\n    broadcast (again v)\n    Clone at x: [1446] y: [123]\nend\n\ndefine say aggresive random things\nsay [Hello, adventurer. You know who I am.] for (2) seconds\nsay [After your long journy, this is where your adventure ends.] for (2) seconds\nsay [You can't go back!] for (2) seconds\nsay [YOU ARE GOING TO GET DESTROYED!] for (2) seconds\nwait (1) seconds\n\ndefine attack 1\nwait (1) seconds\nbroadcast (Attack 1 v) and wait\n\ndefine attack 2\nwait (1) seconds\nrepeat (10)\n    change [y v] by (2)\nend\nrepeat (10)\n    change [y v] by (-2)\nend\nbroadcast (Attack 2 v)\n\nwhen I receive [boss fight v]\nsay aggresive random things\nrepeat until <<(TARGET) > [7]> or <(EXIT) = [die]>>\n    if <([attack tick v] of [attackthingboss v]) > ([attack finish v] of [attackthingboss v])> then\n        set [attack v] to (pick random (1) to (3))\n        if <(Attack) = [1]> then\n            attack 1\n        end\n        if <(Attack) = [2]> then\n            attack 2\n        end\n        if <(Attack) = [3]> then\n            attack 3\n        end\n    end\nend\n\ndefine attack 3\nwait (1) seconds\nbroadcast (Attack 3 v) and wait\n\nwhen I receive [targetet v]\nif <(TARGET) > [7]> then\n    hide\n    repeat (3)\n        wait (0.2) seconds\n        show\n        wait (0.2) seconds\n        hide\n    end\n    broadcast (portal v)\nelse\n    show\n    set [ghost v] effect to (50)\n    repeat (3)\n        wait (0.2) seconds\n        clear graphic effects\n        wait (0.2) seconds\n        set [ghost v] effect to (50)\n    end\n    clear graphic effects\nend\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [credits v]\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [again v]\nwait (1) seconds\nwait until <<(LEVEL) = [8]> and <(EXIT) = [die]>>\nhide\nclear graphic effects\nbroadcast (again v)\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [again v]\nhide\nclear graphic effects\nwait (5) seconds\nwait until <<<(LEVEL) = [8]> and <(distance to [player v]) < [30]>> and <(MENU) = [False]>>\nwait (3) seconds\nset [ghost v] effect to (100)\nshow\nrepeat (5)\n    change [ghost v] effect by (-50)\nend\nclear graphic effects\nbroadcast (boss fight v)\n\nwhen I receive [stop boss fight v]\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nhide\n\n@Menu Stuff\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nif <(#) = [0]> then\n    if <(item (ID) of [skins unlocked v]) = [0]> then\n        if <(costume [number v]) = [1]> then\n            if <($) > [9]> then\n                hide\n                replace item (1) of [skins unlocked v] with [1]\n                set [currentskin v] to [2]\n                change [$ v] by (-10)\n            else\n                show\n            end\n        end\n        if <(costume [number v]) = [2]> then\n            if <($) > [14]> then\n                hide\n                replace item (2) of [skins unlocked v] with [1]\n                set [currentskin v] to [3]\n                change [$ v] by (-10)\n            else\n                show\n            end\n        end\n        if <(costume [number v]) = [3]> then\n            if <($) > [24]> then\n                hide\n                replace item (3) of [skins unlocked v] with [1]\n                set [currentskin v] to [4]\n                change [$ v] by (-10)\n            else\n                show\n            end\n        end\n        if <(costume [number v]) = [4]> then\n            if <($) > [14]> then\n                hide\n                replace item (4) of [skins unlocked v] with [1]\n                set [currentskin v] to [5]\n                change [$ v] by (-15)\n            else\n                show\n            end\n        end\n        if <(costume [number v]) = [5]> then\n            if <($) > [74]> then\n                hide\n                replace item (5) of [skins unlocked v] with [1]\n                set [currentskin v] to [6]\n                change [$ v] by (-75)\n            else\n                show\n            end\n        end\n        if <(costume [number v]) = [6]> then\n            if <($) > [99]> then\n                hide\n                replace item (6) of [skins unlocked v] with [1]\n                set [currentskin v] to [7]\n                change [$ v] by (-99)\n            else\n                show\n            end\n        end\n    else\n        set [currentskin v] to ((costume [number v]) + (1))\n    end\nend\nif <(ID) = [0]> then\n    if <(costume [name v]) = [Default]> then\n        set [currentskin v] to [1]\n    end\n    if <(costume [name v]) = [Button]> then\n        set [currentskin v] to ((#) + (1))\n    end\nend\nshow\n\nwhen I receive [close menus v]\nhide\ndelete this clone\n\nwhen flag clicked\ndelete all of [skins unlocked v]\ngo to [front v] layer\nhide\nrepeat (6)\n    add [0] to [skins unlocked v]\nend\n\nwhen I receive [open skins v]\nset size to (300) %\ngo to x: (-159) y: (0)\nswitch costume to (circle skin \(2\) v)\ngo to [front v] layer\nshow\nwait (0.1) seconds\ngo to x: (-160) y: (20)\nset [# v] to [0]\nset [id v] to [1]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change x by (160)\n    next costume\nend\ngo to x: (-160) y: (-80)\nswitch costume to (triangleskin \(4\) v)\nset [id v] to [4]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change x by (160)\n    next costume\nend\nhide\nset [id v] to [0]\nset [# v] to [0]\ngo to x: (-160) y: (-25)\nrepeat (3)\n    change [# v] by (1)\n    switch costume to (button v)\n    create clone of (_myself_ v)\n    change x by (160)\nend\nset [# v] to [3]\ngo to x: (-160) y: (-125)\nrepeat (3)\n    change [# v] by (1)\n    switch costume to (button v)\n    create clone of (_myself_ v)\n    change x by (160)\nend\nswitch costume to (default v)\ngo to x: (0) y: (70)\ngo to [front v] layer\nshow\n\nwhen I start as a clone\nshow\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <(costume [number v]) < [6]> then\n        if <touching (mouse-pointer v)?> then\n            change size by (((270) - (size)) / (3))\n            set [ghost v] effect to (20)\n            point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n        else\n            point in direction (90)\n            change size by (((250) - (size)) / (3))\n        end\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(costume [number v]) < [7]> then\n        if <<touching (mouse-pointer v)?> and <(item (ID) of [skins unlocked v]) = [0]>> then\n            change size by (((270) - (size)) / (3))\n            set [ghost v] effect to (20)\n            point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n        else\n            point in direction (90)\n            change size by (((200) - (size)) / (3))\n            set [ghost v] effect to (0)\n        end\n    end\n    if <(costume [number v]) > [6]> then\n        if <touching (mouse-pointer v)?> then\n            change size by (((270) - (size)) / (3))\n            point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n        else\n            point in direction (90)\n            change size by (((200) - (size)) / (3))\n        end\n        set [ghost v] effect to (#)\n        if <(item (#) of [skins unlocked v]) = [1]> then\n            show\n            if <(CurrentSkin) = ((#) + (1))> then\n                switch costume to (equipped v)\n            else\n                switch costume to (button v)\n            end\n        else\n            hide\n        end\n    end\nend\n\nwhen I receive [open upgrades v]\nset size to (100) %\ngo to x: (0) y: (0)\nswitch costume to (wall jump 1 v)\nwait (0.1) seconds\ngo to [front v] layer\nshow\n\n@Menu\n\nwhen I receive [open skins v]\ngo to x: (0) y: (0)\nset [size v] to [100]\nset size to (0) %\ngo to [front v] layer\nshow variable [$ v]\nshow\nswitch costume to (skins v)\n\nwhen I receive [close menus v]\nhide variable [$ v]\nhide variable [background music volume v]\nhide variable [sound effects volume v]\nset [size v] to [0]\nwait (0.25) seconds\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\nset [size v] to [0]\n\nwhen I receive [open settings v]\ngo to x: (0) y: (0)\nset [size v] to [100]\nset size to (0) %\ngo to [front v] layer\nshow variable [background music volume v]\nshow variable [sound effects volume v]\nshow\nswitch costume to (settings v)\n\nwhen I receive [open upgrades v]\nset [size v] to [100]\nset size to (0) %\ngo to [front v] layer\nshow variable [$ v]\nshow\nswitch costume to (upgrades v)\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [green flag v]\nstop [other scripts in sprite v]\n\nwhen I receive [menu open v]\nforever\n    change size by (((Size) - (size)) / (3))\nend\n\n@Close Menu\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (normal v)\nset size to (70) %\ngo to x: (212) y: (119)\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (hover v)\n        wait until <not <touching (mouse-pointer v)?>>\n        switch costume to (normal v)\n    end\nend\n\nwhen I receive [open skins v]\nshow\nwait (0.2) seconds\ngo to [front v] layer\n\nwhen this sprite clicked\nbroadcast (Close Menus v)\nhide\n\nwhen I receive [open settings v]\nshow\nwait (0.2) seconds\ngo to [front v] layer\n\nwhen I receive [open upgrades v]\nshow\nwait (0.2) seconds\ngo to [front v] layer\n\nwhen I receive [open shop v]\nshow\nwait (0.2) seconds\ngo to [front v] layer\n\n@Target\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nturn right (2) degrees\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    if <not <(TARGET) > [8]>> then\n        broadcast (targetet v)\n        change [target v] by (1)\n        set [pos v] to (pick random (1) to (6))\n        if <(pos) = [1]> then\n            Clone at x: [1441] y: [-104]\n        end\n        if <(pos) = [2]> then\n            Clone at x: [1615] y: [-9]\n        end\n        if <(pos) = [3]> then\n            Clone at x: [1274] y: [-9]\n        end\n        if <(pos) = [4]> then\n            Clone at x: [1654] y: [189]\n        end\n        if <(pos) = [5]> then\n            Clone at x: [1214] y: [189]\n        end\n        if <(pos) = [6]> then\n            Clone at x: [1438] y: [260]\n        end\n    else\n        hide\n        set [target v] to [8]\n    end\nend\n\nwhen I receive [setup v]\nset [target v] to [0]\nset [boss fight v] to [False]\nset size to (40) %\nset [ghost v] effect to (50)\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (target v)\nif <not <(LEVEL) = [8]>> then\n    set [x v] to [-99999]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<<(MENU) = [False]> and <(boss fight) = [True]>> and <(TARGET) < [8]>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [boss fight v]\nwait (8) seconds\nset [target v] to [0]\nshow\nset [boss fight v] to [True]\nset [pos v] to (pick random (1) to (6))\nif <(pos) = [1]> then\n    Clone at x: [1441] y: [-104]\nend\nif <(pos) = [2]> then\n    Clone at x: [1615] y: [-9]\nend\nif <(pos) = [3]> then\n    Clone at x: [1274] y: [-9]\nend\nif <(pos) = [4]> then\n    Clone at x: [1654] y: [189]\nend\nif <(pos) = [5]> then\n    Clone at x: [1214] y: [189]\nend\nif <(pos) = [6]> then\n    Clone at x: [1438] y: [260]\nend\n\n@Coins\n\nwhen I receive [menu open v]\nhide\n\nwhen flag clicked\nset volume to (Sound Effects Volume) %\ndelete all of [collected coins x v]\ndelete all of [collected coins y v]\n\nwhen I receive [green flag v]\ndelete all of [collected coins x v]\ndelete all of [collected coins y v]\nhide\n\nwhen I receive [tick v]\nif <touching (player v)?> then\n    start sound [Low Whoosh v]\nend\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nset y to (((y) - (SCROLL Y)) + (([cos v] of (((timer) - (3)) * (400)) ) * (3)))\n\nwhen I receive [setup v]\nclear graphic effects\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (dot v)\nif <(LEVEL) = [1]> then\n    Clone at x: [34] y: [54]\n    Clone at x: [1402] y: [26]\n    Clone at x: [2082] y: [176]\n    Clone at x: [3220] y: [21]\n    Clone at x: [3472] y: [-12]\n    Clone at x: [3521] y: [10]\n    Clone at x: [3570] y: [22]\n    Clone at x: [3617] y: [10]\n    Clone at x: [3662] y: [-12]\n    Clone at x: [4635] y: [150]\n    Clone at x: [4635] y: [200]\n    Clone at x: [4635] y: [250]\nend\nif <(LEVEL) = [2]> then\n    Clone at x: [754] y: [-3]\n    Clone at x: [1101] y: [119]\n    Clone at x: [2726] y: [7]\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [-165] y: [-55]\n    Clone at x: [-165] y: [-5]\n    Clone at x: [-165] y: [45]\n    Clone at x: [715] y: [110]\n    Clone at x: [1336] y: [58]\n    Clone at x: [1892] y: [-15]\n    Clone at x: [2289] y: [54]\n    Clone at x: [3368] y: [4]\n    Clone at x: [3858] y: [77]\n    Clone at x: [4310] y: [110]\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [-50] y: [-59]\n    Clone at x: [-100] y: [-59]\n    Clone at x: [-150] y: [-59]\n    Clone at x: [1000] y: [604]\n    Clone at x: [1050] y: [604]\n    Clone at x: [1100] y: [604]\n    Clone at x: [1150] y: [604]\n    Clone at x: [1200] y: [604]\n    Clone at x: [1352] y: [43]\n    Clone at x: [2027] y: [131]\n    Clone at x: [2288] y: [192]\nend\nif <(LEVEL) = [5]> then\n    Clone at x: [0] y: [0]\n    Clone at x: [1868] y: [207]\n    Clone at x: [1964] y: [64]\n    Clone at x: [2095] y: [-40]\n    Clone at x: [2432] y: [287]\n    Clone at x: [4266] y: [78]\n    Clone at x: [5089] y: [96]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [577] y: [239]\n    Clone at x: [1490] y: [279]\n    Clone at x: [1527] y: [-69]\n    Clone at x: [2042] y: [170]\n    Clone at x: [2107] y: [321]\n    Clone at x: [3554] y: [305]\nend\nif <(LEVEL) = [7]> then\n    set [# v] to [1]\n    repeat (6)\n        Clone at x: (((#) * (720)) + (-580)) y: [-30]\n        change [# v] by (1)\n    end\nend\nif <(LEVEL) = [8]> then\n    Clone at x: [-999] y: [-999]\nend\nset [x v] to [-9999]\nwait (.2) seconds\ndelete all of [collected coins x v]\ndelete all of [collected coins y v]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\nif <touching (player v)?> then\n    add (x) to [collected coins x v]\n    add (y) to [collected coins y v]\n    set volume to (Sound Effects Volume) %\n    change [$ v] by (1)\n    delete this clone\nend\nif <(Deleteable) > [0]> then\n    change [deleteable v] by (1)\n    if <(Deleteable) > [10]> then\n        add (x) to [collected coins x v]\n        add (y) to [collected coins y v]\n        delete this clone\n    end\nend\nLoop through dots\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nclear graphic effects\nset size to (100) %\nset [x v] to (x)\nset [y v] to (y)\nset [deleteable v] to [0]\ncreate clone of (_myself_ v)\n\ndefine Loop through dots\nset [dot loop v] to [1]\nrepeat (length of [collected coins x v])\n    if <<(item (dot loop) of [collected coins x v]) = (x)> and <(item (dot loop) of [collected coins y v]) = (y)>> then\n        set [deleteable v] to [1]\n    end\n    change [dot loop v] by (1)\nend\n\nwhen I start as a clone\nLoop through dots\n\n@Checkpoints\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [green flag v]\nset [checkx v] to [0]\nset [checky v] to [0]\nhide\n\nwhen I receive [tick v]\nif <<(CheckX) = (x)> and <(CheckY) = (y)>> then\n    switch costume to (20 v)\nend\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    if <(costume [number v]) < [20]> then\n        if <(costume [number v]) = [1]> then\n            start sound [Bell Toll v]\n            next costume\n        else\n            next costume\n        end\n    else\n        set [checkx v] to (x)\n        set [checky v] to (y)\n    end\nend\n\nwhen I receive [setup v]\nclear graphic effects\nhide\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nif <(LEVEL) = [1]> then\n    Clone at x: [1368] y: [-19]\n    Clone at x: [3098] y: [-19]\nend\nif <(LEVEL) = [2]> then\n    Clone at x: [1800] y: [40]\n    Clone at x: [3900] y: [104]\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [2040] y: [33]\n    Clone at x: [3516] y: [78]\n    Clone at x: [5150] y: [82]\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [500] y: [569]\n    Clone at x: [2372] y: [225]\nend\nif <(LEVEL) = [5]> then\n    Clone at x: [1481] y: [200]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [2462] y: [224]\nend\nif <(LEVEL) = [7]> then\n    Clone at x: [3083] y: [-15]\nend\nif <(LEVEL) = [8]> then\n    Clone at x: [-9999] y: [-9999]\nend\nset [x v] to [-99999]\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Clone at x: (x) y: (y)\nclear graphic effects\nset size to (100) %\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nswitch costume to (1 v)\n\nwhen I start as a clone\nset volume to (Sound Effects Volume) %\n\n@Credits Buttton\n\nwhen flag clicked\nset [menu v] to [True]\nhide\ngo to x: (203) y: (171)\nset [ghost v] effect to (100)\nshow\nwait (0.1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen this sprite clicked\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\nshow\nset [menu v] to [False]\nset [level v] to [Credits]\nbroadcast (Credits v)\nhide\n\nwhen I receive [play game v]\nset [menu v] to [False]\nhide\nwait (1) seconds\nwait until <(MENU) = [True]>\nif <[levels v] contains [1]?> then\n    switch costume to (level v)\nelse\n    switch costume to (lock v)\nend\nshow\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((60) - (size)) / (3))\n        set [ghost v] effect to (20)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n    else\n        point in direction (90)\n        change size by (((50) - (size)) / (3))\n    end\nend\n\nwhen I receive [credits v]\nhide\n\nwhen I receive [menu open v]\nshow\n\n@Bounce Point\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\nif <(LEVEL) = [6]> then\n    set [x v] to [360]\n    set [y v] to [-6]\n    set [state v] to [normal]\n    go to [front v] layer\n    go [backward v] (15) layers\n    switch costume to (level 1 1 v)\n    Clone at x: [775] y: [54]\n    Clone at x: [775] y: [306]\n    Clone at x: [1052] y: [270]\n    Clone at x: [1285] y: [209]\n    Clone at x: [1870] y: [-34]\n    Clone at x: [2264] y: [-40]\n    Clone at x: [2264] y: [60]\n    Clone at x: [2264] y: [160]\n    Clone at x: [2264] y: [260]\n    Clone at x: [2600] y: [-100]\n    Clone at x: [2800] y: [-100]\n    Clone at x: [3000] y: [-100]\n    Clone at x: [3200] y: [-100]\n    Clone at x: [2600] y: [25]\n    Clone at x: [2800] y: [25]\n    Clone at x: [3000] y: [25]\n    Clone at x: [3200] y: [25]\n    Clone at x: [2600] y: [150]\n    Clone at x: [2800] y: [150]\n    Clone at x: [3000] y: [150]\n    Clone at x: [3200] y: [150]\n    Clone at x: [3804] y: [-8]\nelse\n    set [x v] to [-9999]\n    set [y v] to [-9999]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    if <<(MENU) = [False]> and <not <(LEVEL) = [Credits]>>> then\n        show\n    else\n        hide\n    end\nelse\n    hide\nend\nif <(state) = [normal]> then\n    switch costume to (normal v)\n    change [color v] effect by (.5)\nend\nif <(state) = [use]> then\n    switch costume to (use v)\n    change [color v] effect by (20)\nend\nif <<(state) = [used]> or <(state) = [charge]>> then\n    change [color v] effect by (3)\n    switch costume to (join [Used ] (used state frame))\n    if <(state) = [used]> then\n        change [used state frame v] by (1)\n    else\n        change [used state frame v] by (-1)\n    end\nend\nif <touching (player v)?> then\n    set [state v] to [use]\nend\nif <<not <touching (player v)?>> and <(state) = [use]>> then\n    set [state v] to [used]\n    set [used state frame v] to [0]\nend\nif <<(used state frame) > [9]> and <(state) = [used]>> then\n    set [state v] to [charge]\n    set [used state frame v] to [9]\nend\nif <<(used state frame) < [0]> and <(state) = [charge]>> then\n    set [state v] to [normal]\n    switch costume to (between-frame v)\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\nwhen I receive [menu open v]\nhide\n\n@Level Display\n\nwhen I start as a clone\nset size to (120) %\nshow\nswitch costume to (  v)\n\ndefine setup\nset [score display v] to []\nhide\nswitch costume to (  v)\nset size to (120) %\ngo to x: (-225) y: (160)\nset [index v] to [1]\nset [self? v] to [0]\nrepeat (6)\n    create clone of (_myself_ v)\n    change x by ((size) / (10))\n    change [index v] by (1)\nend\nset [self? v] to [1]\nswitch costume to (  v)\n\ndefine change costume to (costume)\nif <not <(costume) = (costume [name v])>> then\n    switch costume to (costume)\nend\nif <(costume) = []> then\n    switch costume to (  v)\nend\n\nwhen I receive [tick v]\nTick\n\ndefine Tick\nchange costume to (letter (index) of (SCORE DISPLAY))\nset x to (((index) - (0.5)) * ((size) / (10)))\nchange size by ((0.2) * ((120) - (size)))\nchange x by (-225)\nif <(MENU) = [False]> then\n    show\nelse\n    hide\nend\ngo to [front v] layer\nif <(LEVEL) = [8]> then\n    set [score display v] to (DISPLAY TARGET)\nelse\n    set [score display v] to (DISPLAY COLLECTED)\nend\n\nwhen I receive [reset v]\nwait (.01) seconds\nif <(self?) = [1]> then\n    setup\nelse\n    delete this clone\nend\n\nwhen flag clicked\nset [self? v] to [1]\nhide\ndelete this clone\n\nwhen I receive [play game v]\nwait (.5) seconds\nif <(self?) = [1]> then\n    setup\nelse\n    delete this clone\nend\n\nwhen I receive [menu open v]\ndelete this clone\n\n@Skin trail particles\n\nwhen flag clicked\nhide\nset [self? v] to [1]\n\nwhen I receive [tick v]\nTick\n\nwhen I start as a clone\nset [x v] to ([x v] of [player v])\nset [y v] to (([y v] of [player v]) - (10))\nif <(self?) = [4]> then\n    switch costume to (water trail v)\n    set [color v] effect to (0)\n    set [clone frames v] to [5]\nend\nif <(self?) = [6]> then\n    switch costume to (small star trail v)\n    set [color v] effect to (pick random (1) to (100))\n    set [clone frames v] to [5]\nend\nif <(self?) = [7]> then\n    switch costume to (star trail v)\n    set [color v] effect to (pick random (1) to (100))\n    set [clone frames v] to [20]\nend\nset size to (pick random (1) to (100)) %\n\ndefine Tick\nif <(MENU) = [False]> then\n    if <(self?) = [1]> then\n        hide\n        if <(CurrentSkin) = [4]> then\n            set [self? v] to [4]\n            create clone of (_myself_ v)\n            set [self? v] to [1]\n        end\n        if <(CurrentSkin) = [6]> then\n            set [self? v] to [6]\n            create clone of (_myself_ v)\n            set [self? v] to [1]\n        end\n        if <(CurrentSkin) = [7]> then\n            set [self? v] to [7]\n            create clone of (_myself_ v)\n            set [self? v] to [1]\n        end\n    end\n    if <(self?) = [4]> then\n        show\n        change [ghost v] effect by (20)\n        change [clone frames v] by (-1)\n        go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n        if <(clone frames) < [0]> then\n            delete this clone\n        end\n        if <<not <touching (player v)?>> and <not <touching (platforms v)?>>> then\n            change [y v] by (-10)\n        end\n    end\n    if <(self?) = [6]> then\n        show\n        change [color v] effect by (5)\n        change [ghost v] effect by (20)\n        change [clone frames v] by (-1)\n        go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n        if <(clone frames) < [0]> then\n            delete this clone\n        end\n        if <<not <touching (player v)?>> and <not <touching (platforms v)?>>> then\n            change [y v] by (-5)\n        end\n    end\n    if <(self?) = [7]> then\n        show\n        change [color v] effect by (5)\n        change [ghost v] effect by (5)\n        change [clone frames v] by (-1)\n        go to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n        if <(clone frames) < [0]> then\n            delete this clone\n        end\n    end\nelse\n    delete this clone\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [play game v]\ndelete this clone\n\nwhen I receive [green flag v]\ndelete this clone\n\nwhen I receive [setup v]\ndelete this clone\n\n