Kingdoms || a scrolling platformer #games #stories #all

Instructions: It's finally out! After 15+ hours of work, and 2 weeks in development, it's out: Kingdoms- a scrolling platformer!\n\nCONTROLS:\n- Arrow keys to move\n- Avoid spikes and lava\n- Collect all of the gems to unlock the portal\n- Buy skins in the shop\n- Save your code so you can come back at any time!\n\nIf you enjoyed, don't forget to ❤️, ⭐, and follow @MXNHD!

@Stage\n\nwhen flag clicked\nswitch backdrop to (main menu v)\nforever\n    set [display collected v] to (join (COLLECTED) (join [ / ] (COLLECTED MAX)))\n    set [display target v] to (join (TARGET) (join [ / ] [8]))\nend\n\nwhen [f v] key pressed\nshow variable [scroll x v]\nshow variable [scroll y v]\nshow variable [fps v]\nshow variable [mouse v]\nwait (0.1) seconds\nwait until <<key (f v) pressed?> or <(MENU) = [True]>>\nhide variable [mouse v]\nhide variable [fps v]\nhide variable [scroll x v]\nhide variable [scroll y 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]\nforever\n    play sound [FR Epic v] until done\nend\n\nwhen flag clicked\nforever\n    if <(MENU) = [True]> then\n        switch backdrop to (main menu v)\n        hide variable [display collected v]\n        hide variable [display target v]\n    else\n        if <(LEVEL) = [1]> then\n            switch backdrop to (level1 v)\n            show variable [display collected v]\n            hide variable [display target v]\n        end\n        if <(LEVEL) = [2]> then\n            switch backdrop to (level2 v)\n            show variable [display collected v]\n            hide variable [display target v]\n        end\n        if <(LEVEL) = [3]> then\n            switch backdrop to (level3 v)\n            show variable [display collected v]\n            hide variable [display target v]\n        end\n        if <(LEVEL) = [4]> then\n            switch backdrop to (level4 v)\n            show variable [display collected v]\n            hide variable [display target v]\n        end\n        if <(LEVEL) = [5]> then\n            switch backdrop to (level5 v)\n            show variable [display collected v]\n            hide variable [display target v]\n        end\n        if <(LEVEL) = [6]> then\n            switch backdrop to (level6 v)\n            show variable [display target v]\n            hide variable [display collected v]\n        end\n        if <(LEVEL) = [Credits]> then\n            switch backdrop to (credits v)\n            hide variable [display collected v]\n            hide variable [display target v]\n        end\n    end\n    wait (0.2) seconds\nend\n\nwhen flag clicked\nforever\n    set volume to (Background Music Volume) %\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 [menu open v]\nswitch backdrop to (main menu v)\n\nwhen I receive [menu update v]\nswitch backdrop to (main menu v)\n\n@Blank\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\nset [level v] to [0]\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\nwhen I receive [menu update v]\nhide\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 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]\ngo to [front 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 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]\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]\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: [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\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)\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 [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) = [4]> 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]\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) = [6]> 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]\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) = [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: [100]\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) = [6]>> then\n    go to x: (x) y: (y)\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\npen up\nerase all\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\n    switch costume to (level 5 1 v)\nend\nif <(LEVEL) = [6]> 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]\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\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\nwhen I start as a clone\ngo to [back v] layer\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]\nchange [$ v] by (round ((LEVEL) * (1.5)))\nstart sound [Win v]\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 - arcade v)\nend\nif <(LEVEL) = [5]> then\n    switch costume to (open - lava v)\nend\n\nwhen I receive [menu open v]\nhide\n\nwhen I receive [portal v]\nswitch costume to (open - done v)\nClone at x: [1446] y: [125]\nset size to (1) %\nrepeat (100)\n    change size by (1)\nend\nwait until <touching (player v)?>\nwait (3) seconds\nset [level v] to [Credits]\nbroadcast (Credits v)\n\nwhen I receive [credits v]\nhide\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <<(costume [number v]) > [1]> and <touching (player v)?>> then\n    set [player exit v] to [win]\nend\n\nwhen I receive [setup v]\nswitch costume to (closed v)\nhide\nset [collected v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(LEVEL) = [1]> then\n    switch costume to (closed v)\n    Clone at x: [4810] y: [148]\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: [4875] y: [230]\nend\nif <(LEVEL) = [4]> then\n    switch costume to (open - desert v)\n    Clone at x: [5075] y: [140]\nend\nif <(LEVEL) = [5]> then\n    switch costume to (closed v)\n    Clone at x: [4675] y: [290]\nend\nif <(LEVEL) = [6]> then\n    switch costume to (open - lava v)\n    Clone at x: [4300] 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)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen flag clicked\nforever\n    if <(LEVEL) = [6]> then\n        forever\n            hide variable [display target v]\n        end\n    end\nend\n\n@Mini-Portals\n\nwhen I receive [menu open v]\nhide\n\nwhen flag clicked\nforever\n    set volume to (Sound Effects Volume) %\nend\n\nwhen I start as a clone\nif <(x) < (CheckX)> then\n    change [collected v] by (1)\n    delete this clone\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\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    change [collected v] by (1)\n    hide\n    if <(COLLECTED) = (COLLECTED MAX)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\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: [300] y: [25]\n    Clone at x: [1010] y: [0]\n    Clone at x: [2580] y: [146]\n    Clone at x: [3980] y: [-5]\n    Clone at x: [3980] y: [-95]\n    Clone at x: [3980] y: [-50]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [340] y: [120]\n    Clone at x: [511] y: [250]\n    Clone at x: [530] y: [20]\n    Clone at x: [767] y: [600]\n    Clone at x: [875] y: [0]\n    Clone at x: [1129] y: [510]\n    Clone at x: [1186] y: [510]\n    Clone at x: [2625] y: [190]\n    Clone at x: [4120] y: [150]\n    Clone at x: [4770] y: [170]\n    Clone at x: [4690] y: [170]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\nend\nif <(LEVEL) = [2]> then\n    Clone at x: [292] y: [18]\n    Clone at x: [520] y: [240]\n    Clone at x: [937] y: [-90]\n    Clone at x: [1936] y: [-110]\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: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [245] y: [10]\n    Clone at x: [1750] y: [10]\n    Clone at x: [1875] y: [10]\n    Clone at x: [1600] y: [190]\n    Clone at x: [1650] y: [190]\n    Clone at x: [1700] y: [190]\n    Clone at x: [3560] y: [100]\n    Clone at x: [3740] y: [100]\nend\nif <(LEVEL) = [5]> then\n    Clone at x: [460] y: [140]\n    Clone at x: [1245] y: [180]\n    Clone at x: [1410] y: [240]\n    Clone at x: [4030] y: [340]\n    Clone at x: [4260] y: [370]\n    Clone at x: [3750] y: [275]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [180] y: [120]\n    Clone at x: [1540] y: [365]\n    Clone at x: [1710] y: [365]\n    Clone at x: [2878] y: [260]\n    Clone at x: [3320] y: [350]\n    Clone at x: [3750] y: [375]\n    Clone at x: [4450] y: [190]\n    Clone at x: [4685] y: [260]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\n    Clone at x: [9999] y: [9999]\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)\nchange [collected max v] by (0.5)\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))\nif <touching (player v)?> then\n    if <(LEVEL) = [1]> then\n        if <(costume [name v]) = [level 1 1]> then\n            say [Welcome to the grasslands!]\n        end\n        if <(costume [name v]) = [level 1 2]> then\n            say [Collect all of the orbs to unlock the portal at the end.]\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 [Watch out for lava and spikes!]\n        end\n        if <(costume [name v]) = [level 1 7]> then\n            say [Collect 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            go to [back v] layer\n            say [Looks like you're in the deep caverns...]\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 [Found it! Get back... Long way to go!]\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!]\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) = [6]> then\n        if <(costume [name v]) = [level 4 1]> then\n            say [This is the last level!]\n        end\n        if <(costume [name v]) = [level 4 2]> then\n            say [It's going to be hard...]\n        end\n        if <(costume [name v]) = [level 4 3]> then\n            say [Some information: You are going to do a boss fight! Defeat the Boss by going on i'ts weak points. Watch out for the attacks of the Boss! Good luck!]\n        end\n    end\n    if <(LEVEL) = [5]> then\n        if <(costume [name v]) = [level 5 1]> then\n            say [Random generated level? Intresting! Let's see what's out there!]\n        end\n    end\n    if <(LEVEL) = [3]> then\n        if <(costume [name v]) = [level 6 2]> then\n            say [It's the desert!]\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 [And deep void...]\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\nelse\n    say []\nend\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 5 1 v)\nend\nif <(LEVEL) = [6]> 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\nwhen I start as a clone\ngo to [back v] layer\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            change size by (((85) - (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 (((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]\nCreate Level Icons\n\nwhen I receive [menu update v]\ndelete this clone\n\nwhen flag clicked\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: (25)\nrepeat (3)\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\n\nwhen I receive [menu open v]\nwait (0.1) seconds\nCreate Level Icons\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 []\nrepeat until <(letter (loop_#) of (answer)) = [/]>\n    set [$ v] to (join ($) (letter (loop_#) of (answer)))\n    change [loop_# 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@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@Menu Stuff\n\nwhen this sprite clicked\nif <(costume [name v]) = [Circle Skin]> then\n    if <($) > [9]> then\n        ask [Are you sure you want to buy this skin? It will cost you 10 coins.] and wait\n        if <(answer) = [Yes]> then\n            say [You have unlocked the cyclops skin!] for (2) seconds\n            replace item (1) of [skins unlocked v] with [1]\n            set [currentskin v] to [2]\n            change [$ v] by (-10)\n        end\n    else\n        show\n    end\nend\nif <(costume [name v]) = [Square Skin]> then\n    if <($) > [14]> then\n        ask [Are you sure you want to buy this skin? It will cost you 15 coins.] and wait\n        if <(answer) = [Yes]> then\n            say [You have unlocked the pattern skin!] for (2) seconds\n            replace item (1) of [skins unlocked v] with [1]\n            set [currentskin v] to [3]\n            change [$ v] by (-15)\n        end\n    else\n        show\n    end\nend\nif <(costume [name v]) = [MXNHD Skin]> then\n    if <($) > [24]> then\n        ask [Are you sure you want to buy this skin? It will cost you 25 coins.] and wait\n        if <(answer) = [Yes]> then\n            say [You have unlocked the pattern skin!] for (2) seconds\n            replace item (1) of [skins unlocked v] with [1]\n            set [currentskin v] to [4]\n            change [$ v] by (-25)\n        end\n    else\n        show\n    end\nend\nif <(costume [name v]) = [Button]> then\n    if <(x position) = [-160]> then\n        set [currentskin v] to [2]\n    end\n    if <(x position) = [0]> then\n        set [currentskin v] to [3]\n    end\n    if <(x position) = [-160]> then\n        set [currentskin v] to [4]\n    end\nend\nif <(costume [name v]) = [Default]> then\n    set [currentskin v] to [1]\nend\n\nwhen I receive [close menus v]\nhide\ndelete this clone\n\nwhen flag clicked\ndelete all of [shop unlocked v]\ndelete all of [skins unlocked v]\ngo to [front v] layer\nhide\nrepeat (3)\n    add [0] to [skins unlocked v]\nend\nrepeat (1)\n    add [0] to [shop unlocked v]\nend\n\nwhen I receive [open skins v]\nset size to (250) %\ngo to x: (-159) y: (0)\nswitch costume to (circle skin v)\ngo to [front v] layer\nshow\nwait (0.1) seconds\ngo to x: (-160) y: (0)\nrepeat (3)\n    create clone of (_myself_ v)\n    change x by (160)\n    next costume\nend\nhide\nset [# v] to [0]\ngo to x: (-160) y: (-90)\nrepeat (3)\n    change [# v] by (1)\n    switch costume to (button v)\n    if <(item (#) of [skins unlocked v]) = [1]> then\n        create clone of (_myself_ v)\n    end\n    change x by (160)\nend\nswitch costume to (default v)\ngo to x: (0) y: (65)\ngo to [front v] layer\nshow\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\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]) < [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 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\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\n\n@Menu\n\nwhen I receive [open skins v]\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]\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 flag clicked\nforever\n    change size by (((Size) - (size)) / (3))\nend\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\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@Coins\n\nwhen I receive [menu open v]\nhide\n\nwhen flag clicked\nforever\n    set volume to (Sound Effects Volume) %\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nset y to (((y) - (SCROLL Y)) + (([cos v] of (((timer) - (3)) * (400)) ) * (3)))\nif <touching (player v)?> then\n    start sound [Collect v]\n    set size to (100) %\n    clear graphic effects\n    change [$ v] by (1)\n    hide\n    delete this clone\nend\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: [60] y: [-10]\n    Clone at x: [1400] y: [-30]\n    Clone at x: [2085] y: [150]\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: [145]\n    Clone at x: [4635] y: [182]\n    Clone at x: [4635] y: [220]\nend\nif <(LEVEL) = [2]> then\n    Clone at x: [-999] y: [-999]\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [2020] y: [450]\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [-50] y: [-40]\n    Clone at x: [-100] y: [-40]\n    Clone at x: [-150] y: [-40]\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: [1175] y: [604]\n    Clone at x: [1345] y: [15]\n    Clone at x: [2265] y: [170]\nend\nif <(LEVEL) = [5]> then\n    Clone at x: [1600] y: [0]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [-999] y: [-999]\nend\nset [x v] to [-9999]\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)\n\n@Checkpoints\n\nwhen I receive [menu open v]\nhide\n\nwhen flag clicked\nforever\n    set volume to (Sound Effects Volume) %\nend\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            switch costume to (20 v)\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: [-5]\nend\nif <(LEVEL) = [4]> then\n    Clone at x: [500] y: [569]\n    Clone at x: [1410] y: [43]\n    Clone at x: [2325] y: [190]\nend\nif <(LEVEL) = [2]> then\n    Clone at x: [1800] y: [40]\n    Clone at x: [3900] y: [104]\nend\nif <(LEVEL) = [6]> then\n    Clone at x: [1600] y: [0]\n    Clone at x: [2850] y: [80]\nend\nif <(LEVEL) = [5]> then\n    Clone at x: [1700] y: [0]\n    Clone at x: [3575] y: [250]\nend\nif <(LEVEL) = [3]> then\n    Clone at x: [2150] y: [450]\n    Clone at x: [3990] y: [130]\n    Clone at x: [5150] y: [100]\n    Clone at x: [5150] y: [82]\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\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]\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\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <((mouse y) - (y position)) > [75]>>> then\n    if <(IN AIR) < [4]> then\n        set [sy v] to [18]\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)) / (10)))\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\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?> 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    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 []\n    set [display collected v] to (DISPLAY COLLECTED)\nend\n\ndefine Test - Die\nif <<touching (danger v)?> or <touching (attackthingboss v)?>> then\n    set [player exit v] to [die]\nend\n\ndefine Game - Win\nrepeat (50)\n    point towards (next levels v)\n    turn right (65) degrees\n    move ((distance to [next levels v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nwait (1) seconds\nif <not <(LEVEL) = [6]>> then\n    add ((LEVEL) + (1)) to [levels v]\n    set [menu v] to [True]\nend\nbroadcast (Menu Update v)\n\nwhen flag clicked\nset [counter v] to [0]\nforever\n    change [counter v] by (1)\n    if <(timer) > [1]> then\n        reset timer\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]\nwait (0.1) seconds\nwait until <<key (f v) pressed?> or <(MENU) = [True]>>\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]\n\nwhen I receive [setup v]\nset volume to (Sound Effects Volume) %\nwait (0.7) seconds\ngo to [front v] layer\n\nwhen I receive [boss fight v]\nforever\n    if <<touching (fireball v)?> or <touching (lazer v)?>> then\n        broadcast (-1 v)\n        repeat (2)\n            hide\n            wait (0.3) seconds\n            show\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#2aff00)?> then\n        broadcast (boss fight v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [dead v]\nbroadcast (Menu Open v)\nhide\n\nwhen flag clicked\nforever\n    if <<touching (next levels v)?> and <(LEVEL) = [6]>> then\n        broadcast (You win!!! v)\n        wait (2.3) seconds\n        stop [all v]\n    end\nend\n\n@End Boss\n\nwhen I receive [menu update v]\nhide\n\nwhen I receive [menu open v]\nhide\n\ndefine say aggresive random things\nsay (join [Hello, ] (join (username) [. You know who I am.])) for (2) seconds\nsay (join [This is where your adventure ends, ] (join (username) [.])) for (2) seconds\nsay [THERE IS NO WAY BACK!] for (2) seconds\nsay [YOU WILL BE DESTROYED!!!] for (2) seconds\nwait (1) seconds\n\nwhen I receive [boss fight v]\nset [ghost v] effect to (0)\nset [bftime v] to [0]\nshow\nswitch costume to (normal v)\nset [aspeed v] to [0.5]\ngo to x: (0) y: (300)\nglide (1) secs to x: (0) y: (120)\nsay aggresive random things\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 flag clicked\nhide\n\ndefine shake\nrepeat (15)\n    glide (0.05) secs to x: (13) y: (128)\n    glide (0.05) secs to x: (22) y: (113)\n    glide (0.05) secs to x: (3) y: (118)\n    glide (0.05) secs to x: (8) y: (109)\nend\nwait (0.4) seconds\nrepeat (45)\n    turn right (14) degrees\n    change [ghost v] effect by (1)\n    create clone of (_myself_ v)\nend\nhide\nbroadcast (You win!!! v)\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nshow\nset [ghost v] effect to (10)\npoint in direction (pick random (0) to (180))\nglide (0.3) secs to (random position v)\nhide\ndelete this clone\n\nwhen I receive [boss fight v]\nif <(MENU) = [0]> then\n    wait (35) seconds\n    shake\nelse\n    stop [this script v]\nend\n\n@Save\n\nwhen flag clicked\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 (uiterlijk1 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 [/] ($)))\nreplace item (2) of [save code v] with (SAVE CODE)\nhide list [save code v]\nwait (5) seconds\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@win\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to [front v] layer\nhide\n\nwhen I receive [you win!!! v]\nrepeat (10)\n    show\n    change [ghost v] effect by (-10)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\n\n