Islands -A Scrolling Platformer-

Instructions: Arrow keys/wad/mobile to move.\nAvoid spikes, saws, lava, enemies, and cacti.\nBounce on trampolines.\nThe flags are checkpoints.\nCollect power-ups and unlock skins throughout your journey.\nExplore the 3 islands.\n\n\n\n\n\nAlso there is an easter egg

@Stage\n\nwhen I receive [start v]\nforever\n    play sound [Sunlight v] until done\nend\n\n@Player\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <<touching (platforms v)?> or <touching (platforms2 v)?>>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <<touching (platforms v)?> or <touching (platforms2 v)?>> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <<touching (platforms v)?> or <touching (platforms2 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?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> 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)?> or <touching (platforms2 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 Tick\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    if <(water) = [0]> then\n        change [sx v] by (-2)\n    end\n    if <(water) = [1]> then\n        change [sx v] by (-1.5)\n    end\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    if <(water) = [0]> then\n        change [sx v] by (2)\n    end\n    if <(water) = [1]> then\n        change [sx v] by (1.5)\n    end\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <(water) = [0]> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        if <[4] > (in air)> then\n            if <(Jump boost) = [0]> then\n                set [sy v] to [16]\n            end\n            if <(Jump boost) = [1]> then\n                set [sy v] to [18]\n            end\n        end\n    end\n    change [sy v] by (-2)\n    Change Player y by (sy)\nend\nif <(water) = [1]> then\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n        set [sy v] to [5]\n    else\n        set [sy v] to [-1.5]\n    end\n    Change Player y by (sy)\nend\nset [scroll x v] to (x)\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nchange [scroll y v] by (round (((y) - (SCROLL Y)) / (10)))\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nPosition\nif <(y) < [-170]> then\n    set [exit v] to [die]\nend\nif <touching (water v)?> then\n    set [water v] to [1]\nelse\n    set [water v] to [0]\nend\nif <touching (bounce v)?> then\n    set [sy v] to [30]\nend\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\nif <touching (danger2 v)?> then\n    set [exit v] to [die]\nend\nif <touching (enemy v)?> then\n    set [exit v] to [die]\nend\nif <touching (enemy2 v)?> then\n    set [exit v] to [die]\nend\nif <touching (danger3 v)?> then\n    set [exit v] to [die]\nend\n\nwhen flag clicked\npoint in direction (90)\nset rotation style [don't rotate v]\nswitch costume to (costume3 v)\nset [menu v] to [0]\nset [jump boost v] to [0]\nset [check v] to [0]\nbroadcast (green flag v) and wait\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\ngo [backward v] (1) layers\n\nwhen I receive [playgame v]\nset [level v] to [1]\nforever\n    broadcast (reset v) and wait\n    broadcast (setup v) and wait\n    Game on\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (tick v) and wait\n    end\n    Die\nend\n\ndefine Game on\nif <(Check) = [0]> then\n    set [x v] to [-50]\n    set [y v] to [0]\nend\nif <(Check) = [1]> then\n    set [x v] to [3050]\n    set [y v] to [0]\nend\nif <(Check) = [2]> then\n    set [x v] to [4875]\n    set [y v] to [50]\nend\nif <(Check) = [3]> then\n    set [x v] to [8025]\n    set [y v] to [0]\nend\nif <(Check) = [4]> then\n    set [x v] to [1590]\n    set [y v] to [200]\nend\nif <(Check) = [5]> then\n    set [x v] to [10330]\n    set [y v] to [100]\nend\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset [scroll y v] to [0]\nset [scroll x v] to [0]\npoint in direction (90)\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\nwhen I receive [jump boost v]\nswitch costume to (costume2 v)\n\ndefine Die\nset rotation style [all around v]\nrepeat (10)\n    change y by (8)\n    change [ghost v] effect by (8)\n    turn right (18) degrees\nend\n\nwhen I receive [minimize v]\nswitch costume to (costume4 v)\n\nwhen I receive [start the game v]\nset [menu v] to [1]\nbroadcast (playgame v) and wait\n\n@Platforms\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Water\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nset [y v] to (([sin v] of ((timer) * (100)) ) * (10))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@danger\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@danger2\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nturn right (7) degrees\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [450] y: [-75]\nClone at x: [514] y: [75]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [35]\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 start as a clone\nhide\n\n@decorations\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\ngo to [back v] layer\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [start v]\nrepeat (10)\n    erase all\nend\n\n@Bounce\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Platforms2\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: ((482) * (5)) y: [0]\n\ndefine Clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen flag clicked\nforever\n    Clone at x: ((482) * (5)) y: [0]\n    repeat (200)\n        change [x v] by (1.5)\n    end\n    wait (.3) seconds\n    repeat (200)\n        change [x v] by (-1.5)\n    end\n    wait (.3) seconds\n    set [x v] to [0]\n    set [y v] to [0]\nend\n\n@Check 1\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [1]\nend\nif <<(Check) = [1]> or <<(Check) = [2]> or <(Check) = [3]>>> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (30)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Blank\n\n@Jump Boost\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [jump boost v] to [1]\n    broadcast (Jump boost v)\nend\nif <(Jump boost) = [1]> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (20)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Check 2\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [2]\nend\nif <<(Check) = [2]> or <(Check) = [3]>> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (30)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Enemy\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: ((482) * (9)) y: [0]\n\ndefine Clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen flag clicked\nforever\n    Clone at x: ((482) * (9)) y: [0]\n    repeat (100)\n        change [x v] by (1.5)\n    end\n    wait (.3) seconds\n    repeat (100)\n        change [x v] by (-1.5)\n    end\n    wait (.3) seconds\n    set [x v] to [0]\n    set [y v] to [0]\nend\n\n@Minimize\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    broadcast (Minimize v)\n    set [minimize v] to [1]\nend\nif <(Minimize) = [1]> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (20)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nset [minimize v] to [0]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Check 3\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [3]\nend\nif <(Check) = [3]> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (30)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Enemy2\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nClone at x: ((482) * (18)) y: [0]\n\ndefine Clone at x: (x) y: (y)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen flag clicked\nforever\n    Clone at x: ((482) * (18)) y: [0]\n    repeat (100)\n        change [x v] by (1.5)\n    end\n    wait (.3) seconds\n    repeat (100)\n        change [x v] by (-1.5)\n    end\n    wait (.3) seconds\n    set [x v] to [0]\n    set [y v] to [0]\nend\n\n@danger3\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nturn right (7) degrees\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nshow\nset [ghost v] effect to (20)\ngo to [back v] layer\nrepeat until <(Menu) = [1]>\n    set [ghost v] effect to (20)\nend\n\nwhen I receive [start the game v]\nhide\n\n@Sprite3\n\nwhen flag clicked\nset [position v] to [-250]\ngo to x: (0) y: (-50)\nhide\n\nwhen I receive [start v]\npoint in direction (75)\nshow\nset [ghost v] effect to (20)\ngo to [front v] layer\nswitch costume to (costume1 v)\nrepeat until <(Menu) = [1]>\n    show\n    set [ghost v] effect to (20)\n    go to [front v] layer\n    set [speed v] to [3]\n    repeat until <(speed) < [.2]>\n        set [speed v] to ((speed) * (.9))\n        turn right (speed) degrees\n    end\n    set [speed v] to [3]\n    repeat until <(speed) < [.2]>\n        set [speed v] to ((speed) * (.9))\n        turn left (speed) degrees\n    end\nend\n\nwhen I receive [start the game v]\nhide\n\nwhen I receive [start v]\npoint in direction (75)\nshow\nset [ghost v] effect to (20)\ngo to [front v] layer\nswitch costume to (costume1 v)\nrepeat until <(Menu) = [1]>\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\npoint in direction (75)\nshow\nset [ghost v] effect to (20)\ngo to [front v] layer\nswitch costume to (costume1 v)\nrepeat until <(Menu) = [1]>\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            set [menu v] to [1]\n            broadcast (transition v)\n        end\n    end\nend\n\n@Transition\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nif <(letter ((length of ((Background#) / (2))) - (1)) of ((Background#) / (2))) = [.]> then\n    switch costume to (2 v)\nelse\n    switch costume to ( v)\nend\ngo to [front v] layer\nclear graphic effects\nset size to (100) %\ngo to x: ((Background#) - (((Background#) / (35)) - (1))) y: (345)\nrepeat until <(round (y position)) = [0]>\n    change y by (((0) - (y position)) / (4))\nend\nwait (1) seconds\nclear graphic effects\nrepeat until <(round (y position)) = [-345]>\n    change y by (((345) - (y position)) / (-16))\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [transition v]\npoint in direction (90)\nhide\nset [background# v] to [0]\nrepeat (14)\n    create clone of (_myself_ v)\n    change [background# v] by (35)\nend\nwait (.3) seconds\nbroadcast (Start the game v)\n\nwhen flag clicked\nhide\n\n@Sprite4\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nshow\nset [ghost v] effect to (0)\ngo to [front v] layer\nrepeat until <(Menu) = [1]>\n    set [ghost v] effect to (0)\nend\n\nwhen I receive [start the game v]\nhide\n\n@Check 4\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [4]\nend\nif <<(Check) = [1]> or <<(Check) = [2]> or <<(Check) = [3]> or <(Check) = [4]>>>> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (30)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@Check 5\n\nwhen I receive [tick v]\nposition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\nif <touching (player v)?> then\n    set [check v] to [5]\nend\nif <(Check) = [5]> then\n    set [ghost v] effect to (0)\nelse\n    set [ghost v] effect to (30)\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [reset v]\nrepeat (3)\n    delete this clone\nend\n\nwhen I receive [setup v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (1 v)\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\nClone at x: [482] y: [0]\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 start as a clone\nhide\n\n@intro\n\nwhen flag clicked\nset volume to (100) %\nstart sound [Super intro v]\nswitch costume to (costume2 v)\nset size to (100) %\nerase all\nhide\nset [ghost v] effect to (0)\npen up\ngo to x: (-231) y: (-240)\nset pen size to (100)\nset pen color to (#00f307)\npen down\nrepeat (3)\n    point in direction (0)\n    repeat (20)\n        move (20) steps\n    end\n    point in direction (90)\n    repeat (5)\n        move (20) steps\n    end\n    point in direction (180)\n    repeat (20)\n        move (20) steps\n    end\n    point in direction (90)\n    repeat (5)\n        move (20) steps\n    end\nend\npen up\nshow\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nset size to (200) %\npoint in direction (90)\nshow\nrepeat (20)\n    change size by (-10)\n    turn right (10) degrees\nend\nrepeat (10)\n    change size by (20)\n    turn right (10) degrees\nend\npoint in direction (90)\nrepeat (10)\n    change size by (-10)\nend\nwait (.5) seconds\nrepeat (20)\n    turn right (18) degrees\n    create clone of (_myself_ v)\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nerase all\nbroadcast (start v)\nerase all\ndelete this clone\n\nwhen flag clicked\nforever\n    set pen color to (#00f307)\n    wait (.5) seconds\n    repeat (17)\n        change pen (color v) by (-1)\n    end\n    set pen color to (#ffe900)\n    wait (.5) seconds\n    repeat (14)\n        change pen (color v) by (-1)\n    end\n    set pen color to (#ff0000)\n    wait (.5) seconds\n    repeat (32)\n        change pen (color v) by (1)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nset pen size to (100)\nset pen color to (#ffffff)\npen down\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\nend\ndelete this clone\n\n