Pixel Platformer


@Stage\n\nwhen flag clicked\nset [\(bg\) bgnum v] to [1]\nset [\(bg\) musicnum v] to [1]\nset [\(bg\) testing? v] to [false]\nset [\(settings\)volumemusic v] to [50]\nset [\(settings\)volumesound v] to [50]\nset [pixelate v] effect to (100)\nswitch backdrop to (forest v)\nstop all sounds\nset volume to (100) %\nwait (0.1) seconds\nforever\n    set volume to (\(Settings\)VolumeMusic) %\n    switch backdrop to (\(BG\) BGNum)\n    if <<key (t v) pressed?> and <(Game Mode) = [testing]>> then\n        if <(\(BG\) Testing?) = [true]> then\n            set [\(bg\) testing? v] to [false]\n            set [pixelate v] effect to (100)\n        else\n            set [\(bg\) testing? v] to [true]\n            set [\(bg\) bgnum v] to [9]\n            clear graphic effects\n        end\n        wait until <not <key (t v) pressed?>>\n    end\nend\n\nwhen flag clicked\nbroadcast (\(BG\)InitialiseAll v) and wait\nInitializeFPS\nforever\n    broadcast (\(BG\)DoFrameWork v) and wait\n    CalculateFPS\nend\n\ndefine InitializeFPS\nset [\(bg\)prevtime v] to (timer)\nset [\(bg\)framecount v] to [0]\nset [\(fps\) v] to [0]\n\ndefine CalculateFPS\nchange [\(bg\)framecount v] by (1)\nif <(timer) > ((\(BG\)PrevTime) + (1))> then\n    set [\(fps\) v] to (round ((\(BG\)FrameCount) / ((timer) - (\(BG\)PrevTime))))\n    set [\(bg\)prevtime v] to (timer)\n    set [\(bg\)framecount v] to [0]\nend\n\nwhen flag clicked\nwait (0.1) seconds\nforever\n    play sound (\(BG\) MusicNum) until done\nend\n\nwhen I receive [start v]\nforever\n    if <(\(BG\) Testing?) = [false]> then\n        if <<(Level) > [0]> and <(Level) < [6]>> then\n            set [\(bg\) bgnum v] to [1]\n            set [\(bg\) musicnum v] to [2]\n        end\n        if <<(Level) > [5]> and <(Level) < [11]>> then\n            set [\(bg\) bgnum v] to [2]\n            set [\(bg\) musicnum v] to [3]\n        end\n        if <<(Level) > [10]> and <(Level) < [16]>> then\n            set [\(bg\) bgnum v] to [3]\n            set [\(bg\) musicnum v] to [4]\n        end\n        if <<(Level) > [15]> and <(Level) < [21]>> then\n            set [\(bg\) bgnum v] to [4]\n            set [\(bg\) musicnum v] to [5]\n        end\n        if <<(Level) > [20]> and <(Level) < [26]>> then\n            set [\(bg\) bgnum v] to [5]\n            set [\(bg\) musicnum v] to [6]\n            change [color v] effect by (1)\n            set [pixelate v] effect to (pick random (100) to (100.1))\n        end\n        if <(Level) = [26]> then\n            set [\(bg\) bgnum v] to [6]\n            set [\(bg\) musicnum v] to [7]\n            set [pixelate v] effect to (100)\n            set [color v] effect to (0)\n        end\n        if <(Level) = [27]> then\n            set [\(bg\) bgnum v] to [7]\n            set [\(bg\) musicnum v] to [8]\n        end\n        if <(Level) = [28]> then\n            set [\(bg\) bgnum v] to [8]\n            set [\(bg\) musicnum v] to [9]\n        end\n        if <<(Level) > [28]> and <(Level) < [33]>> then\n            set [\(bg\) bgnum v] to [1]\n            set [\(bg\) musicnum v] to [10]\n        end\n    end\nend\n\nwhen I receive [start v]\nrepeat (25)\n    change volume by (-4)\nend\nstop all sounds\nwait (3) seconds\nrepeat (25)\n    change volume by (4)\nend\nwait until <<(Level) > [0]> and <(Level) < [6]>>\nstop all sounds\nwait until <<(Level) > [5]> and <(Level) < [11]>>\nstop all sounds\nwait until <<(Level) > [10]> and <(Level) < [16]>>\nstop all sounds\nwait until <<(Level) > [15]> and <(Level) < [21]>>\nstop all sounds\nwait until <<(Level) > [20]> and <(Level) < [26]>>\nstop all sounds\nwait until <(Level) = [26]>\nstop all sounds\nwait until <(Level) = [27]>\nstop all sounds\nwait until <(Level) = [28]>\nstop all sounds\n\n@Blank\n\n@Thumbnail\n\nwhen flag clicked\nswitch costume to (2.5_bitmap v)\nhide\nclear graphic effects\nset [ghost v] effect to (100)\nshow list [set portal binds v]\nset [thumbnail1 v] to [1]\nforever\n    broadcast (Tick v)\nend\n\nwhen I receive [wingame v]\nwait (1) seconds\nwait until <(Level) = [28]>\nswitch costume to (costume1 v)\nshow\nset [ghost v] effect to (100)\nwait (5) seconds\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (2.5) seconds\nbroadcast (Credits v)\nswitch costume to (2.5_bitmap v)\n\nhide list [blueportalparticle v]\n\nhide variable [mousepostion v]\nhide variable [mousegrid\(30x30\) v]\nhide variable [level v]\n\nwhen I receive [attack v]\n\nswitch costume to ( v)\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\nwait (2.5) seconds\nrepeat (10)\n    change [ghost v] effect by (5)\nend\nhide\n\nhide variable [\(player\)speed v]\nhide variable [\(player\)jumpheight v]\nhide variable [\(player\)gravity v]\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    show\n    if <<key (space v) pressed?> and <(username) = [01EXE]>> then\n        if <(Thumbnail1) = [2]> then\n            set [thumbnail1 v] to [1]\n            switch costume to (2.5_bitmap v)\n            clear graphic effects\n        else\n            set [ghost v] effect to (100)\n            set [thumbnail1 v] to [2]\n        end\n        wait (0.1) seconds\n    end\n    if <(Playing?) = [True]> then\n        if <(Game Mode) = [testing]> then\n            if <key (m v) pressed?> then\n                ask [Set Level To:] and wait\n                if <not <(answer) = []>> then\n                    set [level v] to (answer)\n                    stop all sounds\n                end\n            end\n            if <key (e v) pressed?> then\n                if <key (r v) pressed?> then\n                    hide variable [mousepostion v]\n                    hide variable [mousegrid\(30x30\) v]\n                    hide variable [level v]\n                    hide variable [\(fps\) v]\n                    show variable [xplayer v]\n                    show variable [yplayer v]\n                    show variable [\(player\)speed v]\n                    show variable [\(player\)jumpheight v]\n                    show variable [\(player\)gravity v]\n                else\n                    set [mousepostion v] to (join [\(] (join (mouse x) (join [, ] (join (mouse y) [\)]))))\n                    set [mousegrid\(30x30\) v] to (join [\(] (join ((round ((mouse x) / (30))) * (30)) (join [, ] (join ((round ((mouse y) / (30))) * (30)) [\)]))))\n                    show variable [mousepostion v]\n                    show variable [mousegrid\(30x30\) v]\n                    show variable [level v]\n                    show variable [\(fps\) v]\n                    hide variable [xplayer v]\n                    hide variable [yplayer v]\n                    hide variable [\(player\)speed v]\n                    hide variable [\(player\)jumpheight v]\n                    hide variable [\(player\)gravity v]\n                end\n            else\n                hide variable [mousepostion v]\n                hide variable [mousegrid\(30x30\) v]\n                hide variable [level v]\n                hide variable [\(fps\) v]\n                hide variable [xplayer v]\n                hide variable [yplayer v]\n                hide variable [\(player\)speed v]\n                hide variable [\(player\)jumpheight v]\n                hide variable [\(player\)gravity v]\n            end\n            if <key (b v) pressed?> then\n                hide list [set portal binds v]\n                add [1 - Blue Portal Particle \(sets the blue particle position\)] to [set portal binds v]\n                add [2 - Blue Portal Particle Direction \(sets the blue particle direction\)] to [set portal binds v]\n                add [3 - Orange Portal Particle \(sets the orange particle position] to [set portal binds v]\n                add [4 - Orange Portal Particle Direction \(sets the orange particle direction\)] to [set portal binds v]\n                add [5 - Portal Mechanics \(sets player movement upon portal teleportation\)] to [set portal binds v]\n                ask [] and wait\n                delete all of [set portal binds v]\n                show list [set portal binds v]\n                wait (0.5) seconds\n                if <(answer) = [1]> then\n                    ask (join [Set Blue Particle X-Position To] (join [ \(level - ] (join (Level) (join [, pos. - ] (join (item (Level) of [blueportalparticle v]) [\)]))))) and wait\n                    replace item (Level) of [blueportalparticle v] with (answer)\n                    ask (join [Set Blue Particle Y-Position To] (join [ \(level - ] (join (Level) (join [, pos. - ] (join (item ((Level) + (32)) of [blueportalparticle v]) [\)]))))) and wait\n                    replace item ((Level) + (32)) of [blueportalparticle v] with (answer)\n                else\n                    if <(answer) = [2]> then\n                        ask (join [Set Blue Particle Direction To] (join [ \(level - ] (join (Level) (join [, dir. - ] (join (item (Level) of [blueportalparticledirection v]) [\)]))))) and wait\n                        replace item (Level) of [blueportalparticledirection v] with (answer)\n                    else\n                        if <(answer) = [3]> then\n                            ask (join [Set Orange Particle X-Position To] (join [ \(level - ] (join (Level) (join [, pos. - ] (join (item (Level) of [orangeportalparticle v]) [\)]))))) and wait\n                            replace item (Level) of [orangeportalparticle v] with (answer)\n                            ask (join [Set Orange Particle Y-Position To] (join [ \(level - ] (join (Level) (join [, pos. - ] (join (item ((Level) + (32)) of [orangeportalparticle v]) [\)]))))) and wait\n                            replace item ((Level) + (32)) of [orangeportalparticle v] with (answer)\n                        else\n                            if <(answer) = [4]> then\n                                ask (join [Set Orange Particle Direction To] (join [ \(level - ] (join (Level) (join [, dir. - ] (join (item (Level) of [orangeportalparticledirection v]) [\)]))))) and wait\n                                replace item (Level) of [orangeportalparticledirection v] with (answer)\n                            else\n                                if <(answer) = [5]> then\n                                    ask (join [Set Portal Mechanics To] (join [ \(level - ] (join (Level) (join [, value - ] (join (item (Level) of [portalmechs v]) [\)]))))) and wait\n                                    replace item (Level) of [portalmechs v] with (answer)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        if <key (n v) pressed?> then\n            ask [This Stops The Entire Game, Are You Sure? Y|N] and wait\n            if <(letter (1) of (answer)) = [y]> then\n                stop [all v]\n            end\n        end\n    end\nend\n\n@Menu\n\nwhen flag clicked\nhide\nswitch costume to (main v)\ngo to [front v] layer\ngo [forward v] (1) layers\nclear graphic effects\nset size to (500) %\nset [menu v] to [Main]\nset [playing? v] to [False]\nset [tutorial? v] to [False]\nset [clone# v] to [0]\nhide variable [speedruntimer v]\nClone [9]\nshow\nif <(username) = [01EXE]> then\n    set [game mode v] to [testing]\nelse\n    set [game mode v] to [Normal]\nend\nrepeat until <(Playing?) = [True]>\n    switch costume to (Menu)\nend\nrepeat (25)\n    change [brightness v] effect by (-4)\nend\nrepeat (25)\n    change [ghost v] effect by (4)\nend\nhide\n\nwhen I start as a clone\nif <(Clone#) = [1]> then\n    set size to (1000) %\n    clear graphic effects\n    set [brightness v] effect to (10)\n    switch costume to (hologramofking v)\n    go to [front v] layer\n    repeat until <(Playing?) = [True]>\n        if <(Menu) = [Main]> then\n            show\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\nif <(Clone#) = [2]> then\n    switch costume to (tmbuttonntmp v)\n    go to [front v] layer\n    clear graphic effects\n    repeat until <(Playing?) = [True]>\n        if <(Menu) = [Main]> then\n            show\n            if <touching (mouse-pointer v)?> then\n                switch costume to (tmbuttontmp v)\n                if <mouse down?> then\n                    set [playing? v] to [True]\n                    start sound [Smack v]\n                end\n            else\n                switch costume to (tmbuttonntmp v)\n            end\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    broadcast (Start v)\n    delete this clone\nend\nif <(Clone#) = [4]> then\n    switch costume to (cbuttonntmp v)\n    show\n    go to [front v] layer\n    clear graphic effects\n    repeat until <(Playing?) = [True]>\n        if <(Menu) = [Main]> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (cbuttontmp v)\n                if <mouse down?> then\n                    set [menu v] to [Controls]\n                    start sound [Smack v]\n                end\n            else\n                switch costume to (cbuttonntmp v)\n            end\n            show\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\nif <(Clone#) = [5]> then\n    switch costume to (smbuttonntmp v)\n    go to [front v] layer\n    clear graphic effects\n    repeat until <(Playing?) = [True]>\n        if <(Menu) = [Main]> then\n            if <touching (mouse-pointer v)?> then\n                switch costume to (smbuttontmp v)\n                if <mouse down?> then\n                    set [menu v] to [SupportMe]\n                    start sound [Smack v]\n                end\n            else\n                switch costume to (smbuttonntmp v)\n            end\n            show\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\nif <(Clone#) = [7]> then\n    switch costume to (bbuttonntmp v)\n    go to [front v] layer\n    clear graphic effects\n    repeat until <(Playing?) = [True]>\n        if <not <(Menu) = [Main]>> then\n            show\n            if <touching (mouse-pointer v)?> then\n                switch costume to (bbuttontmp v)\n                if <mouse down?> then\n                    wait until <not <mouse down?>>\n                    if <not <(Menu) = [Main]>> then\n                        set [menu v] to [Main]\n                        start sound [Smack v]\n                        hide\n                    end\n                end\n            else\n                switch costume to (bbuttonntmp v)\n            end\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    delete this clone\nend\nif <(Clone#) = [8]> then\n    switch costume to (tbuttonntmp v)\n    go to [front v] layer\n    clear graphic effects\n    repeat until <(Playing?) = [True]>\n        if <(Menu) = [Main]> then\n            show\n            if <touching (mouse-pointer v)?> then\n                switch costume to (tbuttontmp v)\n                if <mouse down?> then\n                    set [playing? v] to [True]\n                    set [tutorial? v] to [True]\n                    start sound [Smack v]\n                end\n            else\n                switch costume to (tbuttonntmp v)\n            end\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    broadcast (Start v)\n    delete this clone\nend\nif <(Clone#) = [9]> then\n    switch costume to (srbuttonntmp v)\n    go to [front v] layer\n    clear graphic effects\n    repeat until <(Playing?) = [True]>\n        if <(Menu) = [Main]> then\n            show\n            if <touching (mouse-pointer v)?> then\n                switch costume to (srbuttontmp v)\n                if <mouse down?> then\n                    set [playing? v] to [True]\n                    set [game mode v] to [Speedrun]\n                    start sound [Smack v]\n                end\n            else\n                switch costume to (srbuttonntmp v)\n            end\n        else\n            hide\n        end\n    end\n    repeat (25)\n        change [ghost v] effect by (4)\n    end\n    broadcast (Speedrun v)\n    broadcast (Start v)\n    delete this clone\nend\n\ndefine Clone (cloneamount)\nrepeat (cloneamount)\n    change [clone# v] by (1)\n    create clone of (_myself_ v)\nend\n\nwhen I receive [speedrun v]\nreset timer\nshow variable [speedruntimer v]\nif <(Game Mode) = [Speedrun]> then\n    show variable [speedruntimer v]\n    repeat until <not <(XVel) = [0]>>\n        reset timer\n        set [speedruntimer v] to [0]\n    end\n    repeat until <(Level) = [28]>\n        set [speedruntimer v] to (timer)\n    end\nelse\n    hide variable [speedruntimer v]\nend\n\n@Settings\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [\(settings\)graphics v] to [2]\nhide\nset [clone# v] to [0]\nwait until <(Playing?) = [True]>\nrepeat (5)\n    change [clone# v] by (1)\n    create clone of (_myself_ v)\nend\nshow\nswitch costume to (settings v)\ngo to [back v] layer\ngo [forward v] (7) layers\nset size to (500) %\nset [\(settings\) v] to [1]\n\nwhen I start as a clone\nif <(Clone#) = [1]> then\n    go to [front v] layer\n    go [backward v] (1) layers\n    hide\n    set size to (375) %\n    forever\n        switch costume to (settingsbackground v)\n        if <(\(Settings\)) = [2]> then\n            show\n        else\n            hide\n        end\n    end\nend\nif <(Clone#) = [2]> then\n    go to [front v] layer\n    go to x: (0) y: (102.5)\n    switch costume to (settingsslider v)\n    hide\n    set size to (250) %\n    forever\n        if <(\(Settings\)) = [2]> then\n            show\n            set y to (102.5)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                repeat until <not <mouse down?>>\n                    set x to (mouse x)\n                    set [\(settings\)volumesound v] to ((x position) + (50))\n                    if <(x position) > [50]> then\n                        set x to (50)\n                        set [\(settings\)volumesound v] to [100]\n                    end\n                    if <(x position) < [-50]> then\n                        set x to (-50)\n                        set [\(settings\)volumesound v] to [0]\n                    end\n                end\n            end\n            if <(\(Settings\)) = [2]> then\n                show\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\nif <(Clone#) = [3]> then\n    go to [front v] layer\n    go to x: (0) y: (27.5)\n    switch costume to (settingsslider v)\n    hide\n    set size to (250) %\n    forever\n        if <(\(Settings\)) = [2]> then\n            show\n            set y to (27.5)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                repeat until <not <mouse down?>>\n                    set x to (mouse x)\n                    set [\(settings\)volumemusic v] to ((x position) + (50))\n                    if <(x position) > [50]> then\n                        set x to (50)\n                        set [\(settings\)volumemusic v] to [100]\n                    end\n                    if <(x position) < [-50]> then\n                        set x to (-50)\n                        set [\(settings\)volumemusic v] to [0]\n                    end\n                end\n            end\n        else\n            hide\n        end\n    end\nend\nif <(Clone#) = [4]> then\n    go to [front v] layer\n    go to x: (50) y: (-47.5)\n    switch costume to (settingsslider v)\n    hide\n    set size to (250) %\n    forever\n        if <(\(Settings\)) = [2]> then\n            show\n            set y to (-47.5)\n            if <<touching (mouse-pointer v)?> and <mouse down?>> then\n                repeat until <not <mouse down?>>\n                    if <(mouse x) > [1]> then\n                        set x to (50)\n                        set [\(settings\)graphics v] to [2]\n                    end\n                    if <(mouse x) < [-1]> then\n                        set x to (-50)\n                        set [\(settings\)graphics v] to [1]\n                    end\n                end\n            end\n        else\n            hide\n        end\n    end\nend\nif <(Clone#) = [5]> then\n    go to [front v] layer\n    go to x: (0) y: (0)\n    switch costume to (testingbuttonnormal v)\n    hide\n    set size to (500) %\n    forever\n        switch costume to (join [TestingButton] (Game Mode))\n        if <<(\(Settings\)) = [2]> and <not <(Game Mode) = [Speedrun]>>> then\n            show\n            if <touching (mouse-pointer v)?> then\n                if <mouse down?> then\n                    if <(Game Mode) = [normal]> then\n                        set [game mode v] to [testing]\n                        switch costume to (testingbuttontesting v)\n                    else\n                        set [game mode v] to [normal]\n                        switch costume to (testingbuttonnormal v)\n                    end\n                    wait until <not <mouse down?>>\n                end\n            end\n        else\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    wait (0.1) seconds\n    if <(Playing?) = [True]> then\n        set volume to (\(Settings\)VolumeSound) %\n        if <<(Level) = [27]> or <(Level) = [28]>> then\n            go to x: (250) y: (180)\n            hide\n            switch costume to (settings v)\n        end\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            wait until <not <mouse down?>>\n            start sound [ v]\n            if <(\(Settings\)) = [1]> then\n                set [\(settings\) v] to [2]\n                go to [front v] layer\n                switch costume to (back v)\n            else\n                set [\(settings\) v] to [1]\n                switch costume to (settings v)\n                go to [front v] layer\n            end\n        end\n    end\nend\n\n@Player\n\ndefine Platform Gravity: (gravity) Jump Height: (jump height) Movement Speed: (side movement speed) Friction: (friction) Slopes: (slope)\nchange [yvel v] by (gravity)\nchange y by (YVel)\nif <<touching (level v)?> or <touching (invisiblecollision v)?>> then\n    repeat until <not <<touching (level v)?> or <touching (invisiblecollision v)?>>>\n        change y by ((([abs v] of (YVel) ) / (YVel)) * (-1))\n    end\n    set [yvel v] to (<<<key (w v) pressed?> or <key (up arrow v) pressed?>> and <(([abs v] of (YVel) ) / (YVel)) = [-1]>> * (jump height))\nend\nset [xvel v] to (((XVel) + ((<<key (a v) pressed?> or <key (left arrow v) pressed?>> * ((side movement speed) * (-1))) + (<<key (d v) pressed?> or <key (right arrow v) pressed?>> * (side movement speed)))) * (friction))\nchange x by (XVel)\nset [slope v] to [0]\nrepeat until <<(Slope) = ((slope) * (-1))> or <not <<touching (level v)?> or <touching (invisiblecollision v)?>>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <<touching (level v)?> or <touching (invisiblecollision v)?>> then\n    change y by (Slope)\n    repeat until <not <<touching (level v)?> or <touching (invisiblecollision v)?>>>\n        change x by ((([abs v] of (XVel) ) / (XVel)) * (-1))\n    end\nend\n\nwhen I start as a clone\nset size to (749) %\nset [ghost v] effect to (50)\nrepeat (13)\n    change size by (-50)\nend\ndelete this clone\n\ndefine AssemblePlatform (speed) (jumpheight) (gravity)\nset [\(player\)speed v] to (speed)\nset [\(player\)jumpheight v] to (jumpheight)\nset [\(player\)gravity v] to (gravity)\n\nwhen flag clicked\ngo to x: (-180) y: (-100)\nswitch costume to (playerright v)\n\nAssemblePlatform [3.5] [12.5] [-1]\n\nif <(Level) = [1]> then\n    go to x: (-180) y: (-100)\nelse\n    go to x: (-220) y: (-130)\nend\n\nhide\n\nshow\n\nif <(Level) = [1]> then\n    go to x: (-180) y: (-100)\nend\n\nwhen I receive [start v]\ngo to x: (-180) y: (-100)\ngo to [back v] layer\ngo [forward v] (1) layers\nswitch costume to (playerright v)\nshow\nset [xvel v] to [0]\nset [yvel v] to [0]\nAssemblePlatform [3.5] [12.5] [-1]\nif <(Tutorial?) = [True]> then\n    set [level v] to [29]\nend\n\nwhen I receive [start v]\nforever\n    if <<(\(Settings\)) = [1]> and <(size) = [750]>> then\n        if <touching (orb v)?> then\n            if <(Level) = [32]> then\n                go to x: (-220) y: (-130)\n                switch costume to (playerright v)\n                go to [back v] layer\n                start sound [Orb v]\n                broadcast (NewLevel v)\n                set [level v] to [1]\n                set [xvel v] to [0]\n                set [yvel v] to [0]\n            else\n                go to x: (-220) y: (-130)\n                switch costume to (playerright v)\n                go to [back v] layer\n                start sound [Orb v]\n                broadcast (NewLevel v)\n                change [level v] by (1)\n                set [xvel v] to [0]\n                set [yvel v] to [0]\n                if <(Level) = [27]> then\n                    AssemblePlatform [3.5] [12.5] [-1]\n                end\n            end\n        end\n        if <<touching (spikes v)?> or <touching (lasers v)?>> then\n            if <touching (lasers v)?> then\n                set [ghost v] effect to (100)\n                start sound [Spikes v]\n                add [hurt] to [laserpositions v]\n                wait until <not < (laserpositions) contains [0]?>>\n                wait (0.1) seconds\n                delete (item # of [hurt] in [laserpositions v]) of [laserpositions v]\n                go to x: (-220) y: (-130)\n                switch costume to (playerright v)\n                repeat (10)\n                    change [ghost v] effect by (-10)\n                end\n            else\n                if <(Level) = [1]> then\n                    go to x: (-180) y: (-100)\n                else\n                    go to x: (-220) y: (-130)\n                end\n                switch costume to (playerhurt v)\n                wait (0.1) seconds\n                switch costume to (playerright v)\n                start sound [Spikes v]\n                set [xvel v] to [0]\n                set [yvel v] to [0]\n            end\n        end\n        if <touching (trampoline v)?> then\n            start sound [Trampoline v]\n            set [yvel v] to [20]\n            wait (0.05) seconds\n        end\n        if <touching (supoline v)?> then\n            start sound [Supoline v]\n            set [yvel v] to [25]\n            wait (0.05) seconds\n        end\n        if <touching (pusholine v)?> then\n            start sound [Trampoline v]\n            change [xvel v] by (Direction)\n        end\n        if <(Level) = [13]> then\n            set [direction v] to [-100]\n        end\n        if <(Level) = [20]> then\n            set [direction v] to [-100]\n        end\n        if <(Level) = [26]> then\n            set [direction v] to [100]\n        end\n        if <<touching (portalblue v)?> and <<touching color (#3b69d3)?> or <touching color (#386ccc)?>>> then\n            go to (portalorange v)\n            start sound [Portal v]\n            set [xvel v] to ((letter (1) of (item ((Level) + (32)) of [portalmechs v])) * (10))\n            set [yvel v] to ((letter (2) of (item ((Level) + (32)) of [portalmechs v])) * (10))\n            if < (item ((Level) + (32)) of [portalmechs v]) contains [-]?> then\n                set [xvel v] to ((XVel) * (-1))\n                set [yvel v] to ((YVel) * (-1))\n            end\n        end\n        if <<touching (portalorange v)?> and <touching color (#ff8f47)?>> then\n            go to (portalblue v)\n            start sound [Portal v]\n            set [xvel v] to ((letter (1) of (item (Level) of [portalmechs v])) * (10))\n            set [yvel v] to ((letter (2) of (item (Level) of [portalmechs v])) * (10))\n            if < (item (Level) of [portalmechs v]) contains [-]?> then\n                set [xvel v] to ((XVel) * (-1))\n                set [yvel v] to ((YVel) * (-1))\n            end\n        end\n        if <<touching (desertportal v)?> and <touching color (#ffe500)?>> then\n            go to x: (-220) y: (-130)\n            switch costume to (playerright v)\n            go to [back v] layer\n            wait (0.1) seconds\n            start sound [Portal v]\n            change [level v] by (1)\n        end\n        if <<touching (arcticportal v)?> and <touching color (#e6ffff)?>> then\n            go to x: (-220) y: (-130)\n            switch costume to (playerright v)\n            go to [back v] layer\n            wait (0.1) seconds\n            start sound [Portal v]\n            change [level v] by (1)\n        end\n        if <<touching (spaceportal v)?> and <touching color (#400080)?>> then\n            go to x: (-220) y: (-130)\n            switch costume to (playerright v)\n            go to [back v] layer\n            AssemblePlatform [2] [12.5] [-0.5]\n            wait (0.1) seconds\n            start sound [Portal v]\n            change [level v] by (1)\n        end\n        if <<touching (glitchedportal v)?> and <touching color (#ff0017)?>> then\n            go to x: (-220) y: (-130)\n            switch costume to (playerright v)\n            go to [back v] layer\n            AssemblePlatform [3] [10] [-0.75]\n            wait (0.1) seconds\n            start sound [Portal v]\n            change [level v] by (1)\n        end\n        if <<touching (oceanportal v)?> and <touching color (#00b0f8)?>> then\n            go to x: (-220) y: (-130)\n            switch costume to (playerright v)\n            go to [back v] layer\n            AssemblePlatform [2] [10] [-0.75]\n            wait (0.1) seconds\n            start sound [Portal v]\n            change [level v] by (1)\n            if <(y position) > [177]> then\n                set y to (160)\n            end\n            if <(x position) > [232]> then\n                set x to (215)\n            end\n        end\n    end\nend\n\nwhen I receive [tick v]\nif <<(\(Settings\)) = [1]> and <(size) = [750]>> then\n    Platform Gravity: (\(Player\)Gravity) Jump Height: (\(Player\)JumpHeight) Movement Speed: (\(Player\)Speed) Friction: [0.7] Slopes: [8]\nend\n\nwhen flag clicked\nforever\n    if <<(\(Settings\)Graphics) = [2]> and <not < (laserpositions) contains [hurt]?>>> then\n        create clone of (_myself_ v)\n        wait (0) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(size) = [750]> then\n        set volume to (\(Settings\)VolumeSound) %\n        if <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n            switch costume to (playerleft v)\n        end\n        if <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n            switch costume to (playerright v)\n        end\n        if <(Game Mode) = [testing]> then\n            if <key (q v) pressed?> then\n                set x to (mouse x)\n                set y to (mouse y)\n                go to [back v] layer\n            end\n        end\n        set [xplayer v] to (x position)\n        set [yplayer v] to (y position)\n    end\nend\n\n@King\n\nwhen flag clicked\nshow\nset [\(king\)score v] to [0]\nset [kingclone v] to [0]\nset [orbking v] to [0]\nset [kingpower v] to [0]\nset [ghost v] effect to (100)\nset [brightness v] effect to (-100)\ngo to x: (0) y: (50)\nwait (1) seconds\nwait until <(Level) = [27]>\nswitch costume to (king v)\nrepeat (9)\n    change [kingclone v] by (1)\n    create clone of (_myself_ v)\nend\nwait (5) seconds\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nwait (1) seconds\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nTalk\n\nwhen I start as a clone\nif <(KingClone) = [1]> then\n    hide\n    go to [front v] layer\n    set size to (500) %\n    go to x: (0) y: (160)\n    switch costume to (bar_0 v)\n    clear graphic effects\n    wait (23.1) seconds\n    show\n    repeat until <(\(King\)Score) > [4]>\n        if <not <(\(King\)Score) = (letter (5) of (costume [name v]))>> then\n            Costume (join [Bar_] (\(King\)Score))\n        end\n    end\n    Costume (join [Bar_] (\(King\)Score))\n    wait (6) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\nif <(KingClone) = [2]> then\n    set [kingpower v] to [3]\n    hide\n    go to [front v] layer\n    set size to (500) %\n    go to x: (0) y: (140)\n    switch costume to (bar2_3 v)\n    clear graphic effects\n    wait (23) seconds\n    show\n    wait (10) seconds\n    repeat until <(\(King\)Score) > [4]>\n        if <(length of [laserpositions v]) = [1]> then\n            if < (laserpositions) contains [hurt]?> then\n                if <(KingPower) > [2]> then\n                    set [kingpower v] to [3]\n                end\n                if <(KingPower) < [3]> then\n                    change [kingpower v] by (1)\n                    Costume (join [Bar2_] (KingPower))\n                end\n            else\n                change [kingpower v] by (-1)\n                Costume (join [Bar2_] (KingPower))\n            end\n            wait (1) seconds\n            if <(KingPower) < [1]> then\n                wait (5) seconds\n                if <not <(\(King\)Score) > [4]>> then\n                    set [kingpower v] to [3]\n                    Costume (join [Bar2_] (KingPower))\n                end\n            end\n        end\n    end\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\nif <<(KingClone) > [2]> and <(KingClone) < [10]>> then\n    set [kingindicatorpos v] to (KingClone)\n    hide\n    go to [front v] layer\n    set size to (250) %\n    go to x: (0) y: (-120)\n    switch costume to (indicator v)\n    clear graphic effects\n    wait (20) seconds\n    show\n    wait (2) seconds\n    repeat until <(\(King\)Score) > [4]>\n        if <(length of [laserpositions v]) = [0]> then\n            wait (0.4) seconds\n            repeat until <(x position) = (item ((kingindicatorpos) - (2)) of [laserpositions v])>\n                change x by (((item ((kingindicatorpos) - (2)) of [laserpositions v]) - (x position)) * (0.1))\n                if <(\(King\)Score) > [4]> then\n                    wait (1) seconds\n                    repeat (20)\n                        change [ghost v] effect by (5)\n                    end\n                    delete this clone\n                end\n            end\n        end\n    end\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\ndefine Talk\nTalk [Who dare comes to my castle!] [2] [0]\nTalk [I am the king of all the lands!] [2] [0]\nbroadcast (King v)\nTalk [Who's this?] [1] [0]\nTalk [Intruder!] [1] [0]\nTalk [Send in the laser beams!] [2] [0]\nset [\(king\)score v] to [0]\nbroadcast (Attack v)\nwait (2.5) seconds\nrepeat until <(\(King\)Score) > [4]>\n    if <(\(King\)Score) > [2]> then\n        set [color v] effect to (50)\n        set [brightness v] effect to ((\(King\)Score) * (10))\n    end\n    if <touching (orb_2 v)?> then\n        Costume [King]\n    end\nend\nsay [My Powers...] for (2) seconds\nsay [They Are Frozen!] for (2) seconds\nsay [Nooo!] for (2) seconds\nset [orbking v] to [1]\nwait until <not <(Level) = [27]>>\nhide\nbroadcast (WinGame v)\n\ndefine Talk (text) (duration) (speed)\nset [letter v] to [0]\nset [speak v] to []\nrepeat (length of (text))\n    change [letter v] by (1)\n    set [speak v] to (join (Speak) (letter (Letter) of (text)))\n    say (Speak)\n    wait (speed) seconds\nend\nsay (Speak) for (duration) seconds\n\ndefine Costume (#)\nswitch costume to (#)\nchange x by (1)\nchange y by (1)\nwait (0.1) seconds\nchange x by (-2)\nchange y by (-2)\nwait (0.1) seconds\nchange x by (1)\nchange y by (1)\nwait (0.1) seconds\n\nrepeat (10)\n\n@Lasers\n\nwhen flag clicked\nhide\ndelete all of [laserpositions v]\nforever\n    set volume to (\(Settings\)VolumeSound) %\nend\n\nwhen I receive [attack v]\nstart sound [Horn v]\nset [\(king\)score v] to [0]\nwait (5) seconds\nrepeat until <(\(King\)Score) > [4]>\n    wait until <(length of [laserpositions v]) = [0]>\n    wait (0.1) seconds\n    if <(KingPower) > [0]> then\n        repeat (7)\n            create clone of (_myself_ v)\n        end\n    end\nend\nwait until <(Level) = [28]>\nstop all sounds\n\nwhen I start as a clone\nset volume to (\(Settings\)VolumeSound) %\nstart sound [Pop v]\nshow\nset x to (pick random (-210) to (210))\nset [ghost v] effect to (100)\nif <(x position) > [0]> then\n    go to x: (((round ((x position) / (60))) * (60)) + (30)) y: (500)\nelse\n    go to x: (((round ((x position) / (60))) * (60)) - (30)) y: (500)\nend\nif <touching ((join [Las] [ers]) v)?> then\n    recorrect\nend\nadd (x position) to [laserpositions v]\nset [color v] effect to (pick random (1) to (200))\nwait (2) seconds\nforever\n    change y by (((-150) - (y position)) * (0.2))\n    change [ghost v] effect by (((-100) - ((y position) + (50))) * (0.1))\n    set volume to (\(Settings\)VolumeSound) %\n    if <(y position) < [-149]> then\n        wait (1) seconds\n        delete (item # of (x position) in [laserpositions v]) of [laserpositions v]\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        delete this clone\n    end\nend\n\ndelete this clone\n\nstart sound [Smack v]\n\nif <(\(King\)Score) > [49]> then\n    repeat (5)\n        change [ghost v] effect by (20)\n    end\n    delete this clone\nend\n\nwait (1) seconds\n\ndefine recorrect\nrepeat until <not <touching ((join [Las] [ers]) v)?>>\n    set x to (pick random (-210) to (210))\n    if <(x position) > [0]> then\n        go to x: (((round ((x position) / (60))) * (60)) + (30)) y: (500)\n    else\n        go to x: (((round ((x position) / (60))) * (60)) - (30)) y: (500)\n    end\nend\n\ndelete all of [laserpositions v]\n\ndelete (1) of [blueportalparticle v]\n\nwait (0.1) seconds\ndelete this clone\n\nadd [hurt] to [laserpositions v]\n\n\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (level1 v)\nset [ghost v] effect to (100)\nshow\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\n@NoColObj\n\nwhen flag clicked\nwait (1) seconds\nset size to (750) %\nclear graphic effects\ngo to [front v] layer\ngo [backward v] (25) layers\nforever\n    if <<(Level) > [20]> and <(Level) < [26]>> then\n        repeat until <<(Level) > [25]> or <(Level) < [21]>>\n            set [pixelate v] effect to (pick random (1) to (5))\n        end\n        clear graphic effects\n    end\nend\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\n@Spikes\n\nwhen flag clicked\npoint in direction (90)\nshow\nclear graphic effects\nforever\n    if <not <<(Level) > [16]> and <(Level) < [21]>>> then\n        go to x: (0) y: (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Level) > [16]> and <(Level) < [21]>> then\n        repeat until <not <<(Level) > [16]> and <(Level) < [21]>>>\n            go to x: (0) y: (-4)\n            wait (1) seconds\n            start sound [Boom v]\n            repeat (5)\n                change y by (3.8)\n            end\n            go to x: (0) y: (15)\n            wait (1) seconds\n            start sound [Boom v]\n            repeat (5)\n                change y by (-3.8)\n            end\n            go to x: (0) y: (-4)\n        end\n    end\n    if <<(Level) > [20]> and <(Level) < [26]>> then\n        repeat until <not <<(Level) > [20]> and <(Level) < [26]>>>\n            set [pixelate v] effect to (pick random (1) to (5))\n        end\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(Level) > [16]> and <(Level) < [21]>> then\n        set volume to (\(Settings\)VolumeSound) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [\(spikes\)1 v]\nwait until <(Level) = [21]>\nrepeat until <(Level) = [26]>\n    wait (1) seconds\n    set [color v] effect to (pick random (1) to (100))\nend\nclear graphic effects\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\n@InvisibleCollision\n\nwhen flag clicked\ngo to x: (0) y: (0)\nclear graphic effects\nset [ghost v] effect to (100)\n\n@Shadows\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nset [ghost v] effect to (50)\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\n@Orb\n\nwhen flag clicked\nshow\nset [level v] to [1]\nset rotation style [all around v]\ngo to [back v] layer\nforever\n    if <(\(Settings\)Graphics) = [2]> then\n        next costume\n        turn right (15) degrees\n        wait (0.001) seconds\n    else\n        next costume\n        turn right (15) degrees\n        wait (0.001) seconds\n    end\nend\n\nwhen flag clicked\nshow\nwait until <(Playing?) = [True]>\nreplace item (91) of [orb pos v] with [1]\nforever\n    set volume to (\(Settings\)VolumeSound) %\n    go to x: (item (Level) of [orb pos v]) y: (item ((Level) + (32)) of [orb pos v])\n    if <(item ((Level) + (64)) of [orb pos v]) = [1]> then\n        hide\n    else\n        show\n    end\n    if <<<(Level) = [27]> and <(\(King\)Score) > [4]>> and <(item (91) of [orb pos v]) = [1]>> then\n        wait (7) seconds\n        replace item (91) of [orb pos v] with []\n    end\n    if <(Game Mode) = [testing]> then\n        if <<touching (mouse-pointer v)?> and <mouse down?>> then\n            repeat until <not <mouse down?>>\n                go to (mouse-pointer v)\n                replace item (Level) of [orb pos v] with (x position)\n                replace item ((Level) + (32)) of [orb pos v] with (y position)\n            end\n        end\n        if <key (l v) pressed?> then\n            if <(item ((Level) + (64)) of [orb pos v]) = [0]> then\n                replace item ((Level) + (64)) of [orb pos v] with [1]\n            else\n                replace item ((Level) + (64)) of [orb pos v] with [0]\n            end\n            wait until <not <key (l v) pressed?>>\n        end\n    end\nend\n\nif <(Level) = [30]> then\n    go to x: (120) y: (-90)\n    show\nend\nif <(Level) = [31]> then\n    go to x: (150) y: (90)\n    show\nend\nif <(Level) = [32]> then\n    go to x: (150) y: (-90)\n    show\nend\nif <(Level) = [1]> then\n    go to x: (200) y: (-90)\n    show\nend\nif <(Level) = [2]> then\n    go to x: (-50) y: (100)\n    show\nend\nif <(Level) = [3]> then\n    go to x: (200) y: (145)\n    show\nend\nif <(Level) = [4]> then\n    go to x: (-75) y: (75)\n    show\nend\nif <(Level) = [5]> then\n    hide\nend\nif <(Level) = [6]> then\n    go to x: (215) y: (60)\n    show\nend\nif <(Level) = [7]> then\n    go to x: (170) y: (-90)\n    show\nend\nif <(Level) = [8]> then\n    go to x: (170) y: (-45)\n    show\nend\nif <(Level) = [9]> then\n    go to x: (15) y: (-120)\n    show\nend\nif <(Level) = [10]> then\n    hide\nend\nif <(Level) = [11]> then\n    go to x: (150) y: (-60)\n    show\nend\nif <(Level) = [12]> then\n    go to x: (180) y: (60)\n    show\nend\nif <(Level) = [13]> then\n    go to x: (-60) y: (75)\n    show\nend\nif <(Level) = [14]> then\n    go to x: (-180) y: (60)\n    show\nend\nif <(Level) = [15]> then\n    hide\nend\nif <(Level) = [16]> then\n    go to x: (200) y: (-105)\n    show\nend\nif <(Level) = [17]> then\n    go to x: (200) y: (-105)\n    show\nend\nif <(Level) = [18]> then\n    go to x: (180) y: (-100)\n    show\nend\nif <(Level) = [19]> then\n    go to x: (-200) y: (35)\n    show\nend\nif <(Level) = [20]> then\n    hide\nend\nif <(Level) = [21]> then\n    go to x: (150) y: (-90)\n    show\nend\nif <(Level) = [22]> then\n    go to x: (-50) y: (100)\n    show\nend\nif <(Level) = [23]> then\n    go to x: (-200) y: (50)\n    show\nend\nif <(Level) = [24]> then\n    go to x: (200) y: (50)\n    show\nend\nif <(Level) = [25]> then\n    hide\nend\nif <(Level) = [26]> then\n    go to x: (200) y: (130)\n    show\nend\nif <(Level) = [27]> then\n    hide\n    AssemblePlatform [3.5] [12.5] [-1]\n    go to x: (200) y: (-90)\n    wait until <(OrbKing) = [1]>\n    show\nend\nif <(Level) = [28]> then\n    hide\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nforever\n    if <(\(Settings\)Graphics) = [2]> then\n        wait (0.001) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nrepeat (5)\n    change [ghost v] effect by (20)\nend\ndelete this clone\n\nwhen flag clicked\nwait until <(Level) = [21]>\nrepeat until <(Level) = [26]>\n    set [color v] effect to (pick random (0) to (100))\nend\nclear graphic effects\n\n@Trampoline\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@Supoline\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\n@Pusholine\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [tick v]\nswitch costume to (Level)\n\n@PortalBlue\n\nwhen flag clicked\ngo to [back v] layer\ngo [forward v] (6) layers\nforever\n    if <(Level) = [8]> then\n        go to x: (-120) y: (105)\n    end\n    if <(Level) = [9]> then\n        go to x: (-180) y: (0)\n    end\n    if <(Level) = [10]> then\n        go to x: (165) y: (0)\n    end\n    if <(Level) = [15]> then\n        go to x: (195) y: (-90)\n    end\n    if <(Level) = [26]> then\n        go to x: (-15) y: (150)\n    end\n    if <(Level) = [31]> then\n        go to x: (165) y: (-90)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<not <(item (Level) of [blueportalparticledirection v]) = [0]>> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\nif <(item (Level) of [blueportalparticledirection v]) = [y]> then\n    go to x: (pick random ((item (Level) of [blueportalparticle v]) - (50)) to ((item (Level) of [blueportalparticle v]) + (50))) y: ((item ((Level) + (32)) of [blueportalparticle v]) - (30))\n    glide (1) secs to x: (item (Level) of [blueportalparticle v]) y: ((item ((Level) + (32)) of [blueportalparticle v]) + (25))\n    delete this clone\nelse\n    if <(item (Level) of [blueportalparticledirection v]) = [-y]> then\n        go to x: (pick random ((item (Level) of [blueportalparticle v]) - (50)) to ((item (Level) of [blueportalparticle v]) + (50))) y: ((item ((Level) + (32)) of [blueportalparticle v]) + (30))\n        glide (1) secs to x: (item (Level) of [blueportalparticle v]) y: ((item ((Level) + (32)) of [blueportalparticle v]) - (25))\n        delete this clone\n    end\nend\nif <(item (Level) of [blueportalparticledirection v]) = [x]> then\n    go to x: ((item (Level) of [blueportalparticle v]) - (30)) y: (pick random ((item ((Level) + (32)) of [blueportalparticle v]) - (50)) to ((item ((Level) + (32)) of [blueportalparticle v]) + (30)))\n    glide (1) secs to x: ((item (Level) of [blueportalparticle v]) + (25)) y: (item ((Level) + (32)) of [blueportalparticle v])\n    delete this clone\nelse\n    if <(item (Level) of [blueportalparticledirection v]) = [-x]> then\n        go to x: ((item (Level) of [blueportalparticle v]) + (30)) y: (pick random ((item ((Level) + (32)) of [blueportalparticle v]) - (50)) to ((item ((Level) + (32)) of [blueportalparticle v]) + (30)))\n        glide (1) secs to x: ((item (Level) of [blueportalparticle v]) - (25)) y: (item ((Level) + (32)) of [blueportalparticle v])\n        delete this clone\n    end\nend\n\nadd [0] to [blueportalparticledirection v]\nadd [0] to [blueportalparticledirectionbackup v]\n\nwhen I start as a clone\nset [levelcount v] to (Level)\nrepeat until <(item (Level) of [orangeportalparticledirection v]) = [0]>\n    if <not <(LevelCount) = (Level)>> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@PortalOrange\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        go to x: (165) y: (60)\n    end\n    if <(Level) = [9]> then\n        go to x: (0) y: (120)\n    end\n    if <(Level) = [10]> then\n        go to x: (30) y: (0)\n    end\n    if <(Level) = [15]> then\n        go to x: (120) y: (125)\n    end\n    if <(Level) = [26]> then\n        go to x: (75) y: (45)\n    end\n    if <(Level) = [31]> then\n        go to x: (-105) y: (60)\n    end\nend\n\nadd [0] to [orangeportalparticledirection v]\n\nwhen I receive [start v]\nforever\n    if <<not <(item (Level) of [orangeportalparticledirection v]) = [0]>> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\nif <(item (Level) of [orangeportalparticledirection v]) = [y]> then\n    go to x: (pick random ((item (Level) of [orangeportalparticle v]) - (50)) to ((item (Level) of [orangeportalparticle v]) + (50))) y: ((item ((Level) + (32)) of [orangeportalparticle v]) - (30))\n    glide (1) secs to x: (item (Level) of [orangeportalparticle v]) y: ((item ((Level) + (32)) of [orangeportalparticle v]) + (25))\n    delete this clone\nelse\n    if <(item (Level) of [orangeportalparticledirection v]) = [-y]> then\n        go to x: (pick random ((item (Level) of [orangeportalparticle v]) - (50)) to ((item (Level) of [orangeportalparticle v]) + (50))) y: ((item ((Level) + (32)) of [orangeportalparticle v]) + (30))\n        glide (1) secs to x: (item (Level) of [orangeportalparticle v]) y: ((item ((Level) + (32)) of [orangeportalparticle v]) - (25))\n        delete this clone\n    end\nend\nif <(item (Level) of [orangeportalparticledirection v]) = [x]> then\n    go to x: ((item (Level) of [orangeportalparticle v]) - (30)) y: (pick random ((item ((Level) + (32)) of [orangeportalparticle v]) - (50)) to ((item ((Level) + (32)) of [orangeportalparticle v]) + (30)))\n    glide (1) secs to x: ((item (Level) of [orangeportalparticle v]) + (25)) y: (item ((Level) + (32)) of [orangeportalparticle v])\n    delete this clone\nelse\n    if <(item (Level) of [orangeportalparticledirection v]) = [-x]> then\n        go to x: ((item (Level) of [orangeportalparticle v]) + (30)) y: (pick random ((item ((Level) + (32)) of [orangeportalparticle v]) - (50)) to ((item ((Level) + (32)) of [orangeportalparticle v]) + (30)))\n        glide (1) secs to x: ((item (Level) of [orangeportalparticle v]) - (25)) y: (item ((Level) + (32)) of [orangeportalparticle v])\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nset [levelcount v] to (Level)\nrepeat until <(item (Level) of [orangeportalparticledirection v]) = [0]>\n    if <not <(LevelCount) = (Level)>> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@DesertPortal\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\ngo to x: (155) y: (pick random (-25) to (-125))\nglide (1) secs to x: (205) y: (-75)\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Level) = [5]>> then\n        delete this clone\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<(Level) = [5]> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nforever\n    set [levelcount v] to (mouse y)\nend\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@ArcticPortal\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    if <<(Level) = [10]> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\ngo to x: (190) y: (pick random (70) to (170))\nglide (1) secs to x: (220) y: (120)\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Level) = [10]>> then\n        delete this clone\n    end\nend\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@SpacePortal\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen flag clicked\nforever\n    if <<(Level) = [15]> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\ngo to x: (0) y: (pick random (90) to (150))\nglide (1) secs to x: (55) y: (120)\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Level) = [15]>> then\n        delete this clone\n    end\nend\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@Snow\n\nwhen flag clicked\nforever\n    if <(\(Settings\)Graphics) = [2]> then\n        if <<(Level) > [10]> and <(Level) < [16]>> then\n            hide\n            switch costume to (level28 v)\n            create clone of (_myself_ v)\n        end\n    end\n    wait (0.1) seconds\nend\n\nwhen I start as a clone\nforever\n    if <<(Level) < [10]> or <(Level) > [15]>> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nif <(pick random (1) to (2)) = [2]> then\n    forever\n        turn right (5) degrees\n    end\nelse\n    forever\n        turn left (5) degrees\n    end\nend\n\nwhen I start as a clone\nif <<(Level) > [10]> and <(Level) < [16]>> then\n    go to x: (pick random (-250) to (250)) y: (180)\n    point in direction (pick random (135) to (215))\n    set [ghost v] effect to (pick random (0) to (75))\n    set size to (pick random (500) to (1500)) %\n    show\n    glide (2.5) secs to x: (pick random (-250) to (250)) y: (-180)\n    delete this clone\nend\n\n@GlitchedPortal\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    wait (0.05) seconds\n    set [pixelate v] effect to (pick random (1) to (10))\n    set [fisheye v] effect to (pick random (1) to (50))\n    if <<(Level) = [20]> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\ngo to x: (pick random (-130) to (-230)) y: (5)\nglide (1) secs to x: (-180) y: (-55)\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Level) = [20]>> then\n        delete this clone\n    end\n    set [color v] effect to (pick random (1) to (100))\nend\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@OceanPortal\n\nwhen I start as a clone\nset size to (1000) %\nset [ghost v] effect to (50)\nswitch costume to (particle v)\ngo to x: (-175) y: (pick random (10) to (110))\nglide (1) secs to x: (-205) y: (60)\ndelete this clone\n\nwhen I start as a clone\nforever\n    if <not <(Level) = [25]>> then\n        delete this clone\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <<(Level) = [25]> and <(\(Settings\)Graphics) = [2]>> then\n        create clone of (_myself_ v)\n        wait (0.05) seconds\n    end\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [tick v]\nif <(size) = [750]> then\n    switch costume to (Level)\nend\n\n@Orb_2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nhide\n\ncreate clone of (_myself_ v)\nmove (15) steps\nif on edge, bounce\n\nwhen I start as a clone\nset [ghost v] effect to (40)\nset size to (pick random (500) to (2500)) %\nswitch costume to (trail v)\nrepeat (10)\n    change [ghost v] effect by (5)\n    move (3) steps\n    point in direction (pick random (([direction v] of (join [Orb_] [2])) + (90)) to (([direction v] of (join [Orb_] [2])) + (270)))\nend\ndelete this clone\n\nwait () seconds\n\nwhen I receive [attack v]\nrepeat until <(\(King\)Score) > [4]>\n    wait until <(KingPower) < [1]>\n    switch costume to (costume1 v)\n    set [ghost v] effect to (0)\n    set size to (750) %\n    show\n    go to x: (pick random (-240) to (240)) y: (180)\n    if <(x position) > [0]> then\n        go to x: (((round ((x position) / (60))) * (60)) + (30)) y: (500)\n    else\n        go to x: (((round ((x position) / (60))) * (60)) - (30)) y: (500)\n    end\n    repeat until <<(y position) < [0.1]> or <touching (player v)?>>\n        change y by (((0) - (y position)) * (0.1))\n        turn right (10) degrees\n        create clone of (_myself_ v)\n    end\n    repeat (100)\n        turn right (10) degrees\n        change y by (1)\n        change [ghost v] effect by (1)\n        create clone of (_myself_ v)\n        if <touching (player v)?> then\n            point towards (king v)\n            switch costume to (main v)\n            set [ghost v] effect to (0)\n            set size to (250) %\n            start sound [Zoop v]\n            repeat until <touching (king v)?>\n                move (15) steps\n                create clone of (_myself_ v)\n            end\n            change [\(king\)score v] by (1)\n            hide\n            set y to (180)\n        end\n    end\n    wait (5) seconds\n    hide\nend\n\nwait (0.1) seconds\n\n