Cosmic -A Platformer-


@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop7 v)\nshow list [players v]\nadd (username) to [players v]\n\nnext backdrop\n\nwhen flag clicked\nwait (.3) seconds\nforever\n    if <<(username) = [My_Name_is-----]> and <key (i v) pressed?>> then\n        hide list [players v]\n    else\n        show list [players v]\n    end\nend\n\nwhen flag clicked\n\nif <(username) = [My_Name_Is-----]> then\n    ask [level?????] and wait\nend\nset [level v] to (answer)\nbroadcast (change level v)\n\nwhen flag clicked\nforever\n    if <(level) = [43]> then\n        switch backdrop to (backdrop1 v)\n    else\n        if <(level) > [43]> then\n            broadcast (show v)\n            switch backdrop to (backdrop2 v)\n        else\n            switch backdrop to (backdrop7 v)\n        end\n    end\nend\n\n@Sprite2\n\ndefine Next Level when <next level>\nif <next level> then\n    change [level v] by (1)\n    broadcast (change level v)\n    set [x speed v] to [0]\n    set [y speed v] to [0]\n    go to x: (-190) y: (50)\nend\n\ndefine Die when <death>\nif <death> then\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    set [ghost v] effect to (0)\n    go to x: (-190) y: (50)\n    set [x speed v] to [0]\n    set [y speed v] to [0]\n    change [deaths v] by (1)\n    broadcast (Death v)\nend\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\ndefine setup\nswitch costume to (costume v)\nset rotation style [left-right v]\ngo to x: (-190) y: (50)\nset [level v] to [1]\nbroadcast (change level v)\nset [x speed v] to [0]\nset [y speed v] to [0]\ngo to [front v] layer\nshow\n\nwhen I receive [start v]\nsetup\nforever\n    Platform with Speed [9] Acceleration [1] Friction [0.9] Jump [13] Gravity [1] , Wall Jump Speed [6] Jump [10] Head Bounce [0] Bouncy [28] , Wall / slope factor [5]\n    Die when <<<touching (cat empire ufo v)?> or <touching (cat 2 v)?>> or <<(y position) > [175.9]> or <<(y position) < [-178]> or <<<touching (spikes v)?> or <touching (lava v)?>> or <touching (cat 1 v)?>>>>>\n    Next Level when <(x position) > [235]>\n    if <(Cave) = [1]> then\n        stop [this script v]\n    end\nend\n\ndefine Platform with Speed (speed) Acceleration (acceleration) Friction (friction) Jump (jumping power) Gravity (gravity) , Wall Jump Speed (wall speed) Jump (wall jump) Head Bounce (head bounce) Bouncy (bounce) , Wall / slope factor (wall slope factor)\nchange [y speed v] by ((gravity) * (-1))\nif  then\n    broadcast (right v)\n    if <(BB8) = [0]> then\n        point in direction (90)\n    end\n    if <(x speed) < (speed)> then\n        change [x speed v] by (acceleration)\n    end\n    if <(x speed) > (speed)> then\n        set [x speed v] to (speed)\n    end\nelse\n    if  then\n        broadcast (left v)\n        if <(BB8) = [0]> then\n            point in direction (-90)\n        end\n        if <(x speed) > ((speed) * (-1))> then\n            change [x speed v] by ((acceleration) * (-1))\n        end\n        if <(x speed) < ((speed) * (-1))> then\n            set [x speed v] to ((speed) * (-1))\n        end\n    else\n        set [x speed v] to ((x speed) * (friction))\n    end\nend\nchange x by (x speed)\nrepeat (wall slope factor)\n    if <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>> then\n        change y by (1)\n    end\nend\nif <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>> then\n    change y by ((-1) * (wall slope factor))\n    repeat until <not <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>>>\n        change x by (((x speed) / ([abs v] of (x speed) )) * (-1))\n    end\n    if  then\n        if <(x speed) > [0]> then\n            set [x speed v] to ((wall speed) * (-1))\n        else\n            set [x speed v] to (wall speed)\n        end\n        if <not <(wall jump) = [0]>> then\n            set [y speed v] to (wall jump)\n        end\n    else\n        set [x speed v] to [0]\n    end\nend\nchange y by (y speed)\nif <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>> then\n    if <(y speed) > [0]> then\n        repeat until <not <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>>>\n            change y by (-1)\n        end\n        set [y speed v] to (((y speed) * (head bounce)) * (-1))\n    else\n        repeat until <not <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>>>\n            change y by (1)\n        end\n        set [y speed v] to [0]\n    end\n    if <touching (bounce v)?> then\n        set [y speed v] to (bounce)\n    end\nelse\n    if <touching (bounce v)?> then\n        if <(y speed) < [0]> then\n            change y by ((y speed) * (-1))\n            if <not <touching (bounce v)?>> then\n                change y by (y speed)\n                repeat until <<not <touching (bounce v)?>> or >\n                    change y by (1)\n                end\n            else\n                change y by (y speed)\n            end\n        end\n        set [y speed v] to (bounce)\n    end\nend\nchange y by (-1)\nif <touching (bounce v)?> then\n    set [y speed v] to (bounce)\nelse\n    if <<touching (hover thing v)?> or <<touching (platform v)?> or <touching (wall v)?>>> then\n        if  then\n            set [y speed v] to (jumping power)\n        end\n    end\nend\nchange y by (1)\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nif <[] = [1]> then\n    switch costume to (costume13 v)\n    delete this clone\nelse\n    repeat (3)\n        change [ghost v] effect by (15)\n        if <(BB8) = [0]> then\n            change size by (-5)\n        end\n        if <(BB8) = [1]> then\n            hide\n        end\n    end\n    delete this clone\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [skip v]\ngo to x: (-190) y: (50)\n\nwhen I receive [music v]\nset volume to (100) %\n\nwhen I receive [no music v]\nset volume to (0) %\n\nwhen I receive [cat v]\nswitch costume to (costume5 v)\n\nwhen I receive [christine v]\nswitch costume to (costume8 v)\n\nwhen I receive [fire v]\nswitch costume to (costume4 v)\n\nwhen I receive [comet v]\nswitch costume to (costume7 v)\n\nwhen I receive [forest v]\nswitch costume to (costume1 v)\n\nwhen I receive [normal v]\nswitch costume to (costume2 v)\n\nwhen I receive [transparent v]\nswitch costume to (costume6 v)\n\nwhen flag clicked\nset volume to (100) %\nforever\n    play sound [Radiant v] until done\nend\n\nwhen flag clicked\nforever\n    set [y v] to (y position)\nend\n\nwhen flag clicked\nforever\n    if <<not <(costume [number v]) = [5]>> and <touching (sprite7 v)?>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (0)\n        go to x: (-190) y: (50)\n        set [x speed v] to [0]\n        set [y speed v] to [0]\n        change [deaths v] by (1)\n        broadcast (Death v)\n    end\nend\n\nwhen I receive [animation v]\nwait (21.75) seconds\n\nwhen I receive [elimeno p v]\nswitch costume to (costume9 v)\n\nwhen I receive [baby yoda v]\nswitch costume to (costume10 v)\n\nwhen flag clicked\nset [bb8 v] to [0]\nforever\n    if <(costume [number v]) = [11]> then\n        set [bb8 v] to [1]\n        set size to (15) %\n    else\n        set [bb8 v] to [0]\n        set size to (40) %\n    end\n    if <(level) = [39]> then\n        broadcast (Maze v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [11]> then\n        set rotation style [all around v]\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            turn right (25) degrees\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            set rotation style [all around v]\n            turn left (25) degrees\n        end\n        if <<(costume [number v]) = [11]> and <(x speed) > [0]>> then\n            repeat until <(x speed) = [0]>\n                turn right ((1.3) * (x speed)) degrees\n            end\n        end\n        if <<(costume [number v]) = [11]> and <(x speed) < [0]>> then\n            repeat until <(x speed) = [0]>\n                turn left ((1.3) / (x speed)) degrees\n            end\n        end\n    else\n        set rotation style [left-right v]\n    end\nend\n\nwhen I receive [ice v]\nswitch costume to (costume3 v)\n\nchange size by (-1.75)\n\nwhen I receive [bb8 v]\nswitch costume to (costume11 v)\n\nwhen I receive [settings open v]\nset [x speed v] to [0]\n\nwhen I receive [r2d2 v]\nswitch costume to (costume12 v)\n\nwhen flag clicked\nset [cave v] to [0]\n\nwhen flag clicked\nforever\n    if <touching (sprite14 v)?> then\n        set [cave v] to [1]\n    end\nend\n\nwhen I receive [continue v]\ngo to x: (-190) y: (50)\nforever\n    Platform with Speed [9] Acceleration [1] Friction [0.9] Jump [13] Gravity [1] , Wall Jump Speed [6] Jump [10] Head Bounce [0] Bouncy [28] , Wall / slope factor [5]\n    Die when <<<touching (cat empire ufo v)?> or <touching (cat 2 v)?>> or <<(y position) > [175.9]> or <<(y position) < [-175]> or <<<touching (spikes v)?> or <touching (lava v)?>> or <touching (cat 1 v)?>>>>>\n    Next Level when <(x position) > [235]>\n    if <(level) = [39]> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Cave) = [1]> then\n        hide\n        broadcast (cave v)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    set [x v] to (x position)\nend\n\nwhen I receive [continue v]\nshow\nchange [level v] by (1)\nbroadcast (change level v)\n\nwhen I receive [maze v]\nchange y by (1)\nforever\n    if <(costume [number v]) = [11]> then\n        set [bb8 v] to [1]\n        set size to (7) %\n    else\n        set [bb8 v] to [0]\n        set size to (20) %\n    end\n    if <not <(level) = [39]>> then\n        broadcast (no maze v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [no maze v]\nforever\n    if <(costume [number v]) = [11]> then\n        set [bb8 v] to [1]\n        set size to (15) %\n    else\n        set [bb8 v] to [0]\n        set size to (40) %\n    end\nend\n\nwhen I receive [restart level v]\ngo to x: (-190) y: (50)\nbroadcast (change level v)\n\nwhen I receive [maze v]\nforever\n    if <(costume [number v]) = [11]> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            repeat until <<not <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <touching (platform v)?>>\n                change y by (4)\n            end\n        end\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            repeat until <<not <<key (down arrow v) pressed?> or <key (s v) pressed?>>> or <touching (platform v)?>>\n                change y by (-4)\n            end\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            repeat until <<not <<key (right arrow v) pressed?> or <key (d v) pressed?>>> or <touching (platform v)?>>\n                turn right (15) degrees\n                change x by (4)\n            end\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            repeat until <<not <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <touching (platform v)?>>\n                turn left (15) degrees\n                change x by (-4)\n            end\n        end\n        if <(X) > [230]> then\n            change [level v] by (1)\n            broadcast (change level v)\n            broadcast (no maze v)\n            stop [this script v]\n        end\n        if <(level) > [39]> then\n            stop [this script v]\n        end\n    else\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            repeat until <<not <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <touching (platform v)?>>\n                change y by (4)\n            end\n        end\n        if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n            repeat until <<not <<key (down arrow v) pressed?> or <key (s v) pressed?>>> or <touching (platform v)?>>\n                change y by (-4)\n            end\n        end\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            repeat until <<not <<key (right arrow v) pressed?> or <key (d v) pressed?>>> or <touching (platform v)?>>\n                point in direction (90)\n                change x by (4)\n            end\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            repeat until <<not <<key (left arrow v) pressed?> or <key (a v) pressed?>>> or <touching (platform v)?>>\n                point in direction (-90)\n                change x by (-4)\n            end\n        end\n        if <(X) > [230]> then\n            change [level v] by (1)\n            broadcast (change level v)\n            broadcast (no maze v)\n            stop [this script v]\n        end\n        if <(level) > [39]> then\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [maze v]\nforever\n    if <touching (platform v)?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        go to x: (-190) y: (50)\n        clear graphic effects\n    end\n    if <(level) > [39]> then\n        stop [this script v]\n    end\nend\n\nwhen I receive [no maze v]\ngo to x: (-190) y: (50)\nforever\n    Platform with Speed [9] Acceleration [1] Friction [0.9] Jump [13] Gravity [1] , Wall Jump Speed [6] Jump [10] Head Bounce [0] Bouncy [28] , Wall / slope factor [5]\n    Die when <<<touching (cat empire ufo v)?> or <touching (cat 2 v)?>> or <<(y position) > [175.9]> or <<(y position) < [-175]> or <<<touching (spikes v)?> or <touching (lava v)?>> or <touching (cat 1 v)?>>>>>\n    Next Level when <(x position) > [235]>\nend\n\nwhen flag clicked\nset [deaths v] to [0]\nset [time v] to [0]\nforever\n    if <(level) > [39]> then\n        create clone of (_myself_ v)\n    end\nend\n\n@Ad\n\nwhen flag clicked\nhide\nforever\n    wait (pick random (25) to (35)) seconds\n    go to x: (0) y: (50)\n    show\n    go to [front v] layer\n    repeat (4)\n        change y by (-2)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2.5) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\nwhen flag clicked\nforever\n    if <(Cave) = [1]> then\n        hide\n    end\nend\n\n@Text\n\nwhen flag clicked\nhide\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    if <touching (sprite2 v)?> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Lava\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    repeat (5)\n        change y by (2)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-2)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nrepeat (10)\n    change y by (-2)\nend\n\nwhen I receive [pixel v]\nrepeat (1)\n    change [pixelate v] effect by (37)\nend\n\nwhen I receive [challenge v]\nchange [pixelate v] effect by (-37)\n\nwhen flag clicked\ngo to x: (31) y: (-190)\nhide\ngo to [back v] layer\n\n@Spikes\n\nwhen I receive [change level v]\ngo to x: (-54) y: (-77)\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen I receive [animation v]\nshow\nswitch costume to (costume1 v)\nchange x by (-.75)\nforever\n    go to [back v] layer\nend\n\nwhen I receive [alarm v]\nhide\nchange x by (.75)\n\nwhen flag clicked\nforever\n    if <touching (sprite6 v)?> then\n        go [forward v] (1) layers\n    end\nend\n\nwhen flag clicked\nhide\n\n@Bounce\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen I receive [pixel v]\nrepeat (1)\n    change [pixelate v] effect by (37)\nend\n\nwhen I receive [challenge v]\nchange [pixelate v] effect by (-37)\n\nwhen flag clicked\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    wait (.001) seconds\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nwait (1.0001) seconds\nforever\n    wait (.001) seconds\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nwhen flag clicked\nwait (1.00001) seconds\nforever\n    wait (.001) seconds\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\n@hover thing\n\nwhen flag clicked\ngo to x: (-193) y: (148)\nforever\n    set drag mode [draggable v]\nend\n\nwhen I receive [change level v]\ngo to x: (-193) y: (135)\nforever\n    set drag mode [draggable v]\nend\n\nwhen flag clicked\nset size to (100) %\nset [ghost v] effect to (0)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (costume1 v)\nrepeat (8)\n    change [ghost v] effect by (13)\nend\ndelete this clone\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\n@message\n\nwhen flag clicked\ngo to x: (27) y: (-78)\npoint in direction (90)\nset size to (100) %\nforever\n    if <touching (sprite2 v)?> then\n        repeat (50)\n            turn right (10) degrees\n            change size by (-2)\n        end\n        hide\n        broadcast (message v)\n    end\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (2)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-2)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\ndefine Twist\nforever\n    repeat (50)\n        turn right (.5) degrees\n    end\n    repeat (100)\n        turn left (.5) degrees\n    end\n    repeat (50)\n        turn right (.5) degrees\n    end\nend\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\n@Cat 1\n\ndefine march\npoint in direction (90)\ngo to x: (150) y: (-116)\nforever\n    point in direction (-90)\n    glide (2) secs to x: (-140) y: (-116)\n    wait (.05) seconds\n    point in direction (90)\n    glide (2) secs to x: (150) y: (-116)\n    wait (.05) seconds\nend\n\nwhen I receive [change level v]\nforever\n    march\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\nforever\n    set rotation style [left-right v]\nend\n\n@Cat 2\n\ndefine march\npoint in direction (90)\ngo to x: (-140) y: (-116)\nforever\n    point in direction (90)\n    glide (2) secs to x: (150) y: (-116)\n    wait (.05) seconds\n    point in direction (-90)\n    glide (2) secs to x: (-140) y: (-116)\n    wait (.05) seconds\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\nforever\n    set rotation style [left-right v]\nend\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen I receive [change level v]\nforever\n    march\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n@Platform\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\ngo to x: (35) y: (35)\nhide\n\n@Skip\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [start v]\nset [skips v] to [0]\ngo to x: (-194) y: (-158)\nshow\ngo to [front v] layer\nswitch costume to (costume1 v)\nif <(costume [number v]) = [1]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            set size to (110) %\n            if <mouse down?> then\n                change [level v] by (1)\n                change [skips v] by (1)\n                broadcast (change level v)\n                broadcast (Skip v)\n                switch costume to (costume2 v)\n                pause\n                switch costume to (costume1 v)\n            end\n        else\n            set size to (100) %\n            set [color v] effect to (0)\n        end\n    end\nend\n\ndefine pause\nrepeat (10)\n    wait (.75) seconds\nend\n\nwhen flag clicked\nforever\n    if <(Cave) = [1]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [32]> then\n        show\n        stop [this script v]\n    end\nend\n\n@sign\n\nwhen flag clicked\nhide\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <touching (sprite2 v)?> then\n        set size to (100) %\n        point in direction (90)\n    else\n        set size to (25) %\n        point in direction (105)\n    end\nend\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\n@Schnauzers\n\nwhen flag clicked\nhide\n\n@360° Spin\n\nwhen I receive [7 v]\ngo to [front v] layer\ngo to x: (0) y: (0)\npoint in direction (90)\nset size to (100) %\nclear graphic effects\nhide\nset [clone id v] to [Text]\ncreate clone of (_myself_ v)\nwait (2) seconds\n\nwhen I start as a clone\nrepeat (3)\n    if <(Clone ID) = [Text]> then\n        switch costume to (text v)\n        point in direction (90)\n        wait (.25) seconds\n        repeat (3)\n            turn right (32) degrees\n        end\n        repeat until <(round (direction)) = (round (90))>\n            turn right (((90) - (direction)) / (5)) degrees\n        end\n    end\nend\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (start v)\n\nwhen I start as a clone\nshow\n\nwhen I receive [delete v]\ndelete this clone\n\nset size to (130) %\n\nset size to (0) %\n\n@Sprite9\n\nwhen flag clicked\nshow\nbroadcast (5 v)\nbroadcast (7 v)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Confetti Side\n\nwhen I receive [5 v]\ngo to x: (0) y: (0)\npoint in direction (90)\nset size to (100) %\nclear graphic effects\nhide\nEPIC CONFETTI\nwait (2) seconds\n\nwhen I start as a clone\nif <(Clone ID) = [Confetti]> then\n    switch costume to (pick random (1) to (2))\n    set [color v] effect to (pick random (0) to (200))\n    set [ghost v] effect to (100)\n    set size to (pick random (25) to (75)) %\n    Go To Edge\n    if <(x position) > [0]> then\n        set [y v] to (pick random (25) to (-10))\n        set [x v] to (pick random (-30) to (-5))\n    else\n        set [y v] to (pick random (25) to (-10))\n        set [x v] to (pick random (5) to (30))\n    end\n    repeat until <(round (round (round (round (round (round (round (round (y))))))))) = (round (round (round (round (round (round (round (round (-15)))))))))>\n        change y by (y)\n        change [y v] by (-1)\n        change [ghost v] effect by (-20)\n        change x by (x)\n        change [x v] by (((0) - (x)) / (9))\n    end\n    repeat until <[-190] > (y position)>\n        change y by (y)\n        change x by (x)\n        change [x v] by (((0) - (x)) / (5))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nshow\n\nwhen I receive [delete v]\ndelete this clone\n\ndefine EPIC CONFETTI\ngo to [front v] layer\nset [clone id v] to [Confetti]\nrepeat (50)\n    create clone of (_myself_ v)\n    wait (pick random (0) to (.05)) seconds\nend\n\ndefine Go To Edge\nrepeat until <touching (_edge_ v)?>\n    go to (random position v)\nend\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        point in direction (60)\n        if <mouse down?> then\n            broadcast (settings open v)\n        end\n    else\n        point in direction (90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Cave) = [1]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [32]> then\n        show\n        stop [this script v]\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\ngo to x: (-3) y: (-6)\nhide\ngo to [front v] layer\n\nwhen I receive [settings open v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nclear graphic effects\n\n@close\n\nchange [color v] effect by (25)\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\nwhen I receive [close option v]\ngo to x: (2) y: (117)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (15)\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (close v)\n        end\n    else\n        set [brightness v] effect to (0)\n        set size to (100) %\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1.5)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1.5)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\nwhen flag clicked\ngo to x: (2) y: (117)\npoint in direction (90)\nhide\ngo to [front v] layer\n\nwhen I receive [settings open v]\nshow\nbroadcast (close option v)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\n@music\n\nturn right (.1) degrees\n\nwhen flag clicked\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        broadcast (no music v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [2]> then\n        broadcast (music v)\n    end\nend\n\nwhen I receive [close option v]\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        next costume\n        wait (.2) seconds\n    end\nend\n\nwhen I receive [shop open v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to x: (-102) y: (70)\npoint in direction (90)\nhide\ngo to [front v] layer\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn left (.07) degrees\n    end\n    repeat (80)\n        turn right (.07) degrees\n    end\n    repeat (40)\n        turn left (.07) degrees\n    end\nend\n\nwhen I receive [settings open v]\nshow\nbroadcast (close option v)\ngo to x: (-102) y: (70)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\n@Left\n\nwhen flag clicked\nhide\n\nwhen I receive [close option v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (previous costume v)\n            wait (.3) seconds\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\nwhen flag clicked\nforever\n    Buffer\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\nwhen I receive [settings open v]\ngo to x: (-93) y: (-100)\npoint in direction (90)\nshow\nbroadcast (close option v)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen I receive [shop open v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\n@right\n\nwhen flag clicked\nhide\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [settings open v]\ngo to x: (93) y: (-100)\npoint in direction (90)\nshow\nbroadcast (close option v)\nforever\n    go to [front v] layer\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen I receive [close option v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (next costume v)\n            wait (.3) seconds\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [shop open v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\n@Costume reference\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [settings open v]\ngo to x: (-6) y: (-92)\npoint in direction (90)\nshow\nbroadcast (close option v)\nforever\n    go to [front v] layer\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nnext costume\n\nwhen I receive [close option v]\nforever\n    if <(costume [number v]) = [11]> then\n        if <touching (mouse-pointer v)?> then\n            set size to (35) %\n            if <mouse down?> then\n        else\n            set size to (30) %\n        end\n    else\n        if <touching (mouse-pointer v)?> then\n            set size to (110) %\n            if <mouse down?> then\n        else\n            set size to (100) %\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        broadcast (Normal v)\n    end\n    if <(costume [number v]) = [2]> then\n        broadcast (Forest v)\n    end\n    if <(costume [number v]) = [3]> then\n        broadcast (Ice v)\n    end\n    if <(costume [number v]) = [4]> then\n        broadcast (fire v)\n    end\n    if <(costume [number v]) = [5]> then\n        broadcast (cat v)\n    end\n    if <(costume [number v]) = [6]> then\n        broadcast (transparent v)\n    end\n    if <(costume [number v]) = [7]> then\n        broadcast (comet v)\n    end\n    if <(costume [number v]) = [8]> then\n        broadcast (christine v)\n    end\n    if <(costume [number v]) = [9]> then\n        broadcast (elimeno p v)\n    end\n    if <(costume [number v]) = [10]> then\n        broadcast (Baby Yoda v)\n    end\n    if <(costume [number v]) = [11]> then\n        broadcast (bb8 v)\n    end\n    if <(costume [number v]) = [12]> then\n        broadcast (r2d2 v)\n    end\nend\n\nwhen I receive [previous costume v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen I receive [next costume v]\nswitch costume to ((costume [number v]) + (1))\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [12]> then\n        set [r2d2 v] to [1]\n    else\n        set [r2d2 v] to [0]\n    end\nend\n\nwhen I receive [shop open v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\n@Sprite20\n\nwhen flag clicked\nforever\n    if <(username) = [My_Name_Is-----]> then\n        if <key (s v) pressed?> then\n            broadcast (change level v)\n            change [level v] by (1)\n            wait (.1) seconds\n        end\n    end\nend\n\nwhen flag clicked\nhide variable [☁ total time v]\nrepeat until <(level) = [46]>\n    change [☁ total time v] by (1)\n    wait (1) seconds\nend\n\nwhen flag clicked\nhide variable [time v]\nrepeat until <(level) = [46]>\n    change [time v] by (.1)\n    wait (.1) seconds\nend\n\n@Items\n\nturn right (.1) degrees\n\nwhen flag clicked\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to x: (-10) y: (5)\npoint in direction (90)\nhide\ngo to [front v] layer\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nwait (0.09) seconds\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn left (.07) degrees\n    end\n    repeat (80)\n        turn right (.07) degrees\n    end\n    repeat (40)\n        turn left (.07) degrees\n    end\nend\n\nwhen I receive [settings open v]\nshow\nbroadcast (close option v)\ngo to x: (-10) y: (5)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [close option v]\ngo to x: (-10) y: (5)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (15)\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (shop open v)\n            close\n        end\n    else\n        set [brightness v] effect to (0)\n        set size to (100) %\n    end\nend\n\ndefine close\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nwait (0.09) seconds\ngo to x: (400) y: (400)\nclear graphic effects\n\n@Sprite1\n\nwhen I receive [shop open v]\nforever\n    Twist\nend\n\nwhen I receive [shop open v]\nforever\n    Buffer\nend\n\nwhen I receive [shop open v]\ngo to x: (-105) y: (-42)\nshow\n\nwhen flag clicked\npoint in direction (90)\nhide\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nwhen I receive [close option v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (previous item v)\n            wait (.3) seconds\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [settings open v]\ngo to x: (400) y: (400)\n\nwhen I receive [settings open v]\nhide\n\n@Sprite3\n\nwhen I receive [shop open v]\nforever\n    Twist\nend\n\nwhen I receive [shop open v]\nforever\n    Buffer\nend\n\nwhen I receive [shop open v]\nshow\ngo to x: (105) y: (-42)\n\nwhen flag clicked\npoint in direction (90)\nhide\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nwhen I receive [close option v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (next item v)\n            wait (.3) seconds\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [settings open v]\ngo to x: (400) y: (400)\n\nwhen I receive [settings open v]\nhide\n\n@Sprite4\n\nwhen I receive [shop open v]\nforever\n    Twist\nend\n\nwhen I receive [shop open v]\nforever\n    Buffer\nend\n\nwhen I receive [shop open v]\ngo to x: (-5) y: (-42)\nshow\n\nwhen flag clicked\nswitch costume to (costume1 v)\npoint in direction (90)\nhide\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nwhen I receive [close option v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n        if <mouse down?> then\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [next item v]\nswitch costume to ((costume [number v]) + (1))\n\nwhen I receive [previous item v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [1]> then\n        broadcast (Nothing v)\n    end\n    if <(costume [number v]) = [2]> then\n        broadcast (top hat v)\n    end\n    if <(costume [number v]) = [3]> then\n        broadcast (sword v)\n    end\n    if <(costume [number v]) = [4]> then\n        broadcast (shine v)\n    end\n    if <(costume [number v]) = [5]> then\n        broadcast (normal hat v)\n    end\n    if <(costume [number v]) = [6]> then\n        broadcast (blue hat v)\n    end\n    if <(costume [number v]) = [7]> then\n        broadcast (red v)\n    end\n    if <(costume [number v]) = [8]> then\n        broadcast (Blue v)\n    end\n    if <(costume [number v]) = [9]> then\n        broadcast (green v)\n    end\nend\n\nwhen I receive [settings open v]\ngo to x: (400) y: (400)\n\n@Items2\n\nwhen flag clicked\nswitch costume to (nothing v)\nforever\n    go to x: (X) y: (Y)\nend\n\nwhen I receive [nothing v]\nswitch costume to (nothing v)\n\nwhen I receive [normal hat v]\nswitch costume to (normal hat v)\n\nwhen I receive [shine v]\nswitch costume to (shine v)\n\nwhen I receive [sword v]\nswitch costume to (sword v)\n\nwhen I receive [top hat v]\nswitch costume to (top hat v)\n\nwhen flag clicked\nhide\nwait (10) seconds\nshow\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    if <(costume [name v]) = [Shine]> then\n        go to [back v] layer\n    else\n        go to [front v] layer\n    end\nend\n\nwhen I receive [mustache v]\nswitch costume to (red v)\n\nwhen flag clicked\nset size to (50) %\nforever\n    set rotation style [left-right v]\nend\n\nwhen I receive [left v]\npoint in direction (-90)\n\nwhen I receive [right v]\npoint in direction (90)\n\nwhen I receive [blue v]\nswitch costume to (blue v)\n\nwhen I receive [green v]\nswitch costume to (green v)\n\nwhen I receive [red v]\nswitch costume to (red v)\n\nwhen flag clicked\nforever\n    if <<(BB8) = [1]> and <<(costume [name v]) = [Top hat]> or <<(costume [name v]) = [Normal hat]> or <(costume [number v]) = [Blue hat]>>>> then\n        go to x: (X) y: ((Y) + (20))\n    else\n        go to x: (X) y: (Y)\n    end\nend\n\nwhen I receive [blue hat v]\nswitch costume to (blue hat v)\n\nwhen I receive [maze v]\nrepeat until <not <(level) = [39]>>\n    set size to (25) %\nend\n\nwhen flag clicked\nforever\n    if <not <(level) = [39]>> then\n        set size to (50) %\n    end\nend\n\n@Cat Empire Ufo\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    wait (.3) seconds\n    show\n    show variable [countdown v]\n    set [countdown v] to [20]\n    broadcast (countdown v)\n    forever\n        wait (pick random (0.3) to (0.8)) seconds\n        create clone of (_myself_ v)\n    end\nelse\n    hide variable [countdown v]\n    hide\nend\n\nwhen flag clicked\nhide\nset size to (75) %\nclear graphic effects\n\nwhen flag clicked\nforever\n    if <(countdown) < [1]> then\n        wait (.3) seconds\n        broadcast (wall down v)\n        hide variable [countdown v]\n    else\n        broadcast (wall up v)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nrepeat until <<touching (platform v)?> or <touching (sprite2 v)?>>\n    change y by (-4)\nend\ndelete this clone\n\nwhen I receive [countdown v]\nforever\n    wait (1) seconds\n    change [countdown v] by (-1)\n    show\nend\n\nwhen I receive [death v]\nset [countdown v] to [20]\n\nhide variable [countdown v]\n\nwhen I receive [wall down v]\nforever\n    delete this clone\nend\n\nwhen I receive [wall down v]\nrepeat (75)\n    change size by (-1)\nend\n\nwhen I receive [wall down v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen flag clicked\nforever\n    if <(level) = [18]> then\n        show\n    end\n    if <(level) = [19]> then\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen flag clicked\nforever\n    go to x: (X) y: (100)\nend\n\n@Wall\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [wall up v]\ngo to [front v] layer\ngo to x: (50) y: (29)\n\nwhen I receive [wall down v]\nglide (2) secs to x: (50) y: (-96)\n\n@Sprite5\n\nwhen I receive [start v]\npoint in direction (90)\nclear graphic effects\nset size to (95) %\nshow\nset [ghost v] effect to (25)\ngo to x: (130) y: (75)\nforever\n    repeat (10)\n        turn right (.5) degrees\n        change size by (.3)\n        wait (0.01) seconds\n    end\n    wait (0.01) seconds\n    repeat (10)\n        turn left (.5) degrees\n        change size by (-.3)\n        wait (0.01) seconds\n    end\n    wait (0.01) seconds\n    repeat (10)\n        turn left (.5) degrees\n        change size by (-.3)\n        wait (0.01) seconds\n    end\n    wait (0.01) seconds\n    repeat (10)\n        turn right (.5) degrees\n        change size by (.3)\n        wait (0.01) seconds\n    end\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nhide\ngo to [back v] layer\nwait (10) seconds\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <(level) = [24]> then\n        wait (.05) seconds\n        forever\n            go [backward v] (27) layers\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen I receive [change level v]\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <(Cave) = [1]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [5 v]\nshow\n\nwhen flag clicked\nforever\n    if <(level) = [44]> then\n        show\n        stop [this script v]\n    end\nend\n\nhide\n\n@Sprite6\n\nwhen flag clicked\nset size to (100) %\nset [ghost v] effect to (0)\nhide\nrepeat (25)\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nset size to (pick random (80) to (100)) %\nturn right (pick random (30) to (45)) degrees\nset [ghost v] effect to (70)\ngo to (random position v)\nforever\n    glide (15) secs to (random position v)\nend\n\nwhen I start as a clone\nforever\n    go to [back v] layer\n    change size by (pick random (-1.5) to (1.5))\nend\n\nwhen I start as a clone\nforever\n    if <(size) > [120]> then\n        repeat (100)\n            change size by (-.1)\n        end\n    end\n    if <[10] > (size)> then\n        repeat (100)\n            change size by (.1)\n        end\n    end\nend\n\nwhen I start as a clone\nwait (5) seconds\nforever\n    go to [back v] layer\n    change size by (pick random (-1.5) to (1.5))\nend\n\nwhen I start as a clone\nforever\n    if <(level) > [28]> then\n        repeat until <(level) > [43]>\n            hide\n        end\n    end\n    if <(level) > [43]> then\n        show\n    end\nend\n\n@Sprite7\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nset [ghost v] effect to (10)\nhide\ngo to [back v] layer\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    if <(level) = [24]> then\n        wait (.05) seconds\n        forever\n            go [backward v] (27) layers\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [22]> or <(level) = [23]>> then\n        go [forward v] (1) layers\n    else\n        go to [back v] layer\n    end\nend\n\nwhen flag clicked\nforever\n    if <(level) = [24]> then\n        set [ghost v] effect to (30)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Cave) = [1]> then\n        hide\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\ngo to x: (34) y: (-6)\nhide\nswitch costume to (costume1 v)\nforever\n    if <(level) = [23]> then\n        show\n    end\n    if <(level) > [23]> then\n        hide\n    end\nend\n\nwhen I receive [animation v]\nswitch costume to (costume1 v)\nrepeat (8)\n    next costume\n    wait (2) seconds\nend\nrepeat (14)\n    next costume\n    wait (.09) seconds\nend\nwait (1) seconds\nnext costume\nbroadcast (Alarm v)\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\nforever\n    if <touching (sprite2 v)?> then\n        broadcast (Animation v)\n        broadcast (note v)\n    end\nend\n\nwhen I receive [note v]\nwait (7) seconds\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume20 v)\ngo to x: (X) y: (Y)\ngo to [front v] layer\nglide (2) secs to x: (0) y: (-50)\nrepeat (50)\n    turn right (15) degrees\n    change size by (-2)\nend\nhide\nbroadcast (message v)\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\nwhen I receive [change level v]\nif <(level) > [23]> then\n    hide\nend\nhide\n\n@Sprite12\n\nwhen I receive [alarm v]\nwait (2.3) seconds\nshow\nset [ghost v] effect to (60)\nrepeat until <(Cave) = [1]>\n    start sound [death star alarm v]\n    show\n    wait (1.) seconds\n    hide\n    wait (1.2) seconds\nend\n\nwhen flag clicked\nhide\nclear graphic effects\n\nwhen I receive [music v]\nset volume to (100) %\n\nwhen I receive [no music v]\nset volume to (0) %\n\nwhen flag clicked\nforever\n    if <(level) = [27]> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if  then\n        hide\n    end\nend\n\n@Sprite13\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\nforever\n    if <(BB8) = [1]> then\n        show\n        go to (sprite2 v)\n        go to [front v] layer\n    else\n        hide\n    end\nend\n\nwhen I receive [left v]\npoint in direction (-90)\n\nwhen I receive [right v]\npoint in direction (90)\n\nwhen flag clicked\nforever\n    turn left (x speed) degrees\nend\n\nrepeat until <not >\nend\n\nwhen flag clicked\nif <(level) = [39]> then\n    set size to (15) %\nelse\n    set size to (30) %\nend\n\n@Sprite14\n\nwhen flag clicked\ngo to x: (36) y: (28)\nhide\n\nwhen I receive [change level v]\nswitch costume to (join [L] (level))\nif <(costume [name v]) = (join [L] (level))> then\n    show\nelse\n    hide\nend\n\n@Sprite15\n\nwhen I receive [cave v]\nbroadcast (Cave2 v)\nswitch costume to (costume1 v)\nshow\nstop [this script v]\n\nwhen flag clicked\nhide\nforever\n    go to [front v] layer\nend\n\nwhen I receive [done falling v]\nhide\nbroadcast (continue v)\nstop [other scripts in sprite v]\nstop [this script v]\n\n@Sprite16\n\nwhen flag clicked\nswitch costume to (costume1 v)\nset size to (200) %\nhide\n\nwhen I receive [cave v]\nrepeat (500)\n    go to [front v] layer\nend\n\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen I receive [done falling v]\nswitch costume to (costume2 v)\n\nwhen I receive [cave v]\nshow\nrepeat (100)\n    turn right (10) degrees\n    change size by (-2)\nend\nbroadcast (done falling v)\nhide\n\n@Sprite17\n\nwhen I receive [continue v]\nshow\nforever\n    go to (sprite2 v)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [5 v]\n\nif <(level) > [43]> then\n    broadcast (show v)\n    switch backdrop to (backdrop2 v)\nelse\n    switch backdrop to (backdrop7 v)\nend\n\nwhen flag clicked\nforever\n    if <(level) > [43]> then\n        hide\n    end\nend\n\n@right2\n\nwhen flag clicked\nhide\n\nwhen I receive [close option v]\nforever\n    go to [front v] layer\nend\n\nwhen I receive [settings open v]\ngo to x: (97) y: (62)\npoint in direction (90)\nshow\nbroadcast (close option v)\nforever\n    go to [front v] layer\nend\n\ndefine Twist\nforever\n    repeat (40)\n        turn right (.1) degrees\n    end\n    repeat (80)\n        turn left (.1) degrees\n    end\n    repeat (40)\n        turn right (.1) degrees\n    end\nend\n\ndefine Buffer\nforever\n    repeat (5)\n        change y by (1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\n    repeat (5)\n        change y by (-1)\n        wait (.1) seconds\n    end\n    wait (.1) seconds\nend\n\nwhen flag clicked\nforever\n    Twist\nend\n\nwhen flag clicked\nforever\n    Buffer\nend\n\nwhen I receive [close v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\nwhen I receive [close option v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (35) %\n        if <mouse down?> then\n            broadcast (restart level v)\n            wait (.3) seconds\n        end\n    else\n        set size to (30) %\n    end\nend\n\nwhen I receive [shop open v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to x: (400) y: (400)\nclear graphic effects\n\n@Sprite18\n\nwhen flag clicked\nhide\nforever\n    if <(level) > [45]> then\n        if <key (t v) pressed?> then\n            show\n            go to [front v] layer\n            show variable [☁ total time v]\n            show variable [deaths v]\n            show variable [skips v]\n            show variable [time v]\n        else\n            hide\n            hide variable [☁ total time v]\n            hide variable [deaths v]\n            hide variable [time v]\n            hide variable [skips v]\n        end\n    end\nend\n\n@Lag reducer\n\n