Platformer Tutorial || ADVANCED


@Stage\n\nwhen I receive [change music v]\nif <not <(_MUSIC) = ([ceiling v] of ((_LEVEL) / (15)) )>> then\n    repeat (40)\n        change volume by (-2.5)\n    end\n    stop [other scripts in sprite v]\n    broadcast (_START MUSIC v)\nend\n\nwhen I receive [_start music v]\nforever\n    set volume to (50) %\n    set [_music v] to ([ceiling v] of ((_LEVEL) / (15)) )\n    play sound (_MUSIC) until done\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nset [___game mode v] to [0]\nbroadcast (_MAIN MENU v)\ngo to [front v] layer\n\nwhen [t v] key pressed\ngo to [front v] layer\n\nwhen I receive [__outro v]\nswitch costume to (thumbnail4 v)\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\n@Player\n\ndefine Change Y by (y)\nset [check semisolid v] to [0]\nif <touching (semi solid v)?> then\n    set [check semisolid v] to [0]\nelse\n    if <(y) < [0.01]> then\n        set [check semisolid v] to [1]\n    end\nend\nif <[_player moves v] contains [down]?> then\n    set [check semisolid v] to [0]\nend\nchange [y v] by (y)\nGet Solid\nif <(is solid) > [0]> then\n    if <<(y) < [0.01]> and <<not <[_player moves v] contains [right]?>> and <not <[_player moves v] contains [left]?>>>> then\n        change [x v] by (-1)\n        Position\n        Get Solid\n        if <(is solid) > [0]> then\n            change [x v] by (2)\n            Position\n            Get Solid\n            if <(is solid) > [0]> then\n                change [x v] by (-1)\n                set [yv v] to [0]\n                set [in air v] to [0]\n                repeat ([ceiling v] of ([abs v] of (y) ) )\n                    if <(is solid) > [0]> then\n                        change [y v] by ((0) - ((y) / ([ceiling v] of ([abs v] of (y) ) )))\n                        Get Solid\n                    else\n                        stop [this script v]\n                    end\n                end\n            end\n        end\n    else\n        set [yv v] to [0]\n        if <(y) < [0.01]> then\n            set [in air v] to [0]\n        end\n        repeat (([ceiling v] of ([abs v] of (y) ) ) + (4))\n            if <(is solid) > [0]> then\n                change [y v] by ((0) - ((y) / ([ceiling v] of ([abs v] of (y) ) )))\n                Get Solid\n            else\n                stop [this script v]\n            end\n        end\n    end\nend\n\ndefine Change X by (x) Slope: (slope)\nif <touching (semi solid v)?> then\n    set [check semisolid v] to [0]\nelse\n    set [check semisolid v] to [1]\nend\nchange [x v] by (x)\nset [old xv v] to (xv)\nGet Solid\nrepeat (slope)\n    if <(is solid) > [0]> then\n        set [xv v] to ((xv) * (0.8))\n        change [y v] by (1)\n        Get Solid\n    else\n        stop [this script v]\n    end\nend\nset [check semisolid v] to [0]\nchange [y v] by ((0) - (slope))\nset [xv v] to (old xv)\nGet Solid\nif <(is solid) > [0]> then\n    set [xv v] to [0]\n    repeat (([abs v] of (x) ) + (2))\n        Get Solid\n        if <(is solid) > [0]> then\n            change [x v] by ((0) - ((x) / ([abs v] of (x) )))\n        else\n            stop [this script v]\n        end\n    end\nend\n\ndefine Controls (speed)\nif <[_player moves v] contains [right]?> then\n    point in direction (90)\n    change [xv v] by (speed)\nelse\n    if <[_player moves v] contains [left]?> then\n        point in direction (-90)\n        change [xv v] by ((0) - (speed))\n    end\nend\nif <<[_player moves v] contains [up]?> and <(in air) < [4]>> then\n    set [yv v] to [10]\n    Particle at X: (x position) Y: ((y position) - ((5) * (_PLAYER SIZE%))) Type: [2]\n    if <(in air) = [0]> then\n        start sound [Jump v]\n    end\nend\nif <[_player moves v] contains [Bounce]?> then\n    set [yv v] to [20]\n    set [in air v] to [999]\n    add (x position) to [_particle spawns v]\n    add ((y position) - ((0) * (_PLAYER SIZE%))) to [_particle spawns v]\n    add [3] to [_particle spawns v]\nend\nif <<(in air) > [999]> and <(in air) < [1005]>> then\n    Particle at X: (x position) Y: ((y position) - ((5) * (_PLAYER SIZE%))) Type: [2]\nend\n\ndefine game loop\nrepeat until \n    set rotation style [don't rotate v]\n    switch costume to (hitbox v)\n    change [ghost v] effect by (-4)\n    Handle Movement Inputs\n    Controls [2]\n    if <([abs v] of (yv) ) > [1]> then\n        change [in air v] by (1)\n    end\n    change [yv v] by (-1)\n    set [xv v] to ((xv) * (0.8))\n    Change X by (round ((xv) * (_PLAYER SIZE%))) Slope: ([ceiling v] of ((8) * (_PLAYER SIZE%)) )\n    Change Y by (round ((yv) * (_PLAYER SIZE%)))\n    Get Solid\n    if <<<<touching (obstacles v)?> or <touching (moving spikes v)?>> or <touching (blades v)?>> or <(y) < [-190]>> then\n        Die\n    end\n    set rotation style [left-right v]\n    Draw\n    delete all of [_player moves v]\nend\nset [___game mode v] to [2]\nstart sound [Connect v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nchange [_level v] by (1)\nif <(__UNLOCKED) < (_LEVEL)> then\n    set [__unlocked v] to (_LEVEL)\nend\nbroadcast (__Screen Wipe v) and wait\nstop [this script v]\n\nwhen I start as a clone\nset rotation style [left-right v]\nshow\nDraw\nrepeat (15)\n    change y by ((2) * (_PLAYER SIZE%))\n    change [ghost v] effect by (7)\nend\ndelete this clone\n\ndefine Spawn\nset [yv v] to [0]\nset [xv v] to [0]\nset [x v] to (item ((((_LEVEL) - (1)) * (3)) + (1)) of [player spawn v])\nset [y v] to (item ((((_LEVEL) - (1)) * (3)) + (2)) of [player spawn v])\nPosition\nif <(x position) > [0]> then\n    point in direction (-90)\nelse\n    point in direction (90)\nend\n\ndefine Get Solid\nPosition\nif <<<<touching (level v)?> or <touching (doors v)?>> or <touching (platforms v)?>> or <<touching (semi solid v)?> and <(check semisolid) > [0]>>> then\n    set [is solid v] to [1]\nelse\n    if <<(x) < [-242]> or <(x) > [242]>> then\n        set [is solid v] to [1]\n    else\n        set [is solid v] to [0]\n    end\nend\n\nwhen [r v] key pressed\nif <(___GAME MODE) = [1]> then\n    broadcast (delete objects v) and wait\n    Begin\n    broadcast (begin v) and wait\nend\n\ndefine Draw\nswitch costume to (large v)\nPosition\nif <(in air) > [3]> then\n    switch costume to (((0) - (((yv) / ([abs v] of (yv) )) / (2))) + (3.5))\nelse\n    if <([abs v] of (xv) ) > [0.4]> then\n        switch costume to ([floor v] of ((((timer) * (16)) mod (4)) + (5)) )\n    else\n        switch costume to ([floor v] of ((((timer) * (4.35)) mod (2)) + (1)) )\n    end\nend\n\ndefine Begin\nSpawn\nDraw\nbroadcast (change music v)\nset [_keys collected v] to [0]\nset [_total keys v] to [0]\nshow\nclear graphic effects\nset [ghost v] effect to (100)\nswitch backdrop to (join [Level] (_LEVEL))\nif <(backdrop [name v]) = (join [Level] (_LEVEL))> then\nScale\nbroadcast (setup level v) and wait\n\nwhen flag clicked\nset [prev timer v] to (timer)\nset [fps count v] to [0]\nforever\n    change [fps count v] by (1)\n    if <(timer) > ((prev timer) + (1))> then\n        set [__fps v] to (fps count)\n        set [fps count v] to [0]\n        set [prev timer v] to (timer)\n    end\nend\n\ndefine Handle Movement Inputs\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    add [right] to [_player moves v]\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    add [left] to [_player moves v]\nend\nif <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n    add [down] to [_player moves v]\nend\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    add [up] to [_player moves v]\nend\n\ndefine Position\ngo to x: (x) y: (y)\n\nwhen I receive [die v]\nDie\n\ndefine Die\nstart sound [Hit v]\ncreate clone of (_myself_ v)\nBegin\n\nwhen I receive [enemy stomp v]\nset [yv v] to [15]\nset [in air v] to [9999999999]\n\nwhen I receive [_start game loop v]\ndelete all of [_player moves v]\nbroadcast (_START JOYSTICK v)\nbroadcast (_LAYER ALL v) and wait\nbroadcast (init particles v)\ngo to [front v] layer\ngo [backward v] (2) layers\nrepeat until <(_LEVEL) = [46]>\n    Scale\n    broadcast (delete objects v) and wait\n    Begin\n    set [___game mode v] to [1]\n    broadcast (begin v) and wait\n    game loop\nend\nerase all\nbroadcast (delete objects v) and wait\nbroadcast (delete special objects v) and wait\nbroadcast (__STOP PROCESSES v) and wait\nbroadcast (__END GAME v) and wait\nbroadcast (change music v) and wait\n\nwhen flag clicked\nhide\n\ndefine Scale\nif <(_LEVEL) < [34]> then\n    set size to (101) %\nelse\n    if <(_LEVEL) < [36]> then\n        set size to (75) %\n    else\n        if <(_LEVEL) < [41]> then\n            set size to (101) %\n        else\n            set size to (75) %\n        end\n    end\nend\nset [_player size% v] to ((size) / (101))\n\nwhen I receive [setup level v]\nerase all\nbroadcast (draw new level v)\nbroadcast (layer particles v)\nbroadcast (delete special objects v) and wait\nbroadcast (spawn special objects v) and wait\nbroadcast (begin processes v)\n\nwhen I receive [_restart v]\nif <(___GAME MODE) = [1]> then\n    broadcast (delete objects v) and wait\n    Begin\n    broadcast (begin v) and wait\nend\n\ndefine Particle at X: (x) Y: (y) Type: (id)\nadd (x) to [_particle spawns v]\nadd (y) to [_particle spawns v]\nadd (id) to [_particle spawns v]\n\n@Level\n\nwhen I receive [draw new level v]\nswitch costume to (join [Level] (_LEVEL))\nshow\nStamp Shadow\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\nwhen I receive [_layer all v]\ngo to [back v] layer\ngo [forward v] (5) layers\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (60)\ngo to x: (8) y: (-8)\nstamp\nclear graphic effects\n\nwhen I receive [__end game v]\nhide\n\n@Doors\n\nwhen I receive [begin processes v]\nrepeat (3)\nwait until <(_KEYS COLLECTED) = [1]>\nrepeat (15)\nrepeat (4)\n    change [ghost v] effect by (13)\nend\nerase all\nbroadcast (draw new level v)\nrepeat (4)\n    change [ghost v] effect by (13)\nend\nhide\n\nwhen I receive [draw new level v]\nif <(_KEYS COLLECTED) = [0]> then\n    stop [other scripts in sprite v]\n    switch costume to (join [Level] (_LEVEL))\n    if <(costume [name v]) = (join [Level] (_LEVEL))> then\n        show\n        Stamp Shadow\n        go to x: (0) y: (0)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [_layer all v]\ngo to [back v] layer\ngo [forward v] (4) layers\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (60)\ngo to x: (8) y: (-8)\nstamp\nclear graphic effects\n\nwhen I receive [__end game v]\nhide\n\nwhen I receive [__stop processes v]\nstop [other scripts in sprite v]\n\n@Obstacles\n\nwhen I receive [draw new level v]\nswitch costume to (join [Level] (_LEVEL))\nif <(costume [name v]) = (join [Level] (_LEVEL))> then\n    Stamp Shadow\n    set [brightness v] effect to (100)\n    go to x: (0) y: (0)\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [_layer all v]\ngo to [back v] layer\ngo [forward v] (3) layers\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (60)\ngo to x: (8) y: (-8)\nstamp\nclear graphic effects\n\nwhen I receive [__end game v]\nhide\n\n@Moving Spikes\n\nwhen I receive [draw new level v]\nset [correct costume v] to (join [Level] (_LEVEL))\nswitch costume to (correct costume)\nif <(costume [name v]) = (correct costume)> then\n    show\n    set [brightness v] effect to (100)\n    Stamp Shadow\n    set x to (0)\nelse\n    hide\nend\n\nwhen I receive [_start game loop v]\nforever\n    set [y v] to [0]\n    repeat (30)\n    repeat (13)\n        change [y v] by (-3)\n    end\n    set [y v] to ((-3) * (13))\n    repeat (30)\n    repeat (13)\n        change [y v] by (3)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [_layer all v]\ngo to [back v] layer\ngo [forward v] (2) layers\n\nwhen I receive [_start game loop v]\nforever\n    switch costume to (position v)\n    set y to ((y) * (_PLAYER SIZE%))\n    switch costume to (correct costume)\nend\n\nwhen I receive [__end game v]\nhide\n\nwhen I receive [__stop processes v]\nstop [other scripts in sprite v]\n\n@Semi Solid\n\nwhen I receive [_layer all v]\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen flag clicked\nhide\n\nwhen I receive [draw new level v]\nswitch costume to (join [Level] (_LEVEL))\nif <(costume [name v]) = (join [Level] (_LEVEL))> then\n    show\n    Stamp Shadow\n    go to x: (0) y: (0)\nelse\n    hide\nend\n\ndefine Stamp Shadow\nset [brightness v] effect to (-100)\nset [ghost v] effect to (60)\ngo to x: (8) y: (-8)\nstamp\nclear graphic effects\n\nwhen I receive [__end game v]\nhide\n\n@Flag\n\nwhen I receive [begin v]\nif <(_LEVEL) < [45]> then\n    set size to ([size v] of [player v]) %\n    go to [front v] layer\n    if <(id) = [0]> then\n        set [brightness v] effect to (100)\n        if <(_LEVEL) < (((length of [flag spawn v]) / (4)) + (1))> then\n            Flag | X: (item ((((_LEVEL) - (1)) * (4)) + (2)) of [flag spawn v]) Y (item ((((_LEVEL) - (1)) * (4)) + (3)) of [flag spawn v])\n            hide\n        else\n            show\n        end\n    end\nelse\n    hide\nend\n\ndefine Flag | X: (x) Y (y)\ngo to x: (x) y: (y)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [id v] to [0]\nhide\n\nwhen I receive [delete objects v]\ndelete this clone\n\nwhen I start as a clone\nset [id v] to [flag]\nset [brightness v] effect to (100)\nset [ghost v] effect to (100)\nswitch costume to (flag v)\ngo to [back v] layer\ngo [forward v] ((7) + (_PARTICLE COUNT)) layers\nshow\npoint in direction (160)\nrepeat until <(direction) < [90.05]>\n    turn left (((direction) - (90.05)) / (5)) degrees\n    change [ghost v] effect by (-5)\nend\n\nwhen I start as a clone\nforever\n    switch costume to (((timer) * (12)) mod (8))\nend\n\n@Keys\n\nwhen I receive [spawn special objects v]\nset [brightness v] effect to (100)\nset size to ([size v] of [player v]) %\nif <(id) = [0]> then\n    if <(_LEVEL) = [4]> then\n        Key | X: [138] Y [140]\n    else\n        if <(_LEVEL) = [5]> then\n            Key | X: [-110] Y [126]\n        else\n            if <(_LEVEL) = [6]> then\n                Key | X: [-112] Y [-74]\n                Key | X: [112] Y [118]\n                Key | X: [-150] Y [76]\n            else\n                if <(_LEVEL) = [9]> then\n                    Key | X: [-124] Y [96]\n                else\n                    if <(_LEVEL) = [10]> then\n                        Key | X: [134] Y [-24]\n                        Key | X: [-184] Y [110]\n                    else\n                        if <(_LEVEL) = [11]> then\n                            Key | X: [158] Y [14]\n                            Key | X: [206] Y [130]\n                            Key | X: [-166] Y [80]\n                        else\n                            if <(_LEVEL) = [12]> then\n                                Key | X: [144] Y [-120]\n                                Key | X: [-85] Y [-16]\n                                Key | X: [-214] Y [76]\n                            else\n                                if <(_LEVEL) = [13]> then\n                                    Key | X: [-66] Y [-130]\n                                    Key | X: [66] Y [-130]\n                                    Key | X: [82] Y [120]\n                                    Key | X: [218] Y [72]\n                                    Key | X: [-176] Y [-114]\n                                else\n                                    if <(_LEVEL) = [14]> then\n                                        Key | X: [190] Y [34]\n                                        Key | X: [4] Y [70]\n                                    else\n                                        if <(_LEVEL) = [15]> then\n                                            Key | X: [114] Y [168]\n                                            Key | X: [196] Y [-78]\n                                        else\n                                            if <(_LEVEL) = [16]> then\n                                                Key | X: [-186] Y [-120]\n                                                Key | X: [164] Y [112]\n                                            else\n                                                if <(_LEVEL) = [17]> then\n                                                    Key | X: [116] Y [-64]\n                                                    Key | X: [-204] Y [60]\n                                                    Key | X: [-218] Y [-118]\n                                                else\n                                                    if <(_LEVEL) = [18]> then\n                                                        Key | X: [-156] Y [156]\n                                                        Key | X: [-40] Y [100]\n                                                    else\n                                                        if <(_LEVEL) = [20]> then\n                                                            Key | X: [-134] Y [24]\n                                                            Key | X: [134] Y [24]\n                                                        else\n                                                            if <(_LEVEL) = [21]> then\n                                                                Key | X: [-182] Y [-72]\n                                                            else\n                                                                if <(_LEVEL) = [22]> then\n                                                                    Key | X: [4] Y [-44]\n                                                                    Key | X: [210] Y [-100]\n                                                                else\n                                                                    if <(_LEVEL) = [24]> then\n                                                                        Key | X: [-198] Y [-130]\n                                                                    else\n                                                                        if <(_LEVEL) = [25]> then\n                                                                            Key | X: [92] Y [124]\n                                                                            Key | X: [-218] Y [86]\n                                                                            Key | X: [184] Y [-96]\n                                                                        else\n                                                                            if <(_LEVEL) = [27]> then\n                                                                                Key | X: [143] Y [-18]\n                                                                                Key | X: [-155] Y [-116]\n                                                                            else\n                                                                                if <(_LEVEL) = [28]> then\n                                                                                    Key | X: [-165] Y [-88]\n                                                                                    Key | X: [-31] Y [116]\n                                                                                else\n                                                                                    if <(_LEVEL) = [30]> then\n                                                                                        Key | X: [-87] Y [142]\n                                                                                        Key | X: [175] Y [-54]\n                                                                                        Key | X: [-175] Y [54]\n                                                                                    else\n                                                                                        if <(_LEVEL) = [32]> then\n                                                                                            Key | X: [0] Y [-26]\n                                                                                        else\n                                                                                            if <(_LEVEL) = [33]> then\n                                                                                                Key | X: [158] Y [-126]\n                                                                                                Key | X: [-82] Y [-42]\n                                                                                                Key | X: [34] Y [-40]\n                                                                                            else\n                                                                                                if <(_LEVEL) = [34]> then\n                                                                                                    Key | X: [-15] Y [148]\n                                                                                                else\n                                                                                                    if <(_LEVEL) = [35]> then\n                                                                                                        Key | X: [-215] Y [-114]\n                                                                                                    else\n                                                                                                        if <(_LEVEL) = [36]> then\n                                                                                                            Key | X: [11] Y [-130]\n                                                                                                            Key | X: [185] Y [-28]\n                                                                                                            Key | X: [-109] Y [146]\n                                                                                                        else\n                                                                                                            if <(_LEVEL) = [37]> then\n                                                                                                                Key | X: [50] Y [14]\n                                                                                                                Key | X: [-50] Y [14]\n                                                                                                                Key | X: [0] Y [40]\n                                                                                                                Key | X: [96] Y [-132]\n                                                                                                                Key | X: [-188] Y [-72]\n                                                                                                                Key | X: [-188] Y [-134]\n                                                                                                                Key | X: [-188] Y [-6]\n                                                                                                                Key | X: [-188] Y [70]\n                                                                                                            else\n                                                                                                                if <(_LEVEL) = [38]> then\n                                                                                                                    Key | X: [-108] Y [-18]\n                                                                                                                    Key | X: [106] Y [-62]\n                                                                                                                else\n                                                                                                                    if <(_LEVEL) = [39]> then\n                                                                                                                        Key | X: [-222] Y [48]\n                                                                                                                        Key | X: [198] Y [120]\n                                                                                                                        Key | X: [-52] Y [-130]\n                                                                                                                        Key | X: [84] Y [174]\n                                                                                                                        Key | X: [-50] Y [24]\n                                                                                                                    else\n                                                                                                                        if <(_LEVEL) = [41]> then\n                                                                                                                            Key | X: [-116] Y [-148]\n                                                                                                                            Key | X: [197] Y [-136]\n                                                                                                                            Key | X: [-58] Y [39]\n                                                                                                                            Key | X: [-197] Y [136]\n                                                                                                                            Key | X: [163] Y [46]\n                                                                                                                            Key | X: [172] Y [-53]\n                                                                                                                        else\n                                                                                                                            if <(_LEVEL) = [42]> then\n                                                                                                                                Key | X: [-34] Y [50]\n                                                                                                                            else\n                                                                                                                                if <(_LEVEL) = [43]> then\n                                                                                                                                    Key | X: [-86] Y [44]\n                                                                                                                                else\n                                                                                                                                    if <(_LEVEL) = [44]> then\n                                                                                                                                        Key | X: [213] Y [133]\n                                                                                                                                        Key | X: [-209] Y [69]\n                                                                                                                                    else\n                                                                                                                                        if <(_LEVEL) = [45]> then\n                                                                                                                                            Key | X: [-221] Y [-140]\n                                                                                                                                            Key | X: [-155] Y [158]\n                                                                                                                                            Key | X: [-41] Y [-146]\n                                                                                                                                            Key | X: [148] Y [160]\n                                                                                                                                        end\n                                                                                                                                    end\n                                                                                                                                end\n                                                                                                                            end\n                                                                                                                        end\n                                                                                                                    end\n                                                                                                                end\n                                                                                                            end\n                                                                                                        end\n                                                                                                    end\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    hide\nend\n\ndefine Key | X: (x) Y (y)\ngo to x: (x) y: (y)\nset [y v] to (y)\nchange [_total keys v] by (1)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [id v] to [0]\ngo to [front v] layer\n\nwhen I receive [delete special objects v]\ndelete this clone\n\nwhen I start as a clone\nset [id v] to [key]\nset [brightness v] effect to (100)\nset [ghost v] effect to (100)\nswitch costume to (key v)\ngo to [back v] layer\ngo [forward v] ((8) + (_PARTICLE COUNT)) layers\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait until <(distance to [player v]) < ((30) * (_PLAYER SIZE%))>\nstart sound [Clang v]\nchange [_total keys v] by (-1)\nif <(_TOTAL KEYS) < [1]> then\n    set [_keys collected v] to [1]\nend\nrepeat (10)\n    change [ghost v] effect by (10)\n    change [y v] by (2)\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    switch costume to (key v)\n    set y to ((y) + ((([sin v] of (((timer) + ((x position) * (2))) * (200)) ) * (7)) * ((size) / (100))))\nend\n\ndefine Particle at X: (x) Y: (y) Type: (id)\nadd (x) to [_particle spawns v]\nadd (y) to [_particle spawns v]\nadd (id) to [_particle spawns v]\n\n@Bouncy\n\nwhen I receive [begin v]\nSpawn Trampolines\n\ndefine trampoline | X: (x) Y (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [id v] to [0]\n\nwhen I receive [delete objects v]\ndelete this clone\n\nwhen I start as a clone\nset [id v] to [bounce]\nset [ghost v] effect to (100)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nforever\n    switch costume to (idle v)\n    if <touching (player v)?> then\n        add [Bounce] to [_player moves v]\n        start sound [Big Boing v]\n        switch costume to (bounce v)\n        wait (0.2) seconds\n    end\nend\n\nbroadcast (jump v)\n\ndefine Spawn Trampolines\nset [brightness v] effect to (100)\nset size to ([size v] of [player v]) %\nif <(id) = [0]> then\n    if <(_LEVEL) = [3]> then\n        trampoline | X: [34] Y [-152]\n        trampoline | X: [-146] Y [-152]\n    else\n        if <(_LEVEL) = [4]> then\n            trampoline | X: [-40] Y [-110]\n        else\n            if <(_LEVEL) = [6]> then\n                trampoline | X: [110] Y [-94]\n                trampoline | X: [-148] Y [26]\n            else\n                if <(_LEVEL) = [8]> then\n                    trampoline | X: [2] Y [-8]\n                else\n                    if <(_LEVEL) = [10]> then\n                        trampoline | X: [-187] Y [58]\n                        trampoline | X: [-6] Y [-56]\n                        trampoline | X: [64] Y [-56]\n                    else\n                        if <(_LEVEL) = [11]> then\n                            trampoline | X: [-98] Y [-18]\n                        else\n                            if <(_LEVEL) = [12]> then\n                                trampoline | X: [-218] Y [-150]\n                                trampoline | X: [218] Y [-150]\n                            else\n                                if <(_LEVEL) = [13]> then\n                                    trampoline | X: [188] Y [-92]\n                                    trampoline | X: [-176] Y [-156]\n                                else\n                                    if <(_LEVEL) = [14]> then\n                                        trampoline | X: [-200] Y [-142]\n                                    else\n                                        if <(_LEVEL) = [16]> then\n                                            trampoline | X: [-30] Y [-150]\n                                        else\n                                            if <(_LEVEL) = [17]> then\n                                                trampoline | X: [200] Y [-126]\n                                            else\n                                                if <(_LEVEL) = [18]> then\n                                                    trampoline | X: [-196] Y [-26]\n                                                    trampoline | X: [148] Y [-150]\n                                                else\n                                                    if <(_LEVEL) = [22]> then\n                                                        trampoline | X: [150] Y [-155]\n                                                    else\n                                                        if <(_LEVEL) = [24]> then\n                                                            trampoline | X: [-68] Y [-77]\n                                                        else\n                                                            if <(_LEVEL) = [27]> then\n                                                                trampoline | X: [144] Y [-47]\n                                                                trampoline | X: [-155] Y [-151]\n                                                            else\n                                                                if <(_LEVEL) = [28]> then\n                                                                    trampoline | X: [187] Y [-149]\n                                                                    trampoline | X: [-19] Y [-42]\n                                                                else\n                                                                    if <(_LEVEL) = [30]> then\n                                                                        trampoline | X: [131] Y [-24]\n                                                                    else\n                                                                        if <(_LEVEL) = [34]> then\n                                                                            trampoline | X: [-201] Y [68]\n                                                                        else\n                                                                            if <(_LEVEL) = [35]> then\n                                                                                trampoline | X: [223] Y [-158]\n                                                                                trampoline | X: [188] Y [-25]\n                                                                            else\n                                                                                if <(_LEVEL) = [38]> then\n                                                                                    trampoline | X: [-80] Y [-138]\n                                                                                else\n                                                                                    if <(_LEVEL) = [40]> then\n                                                                                        trampoline | X: [-108] Y [-112]\n                                                                                        trampoline | X: [18] Y [-126]\n                                                                                        trampoline | X: [129] Y [-105]\n                                                                                    else\n                                                                                        if <(_LEVEL) = [44]> then\n                                                                                            trampoline | X: [-209] Y [39]\n                                                                                        else\n                                                                                            if <(_LEVEL) = [45]> then\n                                                                                                trampoline | X: [-220] Y [-168]\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    hide\nend\n\nwhen I receive [draw new level v]\nif <(id) > [0]> then\n    set [brightness v] effect to (100)\n    switch costume to (idle v)\n    show\nend\n\n@enemy\n\nwhen I receive [delete special objects v]\nset size to ([size v] of [player v]) %\nif <(id) = [0]> then\n    hide\n    if <(_LEVEL) = [31]> then\n        Enemy | X: [-96] Y [-152] Size: [100] Type: [1] Dir: [-90]\n        Enemy | X: [112] Y [-50] Size: [100] Type: [1] Dir: [90]\n        Enemy | X: [9] Y [48] Size: [100] Type: [1] Dir: [90]\n    else\n        if <(_LEVEL) = [32]> then\n            Enemy | X: [0] Y [25] Size: [100] Type: [1] Dir: [-90]\n            Enemy | X: [206] Y [-150] Size: [100] Type: [1] Dir: [-90]\n        else\n            if <(_LEVEL) = [33]> then\n                Enemy | X: [-142] Y [20] Size: [100] Type: [1] Dir: [90]\n                Enemy | X: [-122] Y [20] Size: [100] Type: [1] Dir: [90]\n                Enemy | X: [-102] Y [20] Size: [100] Type: [1] Dir: [90]\n            else\n                if <(_LEVEL) = [34]> then\n                    Enemy | X: [59] Y [-96] Size: [100] Type: [1] Dir: [90]\n                    Enemy | X: [-131] Y [-96] Size: [100] Type: [1] Dir: [90]\n                else\n                    if <(_LEVEL) = [35]> then\n                        Enemy | X: [77] Y [-26] Size: [100] Type: [1] Dir: [90]\n                        Enemy | X: [121] Y [-76] Size: [100] Type: [1] Dir: [-90]\n                        Enemy | X: [71] Y [-128] Size: [100] Type: [1] Dir: [90]\n                    else\n                        if <(_LEVEL) = [36]> then\n                            Enemy | X: [-67] Y [122] Size: [100] Type: [1] Dir: [90]\n                            Enemy | X: [35] Y [122] Size: [100] Type: [1] Dir: [-90]\n                        else\n                            if <(_LEVEL) = [39]> then\n                                Enemy | X: [3] Y [36] Size: [100] Type: [1] Dir: [90]\n                            else\n                                if <(_LEVEL) = [41]> then\n                                    Enemy | X: [-146] Y [86] Size: [100] Type: [1] Dir: [90]\n                                else\n                                    if <(_LEVEL) = [43]> then\n                                        Enemy | X: [-96] Y [-42] Size: [100] Type: [1] Dir: [90]\n                                    else\n                                        if <(_LEVEL) = [44]> then\n                                            Enemy | X: [-18] Y [19] Size: [100] Type: [1] Dir: [90]\n                                        else\n                                            if <(_LEVEL) = [45]> then\n                                                Enemy | X: [0] Y [-167] Size: [100] Type: [1] Dir: [90]\n                                                Enemy | X: [160] Y [-107] Size: [150] Type: [1] Dir: [90]\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Enemy | X: (x) Y (y) Size: (size) Type: (typ) Dir: (dir)\nset size to ((size) * (([size v] of [player v]) / (100))) %\nset [x v] to (x)\nset [y v] to (y)\nset [dir v] to (dir)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [id v] to [0]\n\nwhen I receive [delete special objects v]\ndelete this clone\n\nwhen I start as a clone\nDraw\nset [id v] to [enemy]\nset [ghost v] effect to (100)\nif <(costume [number v]) = [1]> then\n    go to [back v] layer\n    go [forward v] ((6) + (_PARTICLE COUNT)) layers\nend\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nset rotation style [left-right v]\nset [in air v] to [0]\nDraw\nset [in air v] to [999999]\nset [yv v] to [0]\nset [xv v] to [0]\nwait (0.1) seconds\nforever\n    switch costume to (hitbox v)\n    point in direction (dir)\n    if <(in air) = [0]> then\n        get IsSolid at X: ((x position) + ((((dir) / ([abs v] of (dir) )) * (15)) * ((size) / (100)))) Y ((y position) - ((15) * ((size) / (100))))\n        if <(is solid) = [0]> then\n            set [dir v] to ((0) - (dir))\n        end\n    end\n    Handle Movement Inputs\n    Controls [1]\n    change [in air v] by (1)\n    change [yv v] by (-1)\n    set [xv v] to ((xv) * (0.8))\n    Change X by (round ((xv) * (((size) - (1)) / (100))))\n    Change Y by (round ((yv) * (((size) - (1)) / (100))))\n    Draw\n    if <(___GAME MODE) = [1]> then\n        if <([abs v] of (((y position) + ((13) * ((size) / (100)))) - ([y position v] of [player v])) ) < ((20) * ((size) / (100)))> then\n            if <([abs v] of ((x position) - ([x position v] of [player v])) ) < ((20) * ((size) / (100)))> then\n                if <<([y position v] of [player v]) > ((y position) + ((13) * ((size) / (100))))> and <([in air v] of [player v]) > [0]>> then\n                    if <(username) = [purple-sparkle]> then\n                        start sound [Ya v]\n                    else\n                        start sound [Pluck v]\n                    end\n                    broadcast (enemy stomp v)\n                    switch costume to (chickensquish v)\n                    wait (0.05) seconds\n                    switch costume to (chickensquish2 v)\n                    wait (0.05) seconds\n                    switch costume to (chickensquish3 v)\n                    wait (0.05) seconds\n                    switch costume to (chickensquish2 v)\n                    wait (1.7) seconds\n                    switch costume to (chickensquish2 v)\n                    wait (0.05) seconds\n                    switch costume to (chickensquish3 v)\n                    wait (0.05) seconds\n                    switch costume to (chickensquish2 v)\n                    wait (0.05) seconds\n                    switch costume to (chickensquish v)\n                    wait (0.05) seconds\n                    switch costume to (chickenstand v)\n                else\n                    if <([abs v] of ((x position) - ([x position v] of [player v])) ) < ((9) * ((size) / (100)))> then\n                        Draw\n                        broadcast (DIE v)\n                        stop [this script v]\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine Change X by (x)\nif <touching (semi solid v)?> then\n    set [check semisolid v] to [0]\nelse\n    set [check semisolid v] to [1]\nend\nchange [x v] by (x)\nGet Solid\nrepeat (8)\n    if <(is solid) > [0]> then\n        change [y v] by (1)\n        Get Solid\n    else\n        stop [this script v]\n    end\nend\nset [check semisolid v] to [0]\nchange [y v] by (-8)\nGet Solid\nif <(is solid) > [0]> then\n    set [dir v] to ((0) - (dir))\n    set [xv v] to [0]\n    repeat (([abs v] of (x) ) + (1))\n        Get Solid\n        if <(is solid) > [0]> then\n            change [x v] by ((0) - ((x) / ([abs v] of (x) )))\n        else\n            stop [this script v]\n        end\n    end\nend\n\ndefine Change Y by (y)\nset [check semisolid v] to [0]\nif <touching (semi solid v)?> then\n    set [check semisolid v] to [0]\nelse\n    if <(y) < [0.01]> then\n        set [check semisolid v] to [1]\n    end\nend\nif <[moves v] contains [down]?> then\n    set [check semisolid v] to [0]\nend\nchange [y v] by (y)\nGet Solid\nif <(is solid) > [0]> then\n    set [yv v] to [0]\n    if <(y) < [0.01]> then\n        set [in air v] to [0]\n    end\n    repeat ([ceiling v] of ([abs v] of (y) ) )\n        if <(is solid) > [0]> then\n            change [y v] by ((0) - ((y) / ([ceiling v] of ([abs v] of (y) ) )))\n            Get Solid\n        else\n            stop [this script v]\n        end\n    end\nend\n\ndefine Controls (speed)\nif <[moves v] contains [right]?> then\n    point in direction (90)\n    change [xv v] by (speed)\nelse\n    if <[moves v] contains [left]?> then\n        point in direction (-90)\n        change [xv v] by ((0) - (speed))\n    end\nend\nif <<[moves v] contains [up]?> and <(in air) < [4]>> then\n    set [yv v] to [10]\nend\n\ndefine Get Solid\nPosition\nif <<<touching (level v)?> or <touching (doors v)?>> or <<<touching (semi solid v)?> and <(check semisolid) > [0]>> or <touching (platforms v)?>>> then\n    set [is solid v] to [1]\nelse\n    if <<(x) < [-242]> or <(x) > [242]>> then\n        set [is solid v] to [1]\n    else\n        set [is solid v] to [0]\n    end\nend\n\ndefine Position\ngo to x: (x) y: (y)\n\ndefine Handle Movement Inputs\ndelete all of [moves v]\nif <(dir) > [0]> then\n    add [right] to [moves v]\nend\nif <(dir) < [0]> then\n    add [left] to [moves v]\nend\n\ndefine get IsSolid at X: (x) Y (y)\nswitch costume to (point v)\ngo to x: (x) y: (y)\nif <<<touching (level v)?> or <touching (doors v)?>> or <<touching (semi solid v)?> or <touching (platforms v)?>>> then\n    set [is solid v] to [1]\nelse\n    if <<(x) < [-242]> or <(x) > [242]>> then\n        set [is solid v] to [1]\n    else\n        set [is solid v] to [0]\n    end\nend\nswitch costume to (hitbox v)\n\ndefine Draw\nswitch costume to (large v)\nPosition\nif <(in air) > [3]> then\n    switch costume to (((0) - (((yv) / ([abs v] of (yv) )) / (2))) + (3.5))\nelse\n    if <([abs v] of (xv) ) > [0]> then\n        switch costume to ([floor v] of ((((timer) * (8)) mod (2)) + (5)) )\n    else\n        switch costume to ([floor v] of ((((timer) * (4.35)) mod (2)) + (1)) )\n    end\nend\n\nwhen I receive [__stop processes v]\nstop [other scripts in sprite v]\n\n@Blades\n\nwhen I receive [begin v]\nset [brightness v] effect to (100)\nif <(id) = [0]> then\n    if <(_LEVEL) = [16]> then\n        Saw | X: [25] Y [-6] Size: [75] Type: [1] Speed []\n        Saw | X: [75] Y [-6] Size: [75] Type: [1] Speed []\n        Saw | X: [100] Y [-150] Size: [75] Type: [1] Speed []\n        Saw | X: [150] Y [-150] Size: [75] Type: [1] Speed []\n        Saw | X: [250] Y [-150] Size: [75] Type: [1] Speed []\n        Saw | X: [165] Y [74] Size: [75] Type: [1] Speed []\n    else\n        if <(_LEVEL) = [17]> then\n            Saw | X: [37] Y [-50] Size: [75] Type: [1] Speed []\n            Saw | X: [-171] Y [-150] Size: [100] Type: [1] Speed []\n        else\n            if <(_LEVEL) = [18]> then\n                Saw | X: [-168] Y [72] Size: [75] Type: [1] Speed []\n                Saw | X: [-223] Y [152] Size: [75] Type: [1] Speed []\n                Saw | X: [127] Y [16] Size: [75] Type: [1] Speed []\n            else\n                if <(_LEVEL) = [19]> then\n                    Saw | X: [-6] Y [-2] Size: [115] Type: [2] Speed [6]\n                    Saw | X: [-200] Y [-118] Size: [75] Type: [1] Speed []\n                else\n                    if <(_LEVEL) = [20]> then\n                        Saw | X: [-133] Y [-24] Size: [65] Type: [2] Speed []\n                        Saw | X: [133] Y [-24] Size: [65] Type: [2] Speed []\n                    else\n                        if <(_LEVEL) = [21]> then\n                            Saw | X: [27] Y [64] Size: [70] Type: [2] Speed []\n                            Saw | X: [17] Y [-120] Size: [75] Type: [1] Speed []\n                        else\n                            if <(_LEVEL) = [22]> then\n                                Saw | X: [7] Y [-86] Size: [85] Type: [2] Speed []\n                                Saw | X: [-160] Y [-116] Size: [75] Type: [1] Speed []\n                            else\n                                if <(_LEVEL) = [23]> then\n                                    Saw | X: [0] Y [4] Size: [103] Type: [2] Speed [2]\n                                    Saw | X: [0] Y [4] Size: [100] Type: [2] Speed [1]\n                                    Saw | X: [0] Y [4] Size: [100] Type: [2] Speed [0.4]\n                                else\n                                    if <(_LEVEL) = [24]> then\n                                        Saw | X: [-68] Y [-100] Size: [60] Type: [2] Speed [5]\n                                        Saw | X: [-158] Y [25] Size: [75] Type: [1] Speed []\n                                        Saw | X: [-239] Y [-35] Size: [75] Type: [1] Speed []\n                                        Saw | X: [-158] Y [-95] Size: [75] Type: [1] Speed []\n                                    else\n                                        if <(_LEVEL) = [25]> then\n                                            Saw | X: [-216] Y [51] Size: [75] Type: [2] Speed []\n                                            Saw | X: [120] Y [163] Size: [75] Type: [1] Speed []\n                                            Saw | X: [186] Y [-151] Size: [75] Type: [1] Speed []\n                                        else\n                                            if <(_LEVEL) = [26]> then\n                                                Saw | X: [34] Y [-143] Size: [75] Type: [2] Speed [-4]\n                                                Saw | X: [-218] Y [-151] Size: [75] Type: [1] Speed []\n                                            else\n                                                if <(_LEVEL) = [27]> then\n                                                    Saw | X: [-92] Y [47] Size: [75] Type: [2] Speed [-5]\n                                                    Saw | X: [68] Y [-151] Size: [75] Type: [1] Speed []\n                                                else\n                                                    if <(_LEVEL) = [28]> then\n                                                        Saw | X: [-212] Y [-87] Size: [75] Type: [2] Speed [6]\n                                                        Saw | X: [-20] Y [-53] Size: [75] Type: [2] Speed [-6]\n                                                        Saw | X: [156] Y [43] Size: [75] Type: [1] Speed []\n                                                    else\n                                                        if <(_LEVEL) = [29]> then\n                                                            Saw | X: [68] Y [23] Size: [55] Type: [2] Speed []\n                                                            Saw | X: [-84] Y [-105] Size: [75] Type: [1] Speed []\n                                                            Saw | X: [-84] Y [0] Size: [75] Type: [1] Speed []\n                                                        else\n                                                            if <(_LEVEL) = [30]> then\n                                                                Saw | X: [88] Y [96] Size: [55] Type: [2] Speed [-6]\n                                                                Saw | X: [-170] Y [-98] Size: [55] Type: [2] Speed [6]\n                                                            else\n                                                                if <(_LEVEL) = [31]> then\n                                                                    Saw | X: [202] Y [142] Size: [75] Type: [1] Speed []\n                                                                else\n                                                                    if <(_LEVEL) = [32]> then\n                                                                        Saw | X: [-165] Y [80] Size: [50] Type: [2] Speed [-8]\n                                                                    else\n                                                                        if <(_LEVEL) = [34]> then\n                                                                            Saw | X: [85] Y [101] Size: [50] Type: [2] Speed []\n                                                                        else\n                                                                            if <(_LEVEL) = [37]> then\n                                                                                Saw | X: [0] Y [110] Size: [85] Type: [2] Speed [5]\n                                                                                Saw | X: [0] Y [-83] Size: [50] Type: [2] Speed [-6.5]\n                                                                            else\n                                                                                if <(_LEVEL) = [39]> then\n                                                                                    Saw | X: [86] Y [121] Size: [100] Type: [1] Speed []\n                                                                                else\n                                                                                    if <(_LEVEL) = [41]> then\n                                                                                        Saw | X: [20] Y [47] Size: [55] Type: [2] Speed [3]\n                                                                                    else\n                                                                                        if <(_LEVEL) = [42]> then\n                                                                                            Saw | X: [-69] Y [-140] Size: [55] Type: [1] Speed []\n                                                                                        else\n                                                                                            if <(_LEVEL) = [43]> then\n                                                                                                Saw | X: [3] Y [94] Size: [55] Type: [1] Speed []\n                                                                                                Saw | X: [35] Y [58] Size: [55] Type: [1] Speed []\n                                                                                                Saw | X: [35] Y [28] Size: [55] Type: [1] Speed []\n                                                                                                Saw | X: [35] Y [0] Size: [55] Type: [1] Speed []\n                                                                                            else\n                                                                                                if <(_LEVEL) = [44]> then\n                                                                                                    Saw | X: [150] Y [-59] Size: [55] Type: [1] Speed []\n                                                                                                    Saw | X: [80] Y [-59] Size: [55] Type: [1] Speed []\n                                                                                                    Saw | X: [10] Y [-59] Size: [55] Type: [1] Speed []\n                                                                                                else\n                                                                                                    if <(_LEVEL) = [45]> then\n                                                                                                        Saw | X: [-181] Y [-116] Size: [55] Type: [2] Speed []\n                                                                                                        Saw | X: [-45] Y [65] Size: [55] Type: [1] Speed []\n                                                                                                        Saw | X: [151] Y [82] Size: [55] Type: [1] Speed []\n                                                                                                    end\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    hide\nend\n\ndefine Saw | X: (x) Y (y) Size: (size) Type: (typ) Speed (speed)\nswitch costume to (typ)\nset size to (size) %\ngo to x: (x) y: (y)\nset [y v] to (y)\nif <(speed) > []> then\n    set [speed v] to (speed)\nelse\n    set [speed v] to [7]\nend\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [id v] to [0]\ngo to [front v] layer\n\nwhen I receive [delete objects v]\ndelete this clone\n\nwhen I start as a clone\nset [id v] to [saw]\nset [brightness v] effect to (100)\nset [ghost v] effect to (100)\nif <(costume [number v]) = [1]> then\n    go to [back v] layer\n    go [forward v] ((1) + (_PARTICLE COUNT)) layers\nelse\n    go to [back v] layer\n    go [forward v] ((10) + (_PARTICLE COUNT)) layers\nend\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nif <(speed) > [0]> then\n    point in direction (90)\nelse\n    point in direction (-90)\nend\nforever\n    turn right (speed) degrees\nend\n\n@Platforms\n\nwhen I receive [spawn special objects v]\nset [brightness v] effect to (100)\nif <(id) = [0]> then\n    if <(_LEVEL) = [38]> then\n        Platform | X: [100] Y [72] Size: []\n        Platform | X: [-12] Y [64] Size: []\n        Platform | X: [-88] Y [110] Size: []\n        Platform | X: [-210] Y [16] Size: []\n        Platform | X: [-210] Y [86] Size: []\n        Platform | X: [-210] Y [-54] Size: []\n    else\n        if <(_LEVEL) = [39]> then\n            Platform | X: [137] Y [-92] Size: []\n        else\n            if <(_LEVEL) = [42]> then\n                Platform | X: [-125] Y [-120] Size: []\n                Platform | X: [-217] Y [-80] Size: []\n                Platform | X: [-125] Y [-40] Size: []\n                Platform | X: [-217] Y [0] Size: []\n                Platform | X: [-125] Y [40] Size: []\n                Platform | X: [-217] Y [80] Size: []\n                Platform | X: [185] Y [-120] Size: []\n                Platform | X: [75] Y [-80] Size: []\n                Platform | X: [185] Y [-40] Size: []\n                Platform | X: [75] Y [0] Size: []\n                Platform | X: [185] Y [40] Size: []\n                Platform | X: [75] Y [80] Size: []\n            else\n                if <(_LEVEL) = [43]> then\n                    Platform | X: [-85] Y [-50] Size: []\n                    Platform | X: [-85] Y [80] Size: []\n                else\n                    if <(_LEVEL) = [45]> then\n                        Platform | X: [25] Y [-34] Size: [75]\n                        Platform | X: [-18] Y [-66] Size: [95]\n                        Platform | X: [150] Y [139] Size: [95]\n                    end\n                end\n            end\n        end\n    end\n    hide\nend\n\ndefine Platform | X: (x) Y (y) Size: (size)\nif <(size) > []> then\n    set [size v] to (size)\nelse\n    set [size v] to [100]\nend\nset size to ((size) * (_PLAYER SIZE%)) %\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [id v] to [0]\n\nwhen I receive [delete special objects v]\ndelete this clone\n\nwhen I start as a clone\nset [id v] to [platform]\nset [ghost v] effect to (100)\nset [brightness v] effect to (100)\nswitch costume to (platform v)\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I start as a clone\nforever\n    switch costume to (platform v)\n    if <<([abs v] of (([x position v] of [player v]) - (x position)) ) < ((34) * ((size) / (100)))> and <([abs v] of (([y position v] of [player v]) - ((y position) + (3))) ) < ((25) * ((size) / (100)))>> then\n        set [pitch v] effect to (pick random (-10.00) to (10.00))\n        start sound [Glass Breaking v]\n        repeat (3)\n            repeat (4)\n            next costume\n        end\n        repeat (6)\n        hide\n        repeat (60)\n        set [ghost v] effect to (100)\n        switch costume to (platform v)\n        repair\n    end\nend\n\nshow\ngo to [front v] layer\ngo to (random position v)\n\nPlatform | X: [-18] Y [-66] Size: [75]\n\ndefine repair\nforever\n    show\n    if <not <touching (player v)?>> then\n        repeat (10)\n            change [ghost v] effect by (-10)\n        end\n        stop [this script v]\n    else\n        hide\n    end\nend\n\n@Particles\n\nwhen I receive [init particles v]\ndelete all of [_particle spawns v]\nset [layer v] to [0]\nset [_particle count v] to [0]\nset [id v] to []\nSpawn Initial Particles\nforever\n    go to (random position v)\n    set y to (-200)\n    set [id v] to [1]\n    create clone of (_myself_ v)\n    set [id v] to []\n    Spawn additional particles\nend\n\nwhen I start as a clone\nif <(id) = [1]> then\n    switch costume to (particle v)\n    set [layer v] to (pick random (1) to (4))\n    set [ghost v] to (((y position) + (200)) / (layer))\n    set size to ([ceiling v] of (((25) * (layer)) * (([size v] of [player v]) / (101))) ) %\n    show\n    go to [back v] layer\n    change [_particle count v] by (1)\n    repeat until <(ghost) > [99]>\n        change [ghost v] by ((2) / (layer))\n        set [ghost v] effect to ((85) + ((ghost) / (4)))\n        change y by ((layer) / (1.1))\n    end\n    change [_particle count v] by (-1)\n    delete this clone\nelse\n    set rotation style [all around v]\n    Point Towards | X: ([x position v] of [player v]) Y: ([y position v] of [player v])\n    set size to ((75) * (_PLAYER SIZE%)) %\n    switch costume to (particle2 v)\n    set [ghost v] effect to (50)\n    go to [front v] layer\n    go [backward v] (8) layers\n    show\n    repeat (25)\n        change [ghost v] effect by (2)\n        change size by ((-4) * (_PLAYER SIZE%))\n    end\n    delete this clone\nend\n\ndefine Spawn Initial Particles\nset [id v] to [1]\nrepeat (100)\n    go to (random position v)\n    create clone of (_myself_ v)\nend\nset [id v] to []\n\nwhen flag clicked\nhide\n\nwhen I receive [layer particles v]\nif <(layer) > [0]> then\n    show\n    go to [back v] layer\nelse\n    hide\nend\n\nwhen I receive [__end game v]\nhide\ndelete this clone\n\nwhen I receive [__stop processes v]\nstop [other scripts in sprite v]\n\ndefine Spawn additional particles\nrepeat ((length of [_particle spawns v]) / (3))\n    go to x: (item (1) of [_particle spawns v]) y: (item (2) of [_particle spawns v])\n    set [id v] to (item (3) of [_particle spawns v])\n    create clone of (_myself_ v)\n    set [id v] to []\n    repeat (3)\n        delete (1) of [_particle spawns v]\n    end\nend\ndelete all of [_particle spawns v]\n\ndefine Point Towards | X: (x) Y: (y)\npoint in direction (([atan v] of (((x) - (x position)) / ((y) - (y position))) ) + ((180) * <(y position) > (y)>))\n\nPoint Towards | X: [0] Y: [0]\n\n@Main Menu\n\nwhen I receive [_main menu v]\nif <(id) = []> then\n    switch backdrop to (menu v)\n    set [_level v] to [1]\n    broadcast (_START MUSIC v)\n    set [tile size v] to [33]\n    set [_menu offset x v] to [135]\n    set [_menu offset y v] to [0]\n    set [backdrop width v] to [610]\n    set [backdrop width v] to [480]\n    Clone | Type: [back] X: [0] Y: [0]\n    Clone | Type: [back] X: (backdrop width) Y: [0]\n    Clone | Type: [logo] X: [-90] Y: [60]\n    Clone | Type: [text] X: (_MENU OFFSET X) Y: [158]\n    Create Button Grid | Width: [5] Height: [9]\n    Clone | Type: [mello] X: [0] Y: [0]\n    Clone | Type: [play] X: [-40] Y: [-65]\nend\n\nClone | Type: [Mute Music] X: [-73] Y: [-135]\nClone | Type: [Sounds] X: [0] Y: [-135]\n\ndefine Create Button Grid | Width: (w) Height: (h)\nset [level button v] to [1]\nset [y v] to [0]\nset [_menu offset x v] to (((((0) - ((w) * (tile size))) + (tile size)) / (2)) + (_MENU OFFSET X))\nset [_menu offset y v] to (((0) - ((((0) - ((h) * (tile size))) + (tile size)) / (2))) + (_MENU OFFSET Y))\nset [id v] to [button]\nrepeat (h)\n    set [x v] to [0]\n    repeat (w)\n        create clone of (_myself_ v)\n        change [x v] by (1)\n        change [level button v] by (1)\n    end\n    change [y v] by (-1)\nend\nset [id v] to []\n\nwhen I start as a clone\nif <<(id) = [mello]> or <(id) = [back]>> then\n    set size to (100) %\nelse\n    set size to (20) %\nend\ngo to [front v] layer\nshow\nset [backdrop num v] to (pick random (1) to (3))\nrepeat until <(___GAME MODE) = [1]>\n    change size by (((100) - (size)) / (8))\n    go to x: (x) y: (y)\n    if <(id) = [button]> then\n        Tick Button\n    else\n        if <(id) = [logo]> then\n            Tick Logo\n        else\n            if <(id) = [play]> then\n                Tick Play Button\n            else\n                if <(id) = [back]> then\n                    Backdrop Tick\n                else\n                    if <(id) = [text]> then\n                        switch costume to (text v)\n                    else\n                        if <(id) = [mello]> then\n                            switch costume to ([floor v] of ((((timer) * (6.7)) mod (4)) + (2)) )\n                        else\n                            if <<(id) = [Mute Music]> or <(id) = [Sounds]>> then\n                                switch costume to (id)\n                                set y to ((y) + (([sin v] of ((timer) * (80)) ) * (8)))\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nfade out\n\nwhen flag clicked\nerase all\nset [id v] to []\nhide\n\ndefine Tick Button\nset x to (((x) * (tile size)) + (_MENU OFFSET X))\nset y to ((((y) * (tile size)) + ()) + (_MENU OFFSET Y))\nif <(level button) > (__UNLOCKED)> then\n    set [ghost v] effect to (25)\n    switch costume to ([floor v] of ((((level button) + (14)) / (15)) + (12)) )\nelse\n    set [ghost v] effect to (0)\n    switch costume to (mouse check v)\n    if <touching (mouse-pointer v)?> then\n        switch costume to (light v)\n        if <(mouse touch) = [0]> then\n            start sound [Wood Tap v]\n            set [pitch v] effect to (pick random (-20) to (20))\n        end\n        if <<<mouse down?> and <(mouse down) = [0]>> and <not <(level button) > (__UNLOCKED)>>> then\n            set [_level v] to (level button)\n            broadcast (_START GAME LOOP v)\n        end\n        set [mouse touch v] to [1]\n    else\n        switch costume to ([floor v] of ((((level button) + (14)) / (15)) + (9)) )\n        set [mouse touch v] to [0]\n    end\nend\nif <mouse down?> then\n    set [mouse down v] to [1]\nelse\n    set [mouse down v] to [0]\nend\n\ndefine Tick Logo\nswitch costume to (logo v)\nset y to ((y) + (([sin v] of ((timer) * (80)) ) * (11)))\n\ndefine Clone | Type: (id) X: (x) Y: (y)\nset [id v] to (id)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nset [id v] to []\n\ndefine Tick Play Button\nset y to ((y) + (([sin v] of ((timer) * (80)) ) * (8)))\nswitch costume to (play v)\nif <touching (mouse-pointer v)?> then\n    switch costume to (play2 v)\n    if <(mouse touch) = [0]> then\n        start sound [Wood Tap v]\n        set [pitch v] effect to (pick random (-20) to (20))\n    end\n    set [mouse touch v] to [1]\n    if <<mouse down?> and <(mouse down) = [0]>> then\n        set [_level v] to [1]\n        broadcast (_START GAME LOOP v)\n    end\nelse\n    set [mouse touch v] to [0]\nend\nif <mouse down?> then\n    set [mouse down v] to [1]\nelse\n    set [mouse down v] to [0]\nend\n\ndefine Backdrop Tick\nshow\nswitch costume to ((backdrop num) + (15))\nset [brightness v] effect to (30)\nchange [x v] by (-2)\nif <(x) < ((0) - (backdrop width))> then\n    set [x v] to (backdrop width)\n    set [backdrop num v] to (pick random (1) to (3))\nend\n\ndefine fade out\nwait (0.1) seconds\nrepeat (25)\n    go to [front v] layer\n    change [ghost v] effect by (4)\n    change [brightness v] effect by (4)\nend\nhide\ndelete this clone\n\nClone | Type: (join [funnytext] (pick random (1) to (44))) X: [-140] Y: [15]\n\n@Transition\n\nwhen I receive [__screen wipe v]\ngo to [front v] layer\nswitch costume to (transition v)\nset [ghost v] effect to (100)\ngo to x: (-500) y: (0)\nshow\nrepeat (25)\n    change [ghost v] effect by (-4)\n    change x by (20)\nend\nbroadcast (__finish screen wipe v)\n\nwhen I receive [__finish screen wipe v]\nif <(_LEVEL) > [45]> then\n    set [brightness v] effect to (100)\n    set [frame v] to [2]\n    set correct costume\n    set [ismousedown v] to [1]\n    repeat (10)\n        change [brightness v] effect by (-10)\n    end\n    repeat until <(frame) > [6]>\n        set correct costume\n        if <<mouse down?> or <key (any v) pressed?>> then\n            if <(ismousedown) = [0]> then\n                repeat (5)\n                    change [brightness v] effect by (20)\n                    set correct costume\n                end\n                change [frame v] by (1)\n                set correct costume\n                repeat (5)\n                    change [brightness v] effect by (-20)\n                    set correct costume\n                end\n            end\n            set [ismousedown v] to [1]\n        else\n            set [ismousedown v] to [0]\n        end\n    end\n    go to [back v] layer\n    repeat until <not <<mouse down?> or <key (any v) pressed?>>>\n        set correct costume\n    end\n    wait until <<mouse down?> or <key (any v) pressed?>>\n    repeat (5)\n        change [brightness v] effect by (20)\n    end\n    broadcast (__OUTRO v) and wait\nelse\n    go to [front v] layer\n    set [ghost v] effect to (0)\n    wait (0.3) seconds\n    repeat (25)\n        change [ghost v] effect by (4)\n        change x by (20)\n    end\n    hide\nend\n\nwhen flag clicked\nhide\n\ndefine set correct costume\nswitch costume to ([floor v] of ((((timer) * (2)) mod (2)) + (((frame) - (1)) * (2))) )\n\n@Mobile\n\nwhen I receive [_start joystick v]\nset [ghost v] effect to (40)\nset [id v] to [1]\nset size to (100) %\ncreate clone of (_myself_ v)\nset size to (120) %\nset [id v] to [2]\nPosition joystick\ncreate clone of (_myself_ v)\nswitch costume to (joystick v)\nforever\n    if <key (any v) pressed?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [__stop processes v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I start as a clone\npoint in direction (90)\nif <(id) = [1]> then\n    switch costume to (restart v)\nelse\n    switch costume to (controller v)\nend\nset [ghost v] effect to (100)\nshow\nrepeat (6)\n    change [ghost v] effect by (-10)\nend\nforever\n    if <(id) = [1]> then\n        repeat until <key (any v) pressed?>\n            operate as restart button\n        end\n        repeat (10)\n            change x by (-4)\n            change [ghost v] effect by (10)\n        end\n        wait until <<mouse down?> and <<(mouse x) < [-190]> and <(mouse y) > [95]>>>\n        set [ghost v] effect to (40)\n        repeat (10)\n            change x by (4)\n        end\n        repeat until <key (any v) pressed?>\n            operate as restart button\n        end\n    else\n        if <mouse down?> then\n            if <<touching (mouse-pointer v)?> and <(mouse down) = [0]>> then\n                repeat until <not <mouse down?>>\n                    if <key (any v) pressed?> then\n                        repeat (10)\n                            change [ghost v] effect by (10)\n                        end\n                        delete this clone\n                    end\n                    go to (mouse-pointer v)\n                    point towards (mobile v)\n                    if <(distance to [mobile v]) > ((8) * ((size) / (100)))> then\n                        if <<(direction) < [150]> and <(direction) > [20]>> then\n                            add [left] to [_player moves v]\n                        else\n                            if <<(direction) > [-150]> and <(direction) < [-20]>> then\n                                add [right] to [_player moves v]\n                            end\n                        end\n                        if <<(direction) < [50]> and <(direction) > [-50]>> then\n                            add [down] to [_player moves v]\n                        else\n                            if <<(direction) < [-122]> or <(direction) > [122]>> then\n                                add [up] to [_player moves v]\n                            end\n                        end\n                        if <(distance to [mobile v]) > ((20) * ((size) / (100)))> then\n                            move ((distance to [mobile v]) - ((20) * ((size) / (100)))) steps\n                        end\n                    end\n                end\n                Position joystick\n            else\n                set [mouse down v] to [1]\n            end\n        else\n            set [mouse down v] to [0]\n        end\n        if <key (any v) pressed?> then\n            repeat (10)\n                change [ghost v] effect by (10)\n            end\n            delete this clone\n        end\n    end\nend\n\ndefine Position joystick\ngo to x: (195) y: (-135)\n\nwhen I receive [_layer all v]\ngo to [back v] layer\ngo [forward v] (8) layers\nshow\n\ndefine operate as restart button\ngo to x: (-220) y: (153)\nset [ghost v] to (((0) - ((distance to [player v]) * (2))) + (100))\nif <(ghost) > [100]> then\n    set [ghost v] to [100]\nelse\n    if <(ghost) < [40]> then\n        set [ghost v] to [40]\n    end\nend\nset [ghost v] effect to (ghost)\nif <(distance to [mouse-pointer v]) < [35]> then\n    change size by (((120) - (size)) / (4))\n    if <<mouse down?> and <(mouse down) = [0]>> then\n        broadcast (_RESTART v) and wait\n        wait (0.5) seconds\n    end\nelse\n    change size by (((100) - (size)) / (4))\nend\nif <mouse down?> then\n    set [mouse down v] to [1]\nelse\n    set [mouse down v] to [0]\nend\n\n