Keyboard - A Platformer
@Stage\n\nwhen [m v] key pressed\n\nset [mouse v] to (join (mouse x) (join [, ] (mouse y)))\nshow variable [mouse v]\n\n@Game Manager\n\nwhen flag clicked\nbroadcast (Update Cloud v) and wait\nAdd Spawns\nhide variable [stop time v]\nhide variable [time: v]\nshow list [clouddatadecoded v]\nset [level v] to [1]\nset [timer v] to [OFF]\nset [sound v] to [ON]\nset [time: v] to [0]\nset [stop time v] to [false]\nset [music real v] to [ON]\nbroadcast (Green Flag v) and wait\nbroadcast (Intro v)\n\nwhen I receive [play game v]\nswitch backdrop to (level  v)\nforever\n    if <(PORTAL TOUCHING?) = [11]> then\n        broadcast (Transition v) and wait\n    end\nend\n\ndefine Add Spawns\ndelete all of [player1 spawn v]\ndelete all of [player2 spawn v]\ndelete all of [block solid left v]\ndelete all of [block solid right v]\nadd [true] to [block solid left v]\nadd [true] to [block solid left v]\nadd [true] to [block solid left v]\nadd [true] to [block solid left v]\nadd [true] to [block solid right v]\nadd [true] to [block solid right v]\nadd [true] to [block solid right v]\nadd [true] to [block solid right v]\nadd [-216,-084] to [player1 spawn v]\nadd [0216,-084] to [player2 spawn v]\nadd [-036,-126] to [player1 spawn v]\nadd [0036,-126] to [player2 spawn v]\nadd [-055,109] to [player1 spawn v]\nadd [0173,-113] to [player2 spawn v]\nadd [-200,0160] to [player1 spawn v]\nadd [0200,0160] to [player2 spawn v]\nadd [-216,-084] to [player1 spawn v]\nadd [0216,-084] to [player2 spawn v]\nadd [-160,-124] to [player1 spawn v]\nadd [0135,0142] to [player2 spawn v]\nadd [-196,0145] to [player1 spawn v]\nadd [0216,-084] to [player2 spawn v]\nadd [-160,-124] to [player1 spawn v]\nadd [0135,0142] to [player2 spawn v]\nadd [-220,-124] to [player1 spawn v]\nadd [0220,-124] to [player2 spawn v]\n\nwhen I receive [play game v]\nforever\n    play sound [bensound-buddy v] until done\nend\n\nwhen I receive [play game v]\nwait until <key (any v) pressed?>\nreset timer\nforever\n    if <(Stop Time) = [false]> then\n        set [time: v] to (timer)\n    end\nend\n\nwhen I receive [play game v]\nforever\n    if <<(TIMER) = [ON]> and <not <(LEVEL) = [9]>>> then\n        show variable [time: v]\n    else\n        hide variable [time: v]\n    end\nend\n\nwhen I receive [play game v]\nset volume to (0) %\nrepeat (50)\n    change volume by (2)\nend\nforever\n    if <(MUSIC REAL) = [ON]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [play ;o v]\nbroadcast (Play Sound v)\nbroadcast (Reset v) and wait\nbroadcast (Set Up v) and wait\nbroadcast (Make Grass v)\nbroadcast (Play Game v)\nbroadcast (Add Skip v)\nforever\n    broadcast (Tick v)\nend\n\nbroadcast (Update Cloud v)\n\nwhen [space v] key pressed\nhide list [clouddatadecoded v]\nwait (3) seconds\nshow list [buttons pressed v]\n\n@Cloud\n\ndefine Decode Data: (player) (time)\ndelete all of [clouddatadecoded v]\nset [counter2 v] to [1]\nadd [] to [clouddatadecoded v]\nrepeat (20)\n    switch costume to ((join (letter (counter2) of (player)) (letter ((counter2) + (1)) of (player))) - (10))\n    if <(costume [name v]) = [ ]> then\n        replace item (1) of [clouddatadecoded v] with (item (1) of [clouddatadecoded v])\n    else\n        replace item (1) of [clouddatadecoded v] with (join (item (1) of [clouddatadecoded v]) (letter (1) of (costume [name v])))\n    end\n    change [counter2 v] by (2)\nend\nset [counter2 v] to [1]\nadd [] to [clouddatadecoded v]\nrepeat (8)\n    replace item (2) of [clouddatadecoded v] with (join (item (2) of [clouddatadecoded v]) (letter (counter2) of (time)))\n    change [counter2 v] by (1)\nend\nreplace item (2) of [clouddatadecoded v] with (((item (2) of [clouddatadecoded v]) - (50000000)) / (100))\n\nwhen flag clicked\n\ndefine Encode Player: (input)\nset [local-encoded v] to []\nset [counter2 v] to [1]\nrepeat (20)\n    if <(letter (counter2) of (input)) = []> then\n        switch costume to (  v)\n    else\n        if < [0123456789] contains (letter (counter2) of (input))?> then\n            switch costume to (join (letter (counter2) of (input)) [x])\n        else\n            switch costume to (letter (counter2) of (input))\n        end\n    end\n    set [local-encoded v] to (join (Local-Encoded) ((costume [number v]) + (10)))\n    change [counter2 v] by (1)\nend\n\nwhen [space v] key pressed\n\nset [☁ real time v] to ((50000000) + (round ((123.23) * (100))))\nbroadcast (Update Cloud v)\n\nset [☁ hs - player v] to (Local-Encoded)\n\nwhen I receive [play game v]\nif <(LEVEL) = [9]> then\n    broadcast (Show End v)\nend\n\nask [Number] and wait\nif <[] < (item (2) of [clouddatadecoded v])> then\nDecode Data: (☁ HS - Player) (☁ HS - Time)\n\nwhen I receive [update cloud v]\nEncode Player: (username)\nDecode Data: (☁ Real HS) (☁ Real Time)\n\n@Player1\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nTick\n\ndefine Game On X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\nset [sy v] to [0]\nset [in air v] to [0]\nset [sx v] to [0]\nset size to (80) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (-2)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (.8))\nset [xmotion player 1 v] to (sx)\nif <([abs v] of (sx) ) > [.9]> then\n    Change Player x by (round (sx))\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(in air) < [4]> then\n        set [sy v] to [22]\n        if <(in air) < [1]> then\n            broadcast (wait fall player 1 v)\n            start sound [jump v]\n        end\n    end\nend\nchange [sy v] by (-3)\nchange Player y by (sy)\nPosition\nswitch costume to (join ((([abs v] of (round (sx)) ) / (round (sx))) + (0)) ((([abs v] of (round (sy)) ) / (round (sy))) + (0)))\n\ndefine change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<touching (1 v)?> and <(item (1) of [block solid left v]) = [true]>>>> or <<<touching (2 v)?> and <(item (2) of [block solid left v]) = [true]>> or <<<touching (4 v)?> and <(item (4) of [block solid left v]) = [true]>> or <<touching (3 v)?> and <(item (3) of [block solid left v]) = [true]>>>>>>\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\ntest block\n\ndefine Position\ngo to x: (x) y: (y)\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<<touching (3 v)?> and <(item (3) of [block solid left v]) = [true]>> or <<touching (1 v)?> and <(item (1) of [block solid left v]) = [true]>>>>> or <<<touching (2 v)?> and <(item (2) of [block solid left v]) = [true]>> or <<touching (4 v)?> and <(item (4) of [block solid left v]) = [true]>>>> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <not <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<<touching (3 v)?> and <(item (3) of [block solid left v]) = [true]>> or <<touching (1 v)?> and <(item (1) of [block solid left v]) = [true]>>>>> or <<<touching (2 v)?> and <(item (2) of [block solid left v]) = [true]>> or <<touching (4 v)?> and <(item (4) of [block solid left v]) = [true]>>>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    repeat until <not <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<<touching (3 v)?> and <(item (3) of [block solid left v]) = [true]>> or <<touching (1 v)?> and <(item (1) of [block solid left v]) = [true]>>>>> or <<<touching (2 v)?> and <(item (2) of [block solid left v]) = [true]>> or <<touching (4 v)?> and <(item (4) of [block solid left v]) = [true]>>>>>\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\nwhen I receive [set up v]\nGame On X: (join (letter (1) of (item (LEVEL) of [player1 spawn v])) (join (letter (2) of (item (LEVEL) of [player1 spawn v])) (join (letter (3) of (item (LEVEL) of [player1 spawn v])) (letter (4) of (item (LEVEL) of [player1 spawn v]))))) Y: (join (letter (6) of (item (LEVEL) of [player1 spawn v])) (join (letter (7) of (item (LEVEL) of [player1 spawn v])) (join (letter (8) of (item (LEVEL) of [player1 spawn v])) (letter (9) of (item (LEVEL) of [player1 spawn v])))))\n\nwhen I receive [wait fall player 1 v]\nwait () seconds\nwait until <<(in air) = [0]> and <<<<touching (button v)?> or <touching (level v)?>> or <<touching (2 v)?> or <touching (1 v)?>>> or <<touching (3 v)?> or <touching (4 v)?>>>>\nplay sound [zapsplat_impacts_body_hit_ground_heavy_thud_clothed_003_43763 v] until done\n\ndefine test block\nset [counter v] to [1]\nrepeat (4)\n    if <<not <touching ((counter) v)?>> and <(in air) = [0]>> then\n        replace item (counter) of [block solid left v] with [true]\n    end\n    change [counter v] by (1)\nend\n\nset [p1 in air v] to (([abs v] of ((in air) / (in air)) ) + (0))\n\nwhen I receive [play sound v]\nforever\n    if <(SOUND) = [ON]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\n@Player2\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [tick v]\nTick\n\ndefine Game On X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\nset [sy v] to [0]\nset [in air v] to [0]\nset [sx v] to [0]\nset size to (80) %\nset [ghost v] effect to (0)\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [sx v] by (2)\nend\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [sx v] by (-2)\nend\nset [sx v] to ((sx) * (.8))\nset [xmotion player 2 v] to (sx)\nif <([abs v] of (sx) ) > [.9]> then\n    Change Player x by (round (sx))\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    if <(in air) < [4]> then\n        set [sy v] to [22]\n        if <(in air) < [1]> then\n            broadcast (wait fall player 1 v)\n            start sound [jump v]\n        end\n    end\nend\nchange [sy v] by (-3)\nchange Player y by (sy)\nPosition\nswitch costume to (join ((([abs v] of (round (sx)) ) / (round (sx))) + (0)) ((([abs v] of (round (sy)) ) / (round (sy))) + (0)))\n\ndefine change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<touching (1 v)?> and <(item (1) of [block solid right v]) = [true]>>>> or <<<touching (2 v)?> and <(item (2) of [block solid right v]) = [true]>> or <<<touching (4 v)?> and <(item (4) of [block solid right v]) = [true]>> or <<touching (3 v)?> and <(item (3) of [block solid right v]) = [true]>>>>>>\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\ntest block\n\ndefine Position\ngo to x: (x) y: (y)\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<<touching (3 v)?> and <(item (3) of [block solid right v]) = [true]>> or <<touching (1 v)?> and <(item (1) of [block solid right v]) = [true]>>>>> or <<<touching (2 v)?> and <(item (2) of [block solid right v]) = [true]>> or <<touching (4 v)?> and <(item (4) of [block solid right v]) = [true]>>>> then\n    repeat (8)\n        change [y v] by (1)\n        Position\n        if <not <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<<touching (3 v)?> and <(item (3) of [block solid right v]) = [true]>> or <<touching (1 v)?> and <(item (1) of [block solid right v]) = [true]>>>>> or <<<touching (2 v)?> and <(item (2) of [block solid right v]) = [true]>> or <<touching (4 v)?> and <(item (4) of [block solid right v]) = [true]>>>>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-8)\n    repeat until <not <<<<touching (level v)?> or <touching (_edge_ v)?>> or <<touching (button v)?> or <<<touching (3 v)?> and <(item (3) of [block solid right v]) = [true]>> or <<touching (1 v)?> and <(item (1) of [block solid right v]) = [true]>>>>> or <<<touching (2 v)?> and <(item (2) of [block solid right v]) = [true]>> or <<touching (4 v)?> and <(item (4) of [block solid right v]) = [true]>>>>>\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\nwhen I receive [set up v]\nGame On X: (join (letter (1) of (item (LEVEL) of [player2 spawn v])) (join (letter (2) of (item (LEVEL) of [player2 spawn v])) (join (letter (3) of (item (LEVEL) of [player2 spawn v])) (letter (4) of (item (LEVEL) of [player2 spawn v]))))) Y: (join (letter (6) of (item (LEVEL) of [player2 spawn v])) (join (letter (7) of (item (LEVEL) of [player2 spawn v])) (join (letter (8) of (item (LEVEL) of [player2 spawn v])) (letter (9) of (item (LEVEL) of [player2 spawn v])))))\n\nwhen I receive [wait fall player 1 v]\nwait () seconds\nwait until <<(in air) = [0]> and <<<touching (3 v)?> or <touching (4 v)?>> or <<<touching (2 v)?> or <touching (1 v)?>> or <<touching (button v)?> or <touching (level v)?>>>>>\nplay sound [zapsplat_impacts_body_hit_ground_heavy_thud_clothed_003_43763 v] until done\n\ndefine test block\nset [counter v] to [1]\nrepeat (4)\n    if <<not <touching ((counter) v)?>> and <(in air) = [0]>> then\n        replace item (counter) of [block solid right v] with [true]\n    end\n    change [counter v] by (1)\nend\n\nwhen I receive [play game v]\nforever\n    if <(costume [number v]) = [1]> then\n        wait (.5) seconds\n        if <(costume [number v]) = [1]> then\n            Game On X: (join (letter (1) of (item (LEVEL) of [player2 spawn v])) (join (letter (2) of (item (LEVEL) of [player2 spawn v])) (join (letter (3) of (item (LEVEL) of [player2 spawn v])) (letter (4) of (item (LEVEL) of [player2 spawn v]))))) Y: (join (letter (6) of (item (LEVEL) of [player2 spawn v])) (join (letter (7) of (item (LEVEL) of [player2 spawn v])) (join (letter (8) of (item (LEVEL) of [player2 spawn v])) (letter (9) of (item (LEVEL) of [player2 spawn v])))))\n        end\n    end\nend\n\nwait (.5) seconds\n\nset [xmotion player 2 v] to [0]\n\nset [p2 in air v] to (([abs v] of ((in air) / (in air)) ) + (0))\n\nwhen I receive [play sound v]\nforever\n    if <(SOUND) = [ON]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\n@Level\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [set up v]\ngo to x: (0) y: (0)\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (join [Level ] (LEVEL))\nshow\n\n@Portal\n\ndefine Gravity: (gravity)\nchange [particle y vel v] by (gravity)\nchange y by (particle y vel)\nchange x by (particle x vel)\nif <(y position) < [-200]> then\n    delete this clone\nend\n\nwhen I start as a clone\nshow\nif <(portal id) < [3]> then\n    if <(portal id) = [1]> then\n        set [portal tic v] to [0]\n        go to x: (item (LEVEL) of [portal x v]) y: (item (LEVEL) of [portal y v])\n        forever\n            turn right (([sin v] of (portal tic) ) / (1)) degrees\n            change size by (([sin v] of (portal tic) ) / (4))\n            change [portal tic v] by (3)\n            if <touching (player2 v)?> then\n                set [portal touching? v] to (join (letter (1) of (PORTAL TOUCHING?)) [1])\n                set [brightness v] effect to (30)\n            else\n                set [portal touching? v] to (join (letter (1) of (PORTAL TOUCHING?)) [0])\n                set [brightness v] effect to (0)\n            end\n        end\n    else\n        set [portal tic v] to [0]\n        go to x: (item ((LEVEL) + (10)) of [portal x v]) y: (item ((LEVEL) + (10)) of [portal y v])\n        forever\n            turn right (([sin v] of (portal tic) ) / (1)) degrees\n            change size by (([sin v] of (portal tic) ) / (4))\n            change [portal tic v] by (3)\n            if <touching (player1 v)?> then\n                set [portal touching? v] to (join [1] (letter (2) of (PORTAL TOUCHING?)))\n                set [brightness v] effect to (30)\n            else\n                set [portal touching? v] to (join [0] (letter (2) of (PORTAL TOUCHING?)))\n                set [brightness v] effect to (0)\n            end\n        end\n    end\nelse\n    show\n    switch costume to (red partical v)\n    go to [front v] layer\n    go [backward v] (5) layers\n    set [brightness v] effect to (pick random (0) to (30))\n    set [particle y vel v] to (pick random (2.1) to (7.1))\n    set [particle x vel v] to (pick random (-2.1) to (2))\n    if <(pick random (1) to (2)) = [1]> then\n        go to x: (item (LEVEL) of [portal x v]) y: (item (LEVEL) of [portal y v])\n    else\n        go to x: (item ((LEVEL) + (10)) of [portal x v]) y: (item ((LEVEL) + (10)) of [portal y v])\n    end\n    forever\n        set size to (500) %\n        Gravity: [-.3]\n        set size to (7) %\n    end\nend\n\ndefine Add Portals\ndelete all of [portal x v]\ndelete all of [portal y v]\nadd [22] to [portal x v]\nadd [83] to [portal y v]\nadd [212] to [portal x v]\nadd [-125] to [portal y v]\nadd [220] to [portal x v]\nadd [-120] to [portal y v]\nadd [212] to [portal x v]\nadd [-102] to [portal y v]\nadd [26] to [portal x v]\nadd [125] to [portal y v]\nadd [211] to [portal x v]\nadd [-109] to [portal y v]\nadd [195] to [portal x v]\nadd [110] to [portal y v]\nadd [206] to [portal x v]\nadd [-102] to [portal y v]\nadd [] to [portal x v]\nadd [] to [portal y v]\nadd [] to [portal x v]\nadd [] to [portal y v]\nadd [-22] to [portal x v]\nadd [83] to [portal y v]\nadd [-215] to [portal x v]\nadd [63] to [portal y v]\nadd [-220] to [portal x v]\nadd [-120] to [portal y v]\nadd [-212] to [portal x v]\nadd [-102] to [portal y v]\nadd [-23] to [portal x v]\nadd [131] to [portal y v]\nadd [-200] to [portal x v]\nadd [145] to [portal y v]\nadd [-32] to [portal x v]\nadd [-106] to [portal y v]\nadd [-200] to [portal x v]\nadd [-111] to [portal y v]\nadd [] to [portal x v]\nadd [] to [portal y v]\n\nwhen I receive [set up v]\nif <not <(costume [number v]) = [4]>> then\n    switch costume to (red portal v)\n    set size to (30) %\n    set [portal id v] to [0]\n    set [portal touching? v] to [00]\n    if <not <(LEVEL) = [9]>> then\n        repeat (2)\n            change [portal id v] by (1)\n            create clone of (_myself_ v)\n        end\n    end\n    hide\nelse\n    delete this clone\nend\n\nwhen I receive [green flag v]\nAdd Portals\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [transition v]\nif <(PORTAL TOUCHING?) = [11]> then\n    set [portal id v] to [3]\n    repeat (70)\n        create clone of (_myself_ v)\n    end\nend\n\n@Transition \n\nwhen flag clicked\nhide\n\nwhen I receive [transition v]\nstart sound [391539__mativve__electro-win-sound v]\nwait (1) seconds\nswitch costume to (nothing v)\nshow\ngo to [front v] layer\nset size to (1000) %\nswitch costume to (nothing size v)\nset size to (350) %\nswitch costume to (nothing xy v)\nchange x by ((-720) - (x position))\nchange y by ((-540) - (y position))\nrepeat (100)\n    switch costume to (diamond  v)\n    set size to (1000) %\n    switch costume to (nothing size v)\n    set size to (350) %\n    switch costume to (nothing xy v)\n    change x by (((840) - (x position)) / (55))\n    change y by (((630) - (y position)) / (55))\n    switch costume to (diamond  v)\nend\nhide\n\nwhen I receive [transition v]\nswitch costume to (nothing v)\nwait until <(costume [number v]) = [1]>\nwait until <(x position) > [-50]>\nchange [level v] by (1)\nif <(LEVEL) = [9]> then\n    set [stop time v] to [true]\n    if <<(Time:) < (item (2) of [clouddatadecoded v])> and <not <(Time:) = [0]>>> then\n        set [☁ real hs v] to (Local-Encoded)\n        set [☁ real time v] to ((round ((100) * (Time:))) + (50000000))\n        broadcast (Update Cloud v) and wait\n    end\n    broadcast (Show End v)\nend\nbroadcast (Reset v) and wait\nbroadcast (Set Up v)\nbroadcast (Add Skip v)\nbroadcast (Make Grass v)\n\nwait (2) seconds\n\nset size to (100) %\ngo to [front v] layer\ngo to x: (0) y: (0)\nrepeat until <(size) > [3000]>\n    turn right (2) degrees\n    switch costume to (nothing v)\n    change size by (((4000) - (size)) / (40))\n    switch costume to (small v)\nend\nrepeat until <(size) < [90]>\n    turn right (-2) degrees\n    switch costume to (nothing v)\n    change size by (((0) - (size)) / (10))\n    switch costume to (small v)\nend\nhide\n\nwhen I receive [play sound v]\nforever\n    if <(SOUND) = [ON]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nbroadcast (Update Cloud v)\n\n@Clouds\n\nwhen I receive [play game v]\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (1.9) to (4)) seconds\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (-300) y: (pick random (90) to (180))\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (pick random (10) to (20))\nset size to (pick random (90) to (140)) %\nshow\nset [speed v] to ((size) / (90))\nset [cloud size v] to (size)\nrepeat until <(x position) > [300]>\n    set size to (400) %\n    change x by (speed)\n    set size to (cloud size) %\nend\ndelete this clone\n\n@Interactive\n\ndefine Grass from (xpos1) to (xpos2) Y: (y) Direction: (dir) Chance: (top)\nshow\ngo to x: (xpos1) y: (y)\nset [dir v] to (dir)\npoint in direction (dir)\nrepeat until <(x position) = (xpos2)>\n    change x by (1)\n    set size to (pick random (75) to (150)) %\n    clear graphic effects\n    set [color v] effect to (0)\n    set [brightness v] effect to (pick random (-5) to (5))\n    change [color v] effect by (pick random (-10) to (10.1))\n    if <(pick random (1) to (top)) = [1]> then\n        create clone of (_myself_ v)\n    end\nend\nhide\n\nwhen I start as a clone\nGrass\nforever\n    if <<touching (player1 v)?> or <touching (player2 v)?>> then\n        Sway\n    end\nend\n\ndefine Grass\nswitch costume to (base hitbox v)\ngo to [back v] layer\ngo [forward v] (1) layers\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <touching (_edge_ v)?>>\n        change y by (1)\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    change x by (-4)\nelse\n    repeat until <touching (level v)?>\n        change y by (-2)\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\nend\nswitch costume to (pick random (1) to (5))\nif <(costume [number v]) = [5]> then\n    if <(pick random (1) to (15)) = [1]> then\n        switch costume to (pick random (5) to (8))\n        go [forward v] (5) layers\n    else\n        switch costume to (pick random (1) to (4))\n    end\nend\n\ndefine Sway\nif <touching (player1 v)?> then\n    set [magnitude v] to (((XMOTION PLAYER 1) + (pick random (-2.0) to (2.0))) * (4))\nelse\n    set [magnitude v] to (((XMOTION PLAYER 2) + (pick random (-2.0) to (2.0))) * (4))\nend\nset [sway v] to [0]\nrepeat until <<[0] = (round ((MAGNITUDE) * (2)))> or <<<touching (player1 v)?> and <([abs v] of (MAGNITUDE) ) < ([abs v] of ((XMOTION PLAYER 1) * (2)) )>> or <<touching (player2 v)?> and <([abs v] of (MAGNITUDE) ) < ([abs v] of ((XMOTION PLAYER 2) * (2)) )>>>>\n    point in direction ((dir) - (([sin v] of (SWAY) ) * (MAGNITUDE)))\n    change [sway v] by (-10)\n    set [magnitude v] to ((0.95) * (MAGNITUDE))\nend\n\nwhen I receive [make grass v]\nif <(LEVEL) = [1]> then\n    Grass from [-240] to [-140] Y: [0] Direction: [90] Chance: [2]\n    Grass from [-125] to [-94] Y: [0] Direction: [90] Chance: [2]\n    Grass from [-80] to [-50] Y: [0] Direction: [90] Chance: [2]\n    Grass from [-35] to [0] Y: [0] Direction: [90] Chance: [2]\n    Grass from [140] to [240] Y: [0] Direction: [90] Chance: [2]\n    Grass from [94] to [125] Y: [0] Direction: [90] Chance: [2]\n    Grass from [50] to [80] Y: [0] Direction: [90] Chance: [2]\n    Grass from [0] to [35] Y: [0] Direction: [90] Chance: [2]\nelse\n    if <(LEVEL) = [2]> then\n        Grass from [-240] to [127] Y: [-100] Direction: [90] Chance: [2]\n        Grass from [-240] to [-170] Y: [50] Direction: [90] Chance: [2]\n        Grass from [-90] to [-55] Y: [50] Direction: [90] Chance: [2]\n        Grass from [140] to [170] Y: [0] Direction: [90] Chance: [2]\n        Grass from [184] to [240] Y: [0] Direction: [90] Chance: [2]\n    else\n        if <(LEVEL) = [3]> then\n            Grass from [-130] to [-10] Y: [200] Direction: [90] Chance: [2]\n            Grass from [-230] to [-116] Y: [40] Direction: [90] Chance: [2]\n            Grass from [-240] to [0] Y: [-60] Direction: [90] Chance: [3]\n            Grass from [48] to [78] Y: [0] Direction: [90] Chance: [2]\n            Grass from [92] to [240] Y: [0] Direction: [90] Chance: [2]\n        else\n            if <(LEVEL) = [4]> then\n                Grass from [-240] to [240] Y: [0] Direction: [90] Chance: [2]\n            else\n                if <(LEVEL) = [5]> then\n                    Grass from [-240] to [-149] Y: [30] Direction: [90] Chance: [3]\n                    Grass from [-240] to [-180] Y: [-20] Direction: [90] Chance: [3]\n                    Grass from [-178] to [-94] Y: [-20] Direction: [30] Chance: [3]\n                    Grass from [-87] to [-19] Y: [0] Direction: [90] Chance: [3]\n                    Grass from [10] to [240] Y: [-122] Direction: [90] Chance: [3]\n                    Grass from [9] to [41] Y: [200] Direction: [90] Chance: [3]\n                    Grass from [102] to [135] Y: [200] Direction: [90] Chance: [3]\n                    Grass from [198] to [230] Y: [200] Direction: [90] Chance: [3]\n                    Grass from [124] to [157] Y: [0] Direction: [90] Chance: [3]\n                    Grass from [-80] to [-5] Y: [200] Direction: [90] Chance: [3]\n                else\n                    if <(LEVEL) = [6]> then\n                        Grass from [43] to [240] Y: [200] Direction: [90] Chance: [2]\n                        Grass from [-240] to [-10] Y: [-135] Direction: [90] Chance: [2]\n                        Grass from [-199] to [-123] Y: [30] Direction: [90] Chance: [2]\n                        Grass from [-240] to [168] Y: [180] Direction: [90] Chance: [2]\n                    else\n                        if <(LEVEL) = [7]> then\n                            Grass from [-240] to [-145] Y: [-100] Direction: [90] Chance: [3]\n                            Grass from [-56] to [-10] Y: [-100] Direction: [90] Chance: [3]\n                            Grass from [-124] to [-10] Y: [50] Direction: [90] Chance: [3]\n                            Grass from [-240] to [-166] Y: [180] Direction: [90] Chance: [3]\n                            Grass from [10] to [240] Y: [-100] Direction: [90] Chance: [3]\n                            Grass from [134] to [211] Y: [9] Direction: [90] Chance: [3]\n                            Grass from [153] to [240] Y: [180] Direction: [90] Chance: [3]\n                        else\n                            if <(LEVEL) = [8]> then\n                                Grass from [-240] to [-136] Y: [-140] Direction: [90] Chance: [3]\n                                Grass from [-76] to [-10] Y: [-140] Direction: [90] Chance: [3]\n                                Grass from [-80] to [-10] Y: [180] Direction: [90] Chance: [3]\n                                Grass from [105] to [160] Y: [180] Direction: [90] Chance: [3]\n                                Grass from [137] to [168] Y: [-100] Direction: [90] Chance: [3]\n                                Grass from [176] to [240] Y: [-100] Direction: [90] Chance: [3]\n                                Grass from [89] to [120] Y: [38] Direction: [90] Chance: [3]\n                                Grass from [49] to [80] Y: [38] Direction: [90] Chance: [3]\n                            else\n                                if <(LEVEL) = [9]> then\n                                    Grass from [-240] to [240] Y: [0] Direction: [90] Chance: [2]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen [g v] key pressed\n\ndelete this clone\n\nwhen [g v] key pressed\n\nbroadcast (Make Grass v)\n\nGrass from [-240] to [-10] Y: [-135] Direction: [90] Chance: [2]\nGrass from [-199] to [-123] Y: [30] Direction: [90] Chance: [2]\nGrass from [-240] to [168] Y: [180] Direction: [90] Chance: [2]\n\n@Decorations\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [set up v]\ngo to x: (0) y: (0)\ngo to [back v] layer\nswitch costume to (join [Level ] (LEVEL))\nshow\n\n@Button\n\nwhen I receive [set up v]\npoint in direction (90)\ndelete all of [button check v]\nif <(LEVEL) = [3]> then\n    set [button x v] to [22]\n    set [button number v] to [0]\n    set [button id v] to [0]\n    set [button y v] to [-133]\n    set [button id v] to [1]\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [4]> then\n        add [0] to [button check v]\n        add [0] to [button check v]\n        set [button x v] to [-35]\n        set [button y v] to [120]\n        set [button number v] to [2]\n        set [button id v] to [3]\n        create clone of (_myself_ v)\n        set [button x v] to [-100]\n        set [button y v] to [-13]\n        set [button number v] to [0]\n        set [button id v] to [1]\n        create clone of (_myself_ v)\n        set [button x v] to [205]\n        set [button y v] to [-10]\n        set [button number v] to [0]\n        set [button id v] to [2]\n        create clone of (_myself_ v)\n        set [button x v] to [130]\n        set [button y v] to [-132]\n        set [button number v] to [1]\n        set [button id v] to [3]\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [8]> then\n            set [button x v] to [143]\n            set [button y v] to [39]\n            set [button number v] to [0]\n            set [button id v] to [4]\n            create clone of (_myself_ v)\n            set [button x v] to [22]\n            set [button y v] to [-133]\n            set [button number v] to [0]\n            set [button id v] to [2]\n            create clone of (_myself_ v)\n            set [button x v] to [-205]\n            set [button y v] to [92]\n            set [button number v] to [0]\n            set [button id v] to [1]\n            create clone of (_myself_ v)\n        else\n            if <(LEVEL) = [6]> then\n                set [button x v] to [20]\n                set [button number v] to [0]\n                set [button id v] to [4]\n                set [button y v] to [-135]\n                create clone of (_myself_ v)\n                point in direction (-90)\n                set [button x v] to [20]\n                set [button number v] to [0]\n                set [button id v] to [4]\n                set [button y v] to [-90]\n                create clone of (_myself_ v)\n                point in direction (90)\n                set [button x v] to [20]\n                set [button number v] to [0]\n                set [button id v] to [1]\n                set [button y v] to [-75]\n                create clone of (_myself_ v)\n                set [button x v] to [-47]\n                set [button number v] to [0]\n                set [button id v] to [2]\n                set [button y v] to [77]\n                create clone of (_myself_ v)\n            else\n                if <(LEVEL) = [7]> then\n                    set [button x v] to [-28]\n                    set [button number v] to [0]\n                    set [button id v] to [4]\n                    set [button y v] to [126]\n                    create clone of (_myself_ v)\n                    point in direction (-90)\n                    set [button x v] to [171]\n                    set [button number v] to [0]\n                    set [button id v] to [2]\n                    set [button y v] to [51]\n                    create clone of (_myself_ v)\n                    point in direction (0)\n                    set [button x v] to [229]\n                    set [button number v] to [0]\n                    set [button id v] to [1]\n                    set [button y v] to [9]\n                    create clone of (_myself_ v)\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\ndelete all of [block start v]\ndelete all of [buttons pressed v]\nadd [false] to [buttons pressed v]\nadd [false] to [buttons pressed v]\nadd [false] to [buttons pressed v]\nadd [false] to [buttons pressed v]\nadd [true] to [block start v]\nadd [false] to [block start v]\nadd [true] to [block start v]\nadd [false] to [block start v]\nadd [true] to [block start v]\nadd [false] to [block start v]\nadd [true] to [block start v]\nadd [false] to [block start v]\n\nwhen I start as a clone\nshow\ngo to x: (button x) y: (button y)\nset size to (60) %\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (join (button id) [b])\nif <(button id) = [1]> then\n    forever\n        switch costume to (real hitbox v)\n        if <<touching (player1 v)?> or <touching (player2 v)?>> then\n            switch costume to (button hitbox v)\n            replace item (1) of [buttons pressed v] with (item (1) of [block start v])\n        else\n            if <(button number) = [0]> then\n                switch costume to (1b v)\n                replace item (1) of [buttons pressed v] with (item (2) of [block start v])\n            else\n                if <(Button Check) = [0]> then\n                    switch costume to (1b v)\n                    replace item (1) of [buttons pressed v] with (item (2) of [block start v])\n                end\n            end\n        end\n    end\nelse\n    if <(button id) = [2]> then\n        forever\n            switch costume to (real hitbox v)\n            if <<touching (player1 v)?> or <touching (player2 v)?>> then\n                switch costume to (button hitbox v)\n                replace item (2) of [buttons pressed v] with (item (3) of [block start v])\n            else\n                if <(button number) = [0]> then\n                    switch costume to (2b v)\n                    replace item (2) of [buttons pressed v] with (item (4) of [block start v])\n                else\n                    if <(Button Check) = [0]> then\n                        switch costume to (2b v)\n                        replace item (2) of [buttons pressed v] with (item (4) of [block start v])\n                    end\n                end\n            end\n        end\n    else\n        if <(button id) = [3]> then\n            forever\n                switch costume to (real hitbox v)\n                if <<touching (player1 v)?> or <touching (player2 v)?>> then\n                    switch costume to (button hitbox v)\n                    replace item (3) of [buttons pressed v] with (item (5) of [block start v])\n                else\n                    if <(button number) = [0]> then\n                        switch costume to (3b v)\n                        replace item (3) of [buttons pressed v] with (item (6) of [block start v])\n                    else\n                        if <(Button Check) = [0]> then\n                            switch costume to (3b v)\n                            replace item (3) of [buttons pressed v] with (item (6) of [block start v])\n                        end\n                    end\n                end\n            end\n        else\n            if <(button id) = [4]> then\n                forever\n                    switch costume to (real hitbox v)\n                    if <<touching (player1 v)?> or <touching (player2 v)?>> then\n                        switch costume to (button hitbox v)\n                        replace item (4) of [buttons pressed v] with (item (7) of [block start v])\n                    else\n                        switch costume to (button hitbox v)\n                        if <(button number) = [0]> then\n                            switch costume to (4b v)\n                            replace item (4) of [buttons pressed v] with (item (8) of [block start v])\n                        else\n                            if <(Button Check) = [0]> then\n                                switch costume to (4b v)\n                                replace item (4) of [buttons pressed v] with (item (8) of [block start v])\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <not <(button number) = [0]>> then\n    if <<touching (player1 v)?> or <touching (player2 v)?>> then\n        replace item (button number) of [button check v] with [1]\n    else\n        replace item (button number) of [button check v] with [0]\n    end\nend\n\nwhen I receive [reset v]\ndelete this clone\n\nset [button x v] to [22]\nset [button number v] to [0]\nset [button id v] to [0]\nset [button y v] to [-133]\nset [button id v] to [1]\ncreate clone of (_myself_ v)\n\nwhen I receive [set up v]\nif <(LEVEL) = [3]> then\n    replace item (1) of [block start v] with [true]\n    replace item (2) of [block start v] with [false]\n    replace item (3) of [block start v] with [true]\n    replace item (4) of [block start v] with [false]\n    replace item (5) of [block start v] with [true]\n    replace item (6) of [block start v] with [false]\n    replace item (7) of [block start v] with [true]\n    replace item (8) of [block start v] with [false]\nelse\n    if <(LEVEL) = [4]> then\n        replace item (1) of [block start v] with [true]\n        replace item (2) of [block start v] with [false]\n        replace item (3) of [block start v] with [true]\n        replace item (4) of [block start v] with [false]\n        replace item (5) of [block start v] with [true]\n        replace item (6) of [block start v] with [false]\n        replace item (7) of [block start v] with [true]\n        replace item (8) of [block start v] with [false]\n    else\n        if <(LEVEL) = [8]> then\n            replace item (1) of [block start v] with [true]\n            replace item (2) of [block start v] with [false]\n            replace item (3) of [block start v] with [false]\n            replace item (4) of [block start v] with [true]\n            replace item (5) of [block start v] with [true]\n            replace item (6) of [block start v] with [false]\n            replace item (7) of [block start v] with [false]\n            replace item (8) of [block start v] with [true]\n        else\n            if <(LEVEL) = [6]> then\n                replace item (1) of [block start v] with [true]\n                replace item (2) of [block start v] with [false]\n                replace item (3) of [block start v] with [true]\n                replace item (4) of [block start v] with [false]\n                replace item (5) of [block start v] with [true]\n                replace item (6) of [block start v] with [false]\n                replace item (7) of [block start v] with [false]\n                replace item (8) of [block start v] with [true]\n            else\n                if <(LEVEL) = [7]> then\n                    replace item (1) of [block start v] with [true]\n                    replace item (2) of [block start v] with [false]\n                    replace item (3) of [block start v] with [true]\n                    replace item (4) of [block start v] with [false]\n                    replace item (5) of [block start v] with [true]\n                    replace item (6) of [block start v] with [false]\n                    replace item (7) of [block start v] with [true]\n                    replace item (8) of [block start v] with [false]\n                end\n            end\n        end\n    end\nend\n\nswitch costume to (real hitbox v)\n\nwait (.3) seconds\n\nwait (.3) seconds\n\nwait (.3) seconds\n\nwait (.3) seconds\n\nwait (1) seconds\n\n@1\n\nwhen I receive [set up v]\nif <(LEVEL) = [3]> then\n    set [block x v] to [-191]\n    set [block y v] to [76]\n    set [block type v] to [skinny]\n    create clone of (_myself_ v)\n    set [block x v] to [-58]\n    set [block y v] to [-28]\n    set [block type v] to [skinny]\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [4]> then\n        set [block x v] to [118]\n        set [block y v] to [-40]\n        set [block type v] to [long]\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [8]> then\n            set [block x v] to [119]\n            set [block y v] to [-48]\n            set [block type v] to [block]\n            create clone of (_myself_ v)\n        else\n            if <(LEVEL) = [6]> then\n                set [block x v] to [-54]\n                set [block y v] to [64]\n                set [block type v] to [6]\n                create clone of (_myself_ v)\n            else\n                if <(LEVEL) = [7]> then\n                    set [block x v] to [-101]\n                    set [block y v] to [-67]\n                    set [block type v] to [8]\n                    create clone of (_myself_ v)\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (block type)\ngo to x: (block x) y: (block y)\nforever\n    if <(item (1) of [buttons pressed v]) = [true]> then\n        point in direction (90.01)\n        if <(x position) < [0]> then\n            replace item (1) of [block solid left v] with [false]\n        else\n            replace item (1) of [block solid right v] with [false]\n        end\n    else\n        if <(direction) = [90.01]> then\n            if <(x position) < [0]> then\n                wait until <not <touching (player1 v)?>>\n            else\n                wait until <not <touching (player2 v)?>>\n            end\n            point in direction (90)\n            if <<touching (player1 v)?> or <touching (player2 v)?>> then\n                if <(x position) < [0]> then\n                    replace item (1) of [block solid left v] with [true]\n                else\n                    replace item (1) of [block solid right v] with [true]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\n\n\nset [block x v] to [-58]\nset [block y v] to [-120]\nset [block type v] to [big]\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I start as a clone\nif <(x position) < [0]> then\n    forever\n        if <(item (1) of [block solid left v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nelse\n    forever\n        if <(item (1) of [block solid right v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\nif <(x position) < [0]> then\n    replace item (1) of [block solid left v] with [false]\nelse\n    replace item (1) of [block solid right v] with [false]\nend\n\nif <(direction) = [90.01]> then\n    if <(x position) < [0]> then\n        wait until <not <touching (player1 v)?>>\n    else\n        wait until <not <touching (player2 v)?>>\n    end\n    point in direction (90)\nend\n\nif <<touching (player1 v)?> or <touching (player2 v)?>> then\n    if <(x position) < [0]> then\n        replace item (1) of [block solid left v] with [true]\n    else\n        replace item (1) of [block solid right v] with [true]\n    end\nend\n\nset [ghost v] effect to (50)\n\nset [ghost v] effect to (0)\n\n@2\n\nwhen I receive [set up v]\nif <(LEVEL) = [4]> then\n    set [block x v] to [-125]\n    set [block y v] to [90]\n    set [block type v] to [long]\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [8]> then\n        set [block x v] to [-128]\n        set [block y v] to [72]\n        set [block type v] to [long2]\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [6]> then\n            set [block x v] to [-156]\n            set [block y v] to [150]\n            set [block type v] to [6]\n            create clone of (_myself_ v)\n        else\n            if <(LEVEL) = [7]> then\n                set [block x v] to [-109]\n                set [block y v] to [98]\n                set [block type v] to [8]\n                create clone of (_myself_ v)\n            end\n        end\n    end\nend\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (block type)\ngo to x: (block x) y: (block y)\nforever\n    if <(item (2) of [buttons pressed v]) = [true]> then\n        point in direction (90.01)\n        if <(x position) < [0]> then\n            replace item (2) of [block solid left v] with [false]\n        else\n            replace item (2) of [block solid right v] with [false]\n        end\n    else\n        if <(direction) = [90.01]> then\n            if <(x position) < [0]> then\n                wait until <not <touching (player1 v)?>>\n            else\n                wait until <not <touching (player2 v)?>>\n            end\n            point in direction (90)\n            if <<touching (player1 v)?> or <touching (player2 v)?>> then\n                if <(x position) < [0]> then\n                    replace item (2) of [block solid left v] with [true]\n                else\n                    replace item (2) of [block solid right v] with [true]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nset [block x v] to [118]\nset [block y v] to [-40]\nset [block type v] to [long]\ncreate clone of (_myself_ v)\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I start as a clone\nif <(x position) < [0]> then\n    forever\n        if <(item (2) of [block solid left v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nelse\n    forever\n        if <(item (2) of [block solid right v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\n@3\n\nwhen I receive [set up v]\nif <(LEVEL) = [4]> then\n    set [block x v] to [122]\n    set [block y v] to [80]\n    set [block type v] to [long]\n    create clone of (_myself_ v)\n    set [block x v] to [-120]\n    set [block y v] to [-50]\n    set [block type v] to [long]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (block type)\ngo to x: (block x) y: (block y)\nforever\n    if <(item (3) of [buttons pressed v]) = [true]> then\n        point in direction (90.01)\n        if <(x position) < [0]> then\n            replace item (3) of [block solid left v] with [false]\n        else\n            replace item (3) of [block solid right v] with [false]\n        end\n    else\n        if <(direction) = [90.01]> then\n            if <(x position) < [0]> then\n                wait until <not <touching (player1 v)?>>\n            else\n                wait until <not <touching (player2 v)?>>\n            end\n            point in direction (90)\n            if <touching (player1 v)?> then\n                if <(x position) < [0]> then\n                    replace item (3) of [block solid left v] with [true]\n                else\n                    replace item (3) of [block solid right v] with [true]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\n\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I start as a clone\nif <(x position) < [0]> then\n    forever\n        if <(item (3) of [block solid left v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nelse\n    forever\n        if <(item (3) of [block solid right v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\n@4\n\nwhen I receive [set up v]\nif <(LEVEL) = [6]> then\n    set [block x v] to [-54]\n    set [block y v] to [-70]\n    set [block type v] to [square]\n    create clone of (_myself_ v)\nelse\n    if <(LEVEL) = [8]> then\n        set [block x v] to [-110]\n        set [block y v] to [-40]\n        set [block type v] to [rec]\n        create clone of (_myself_ v)\n    else\n        if <(LEVEL) = [7]> then\n            set [block x v] to [63]\n            set [block y v] to [-31]\n            set [block type v] to [8]\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I start as a clone\npoint in direction (90)\nshow\ngo to [back v] layer\ngo [forward v] (2) layers\nswitch costume to (block type)\ngo to x: (block x) y: (block y)\nforever\n    if <(item (4) of [buttons pressed v]) = [true]> then\n        point in direction (90.01)\n        if <(x position) < [0]> then\n            replace item (4) of [block solid left v] with [false]\n        else\n            replace item (4) of [block solid right v] with [false]\n        end\n    else\n        if <(direction) = [90.01]> then\n            if <(x position) < [0]> then\n                wait until <not <touching (player1 v)?>>\n            else\n                wait until <not <touching (player2 v)?>>\n            end\n            point in direction (90)\n            if <touching (player1 v)?> then\n                if <(x position) < [0]> then\n                    replace item (4) of [block solid left v] with [true]\n                else\n                    replace item (4) of [block solid right v] with [true]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nif <(LEVEL) = [3]> then\n\n\n\nwhen I receive [reset v]\ndelete this clone\n\nwhen I receive [reset v]\ndelete this clone\n\nset [block x v] to [122]\nset [block y v] to [-40]\nset [block type v] to [long]\ncreate clone of (_myself_ v)\nset [block x v] to [117]\nset [block y v] to [80]\nset [block type v] to [long]\ncreate clone of (_myself_ v)\nset [block x v] to [-125]\nset [block y v] to [-20]\nset [block type v] to [long]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(x position) < [0]> then\n    forever\n        if <(item (4) of [block solid left v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nelse\n    forever\n        if <(item (4) of [block solid right v]) = [false]> then\n            set [ghost v] effect to (50)\n        else\n            set [ghost v] effect to (0)\n        end\n    end\nend\n\n@UI\n\nwhen I receive [show end v]\nset [clone id v] to [0]\nset [stop time v] to (item (1) of [clouddatadecoded v])\nrepeat (2)\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\n    go to x: (-20) y: (23)\nend\nset [counter1 v] to [1]\ngo to x: (-10) y: (40)\nrepeat (length of (Time:))\n    switch costume to (join [b] (letter (COUNTER1) of (Time:)))\n    if <(costume [name v]) = [b.]> then\n        change x by (15)\n    else\n        change x by (15)\n    end\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\n    change [counter1 v] by (1)\nend\nset [time: v] to (item (2) of [clouddatadecoded v])\nset [counter1 v] to [1]\ngo to x: (70) y: (0)\nrepeat (length of (Time:))\n    switch costume to (join [b] (letter (COUNTER1) of (Time:)))\n    if <(costume [name v]) = [b.]> then\n        change x by (15)\n    else\n        change x by (15)\n    end\n    change [clone id v] by (1)\n    create clone of (_myself_ v)\n    change [counter1 v] by (1)\nend\nwait (1) seconds\nshow variable [stop time v]\n\nwhen I receive [green flag v]\nhide\n\nwhen I start as a clone\nshow\nif <(clone id) = [1]> then\n    switch costume to (time: v)\n    go to x: (-50) y: (40)\nelse\n    if <(clone id) = [2]> then\n        switch costume to (best time v)\n        go to x: (0) y: (0)\n    else\n        if <(clone id) > [2]> then\n            set size to (180) %\n        end\n    end\nend\n\nbroadcast (Green Flag v) and wait\nif <(Time:) < (item (2) of [clouddatadecoded v])> then\n    set [☁ hs - player v] to (Local-Encoded)\nend\n\nset [☁ hs - time v] to [0]\n\nswitch costume to (best time v)\ngo to x: (0) y: (0)\n\n@Settings\n\nwhen I receive [play game v]\nset [ghost v] effect to (100)\npoint in direction (90)\nset [tic v] to [0]\nset [can click v] to [true]\nswitch costume to (settings v)\nshow\nset size to (100) %\ngo to x: (207) y: (154)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nforever\n    switch costume to (settings v)\n    if <touching (mouse-pointer v)?> then\n        wait until <mouse down?>\n        if <touching (mouse-pointer v)?> then\n            set [can click v] to [false]\n            broadcast (ShowSettings v)\n            switch costume to (x v)\n            wait until <not <mouse down?>>\n            wait until <<mouse down?> and <touching (mouse-pointer v)?>>\n            set [can click v] to [go]\n            wait until <(CAN CLICK) = [true]>\n            switch costume to (settings v)\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\nwhen I receive [showsettings v]\nset [setting id v] to [0]\nrepeat (4)\n    change [setting id v] by (1)\n    create clone of (_myself_ v)\nend\nif <not <(LEVEL) = [9]>> then\n    repeat (2)\n        change [setting id v] by (1)\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\ngo to x: (220) y: (165)\nset size to (100) %\nif <(setting id) = [1]> then\n    switch costume to (join [Music] (MUSIC REAL))\n    repeat (30)\n        change y by (((70) - (y position)) / (5))\n        change x by (((35) - (x position)) / (5))\n    end\nelse\n    if <(setting id) = [2]> then\n        switch costume to (music v)\n        repeat (30)\n            change y by (((70) - (y position)) / (5))\n            change x by (((-50) - (x position)) / (5))\n        end\n    else\n        if <(setting id) = [3]> then\n            switch costume to (join [Sound] (SOUND))\n            repeat (30)\n                change y by (((10) - (y position)) / (5))\n                change x by (((35) - (x position)) / (5))\n            end\n        else\n            if <(setting id) = [4]> then\n                switch costume to (sound fx v)\n                repeat (30)\n                    change y by (((10) - (y position)) / (5))\n                    change x by (((-85) - (x position)) / (5))\n                end\n            else\n                if <(setting id) = [5]> then\n                    switch costume to (join [Timer] (TIMER))\n                    repeat (30)\n                        change y by (((-40) - (y position)) / (5))\n                        change x by (((30) - (x position)) / (5))\n                    end\n                else\n                    if <(setting id) = [6]> then\n                        switch costume to (timer v)\n                        repeat (30)\n                            change y by (((-40) - (y position)) / (5))\n                            change x by (((-60) - (x position)) / (5))\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nwait until <(CAN CLICK) = [go]>\nrepeat (15)\n    set size to (500) %\n    change y by (((221) - (y position)) / (5))\n    change x by (((200) - (x position)) / (5))\n    set size to (200) %\nend\nset [can click v] to [true]\ndelete this clone\n\nwhen I receive [startgame v]\ngo to [front v] layer\n\nwhen I start as a clone\nif <(setting id) = [1]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            wait until <mouse down?>\n            if <touching (mouse-pointer v)?> then\n                if <(MUSIC REAL) = [ON]> then\n                    set [music real v] to [OFF]\n                else\n                    set [music real v] to [ON]\n                end\n                wait until <not <mouse down?>>\n            end\n        end\n    end\nelse\n    if <(setting id) = [3]> then\n        forever\n            if <touching (mouse-pointer v)?> then\n                wait until <mouse down?>\n                if <touching (mouse-pointer v)?> then\n                    if <(SOUND) = [ON]> then\n                        set [sound v] to [OFF]\n                    else\n                        set [sound v] to [ON]\n                    end\n                    wait until <not <mouse down?>>\n                end\n            end\n        end\n    else\n        if <(setting id) = [5]> then\n            forever\n                if <touching (mouse-pointer v)?> then\n                    wait until <mouse down?>\n                    if <touching (mouse-pointer v)?> then\n                        if <(TIMER) = [ON]> then\n                            set [timer v] to [OFF]\n                        else\n                            set [timer v] to [ON]\n                        end\n                        wait until <not <mouse down?>>\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(setting id) = [1]> then\n    forever\n        switch costume to (join [Music] (MUSIC REAL))\n    end\nelse\n    if <(setting id) = [3]> then\n        forever\n            switch costume to (join [Sound] (SOUND))\n        end\n    else\n        if <(setting id) = [5]> then\n            forever\n                switch costume to (join [Timer] (TIMER))\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(setting id) = [1]> then\n    forever\n        if <touching (mouse-pointer v)?> then\n            point in direction ((([sin v] of ((tic) * ((1.4) * (1.3))) ) * (9)) + (90))\n            change [tic v] by (5)\n        else\n            point in direction (90)\n        end\n    end\nelse\n    if <(setting id) = [3]> then\n        forever\n            if <touching (mouse-pointer v)?> then\n                point in direction ((([sin v] of ((tic) * ((1.4) * (1.3))) ) * (9)) + (90))\n                change [tic v] by (5)\n            else\n                point in direction (90)\n            end\n        end\n    else\n        if <(setting id) = [5]> then\n            forever\n                if <touching (mouse-pointer v)?> then\n                    point in direction ((([sin v] of ((tic) * ((1.4) * (1.3))) ) * (9)) + (90))\n                    change [tic v] by (5)\n                else\n                    point in direction (90)\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [play game v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [touching settings v] to [true]\n    else\n        set [touching settings v] to [false]\n    end\nend\n\n@Skip\n\nwhen I receive [reset v]\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen I receive [set up v]\npoint in direction (90)\nif <(LEVEL) = [1]> then\n    set size to (130) %\n    set [clone od v] to [2]\n    go to x: (-200) y: (20)\n    switch costume to (move v)\n    create clone of (_myself_ v)\n    go to x: (-100) y: (20)\n    switch costume to (untitled drawing \(19\)2 v)\n    create clone of (_myself_ v)\nend\nif <(LEVEL) = [4]> then\n    wait (5) seconds\n    set [clone od v] to [3]\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nhide\nif <(clone od) = [2]> then\n    show\n    forever\n        change y by (([cos v] of ((my tic) * (1.4)) ) * (1.5))\n        change [my tic v] by (5)\n    end\nelse\n    if <(clone od) = [3]> then\n        set size to (100) %\n        go to [back v] layer\n        switch costume to (nothing xy v)\n        change x by ((-140) - (x position))\n        change y by ((300) - (y position))\n        show\n        switch costume to (ask v)\n        repeat (100)\n            change y by (((170) - (y position)) / (4))\n        end\n        wait (6) seconds\n        repeat (300)\n            switch costume to (nothing xy v)\n            change y by (((300) - (y position)) / (6))\n            switch costume to (ask v)\n        end\n        delete this clone\n    end\nend\n\ngo to x: (-200) y: (20)\nswitch costume to (move v)\ncreate clone of (_myself_ v)\ngo to x: (-100) y: (20)\nswitch costume to (untitled drawing \(19\)2 v)\n\n@Intro\n\nwhen I receive [intro v]\nswitch backdrop to (black v)\nset [introtic v] to [0]\nset volume to (100) %\nstart sound [intro v]\ngo to x: (0) y: (0)\nreset timer\nhide\nswitch costume to (nothing v)\npoint in direction (90)\nset size to (1000) %\nswitch costume to (coollogo_com-17592853 v)\nwait (3) seconds\nshow\nrepeat (30)\n    change size by (((100) - (size)) / (7))\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (20)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change size by (([sin v] of (INTROTIC) ) / (1))\n    change [introtic v] by (5)\nend\nrepeat (3)\n    change size by (5)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (3)\n    change size by (-5)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (30)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change size by (([sin v] of (INTROTIC) ) / (1))\n    change [introtic v] by (5)\nend\nrepeat (3)\n    change size by (5)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (3)\n    change size by (-5)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (50)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change size by (([sin v] of (INTROTIC) ) / (1))\n    change [introtic v] by (5)\nend\nrepeat (3)\n    change size by (5)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (3)\n    change size by (-5)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\nend\nrepeat (17)\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change size by (([sin v] of (INTROTIC) ) / (1))\n    change [introtic v] by (5)\nend\nrepeat (100)\n    set size to (1000) %\n    change x by (((500) - (x position)) / (8))\n    point in direction ((([cos v] of ((INTROTIC) * (1.4)) ) * (9)) + (90))\n    change [introtic v] by (5)\n    set size to (100) %\n    set size to ((size) + (([sin v] of (INTROTIC) ) / (1))) %\nend\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\nswitch costume to (fade v)\ngo to [front v] layer\nset [ghost v] effect to (0)\nbroadcast (PLAY ;O v)\nrepeat (70)\n    change volume by (-1.7)\n    change [ghost v] effect by (1.7)\nend\nhide\n\nwhen flag clicked\nhide\n\nwait (4) seconds\n\nswitch backdrop to (black v)\n\nrepeat (100)\n    change [ghost v] effect by (1)\nend\n\nrepeat (50)\n    change [ghost v] effect by (2)\nend\n\n@Thumbnail\n\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen flag clicked\nhide\n\n@Real Skip\n\nwhen I receive [add skip v]\nhide\nhide\nwait (14) seconds\ngo to x: (220) y: (110)\nshow\nforever\n    switch costume to (costume1 v)\n    go to [back v] layer\n    go [forward v] (10) layers\n    point in direction ((([sin v] of ((my tic) * ((1.4) * (1.3))) ) * (9)) + (90))\n    change [my tic v] by (6)\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n        if <mouse down?> then\n            broadcast (Transition v)\n            hide\n            stop [this script v]\n        end\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\n
WASD to walk around\nSpace to jump\nArrow keys or Mouse to look around