Compass: Wild World - Action Platformer

Instructions:               - Compass: Wild World -\n\nRPT - Platformer Clash V - Final Entry\n_-_-_-_-_\nRPT Studio: https://scratch.mit.edu/studios/33502484\nHost: @PlatformerClashV\nFull Game Speedrun: \nhttps://www.youtube.com/watch?v=PdscEaBMz4U\n_-_-_-_-_\nCredits\n-Leader: @The_Blue_J\n-Art: @finnagin5, @TheMoonJellyfish\n-Code: @anantnpapa, @finnagin5, @The_Blue_J\n-Game Design: @TheMoonJellyfish, @finnagin5, @anantnpapa, @The_Blue_J\n-Story: @scratching_claws, @TheMoonJellyfish, @finnagin5\n-Music: Dustforce OST by Lifeformed\n\nThanks to @Futballplayer79 for proposing this to be featured! :D\n_-_-_-_-_\nYou play as Agent Fever, a fighter for the Compass Habitation Coalition. Dire circumstances bring you to a struggling colony on a dangerous planet. Your mission is to restore power to this colony to save its inhabitants from a terrible fate. \n\nBrave the dangers of this planet and find the 7 pieces of a Tangram Crystal. \n\nFight powerful enemies as you parkour across bountiful and diverse lands. \n\nUnlock new weapons and gear to help you on your quest.\n_-_-_-_-_\nControls:\n-Move player: WASD or arrow keys\n-Use weapon: Mouse\n-Pause/Interact: E\n-Interact in item menus: 1 and 2\n-Use mobility item: Jump in midair\n-Use power-up: Space\n_-_-_-_-_\nWeapons:\n-Pistol: slow speed, medium damage\n-Minigun: fast speed, low damage\n-Sniper: slow speed, high damage\n-Shotgun: medium speed, medium-high damage\n-Aimbot Gun: fast speed, low damage, aim assist\n-Mega Shotgun: medium speed, high damage\n\nItems:\n-Paraglider: slow falling and gliding\n-Dash: small burst of high speed\n-Jetpack: flight for a small amount of time\n-Shield: blocks 3 hits before recharge\n-Powerjack: increased movement and attack speed for 5 seconds\n-Med Kit: removes debuffs and restores a point of health\n\nEnemies:\n-Regular Red: standard enemy\n-Flaming Orange: inflicts Fire debuff, causes damage over time\n-Purple Punch: no damage, but has a lot of knockback\n-Icy Blue: inflicts Ice debuff and limits movement\n-Confusing Green: inflicts Confusion, reverses controls\n-Black Blindness: inflicts Blindness, limits vision\n-Quick Silver: shoots faster projectiles with less cooldown\n-???: all of the above\n\n\n\n#Games #All

@Stage\n\nwhen I receive [start tick v]\nset volume to (100) %\nstop all sounds\nif <(Current level) = [0]> then\n    play sound [Fastfall \(Dustforce OST\) - 01 Cider Time / Lifeformed v] until done\nelse\n    forever\n        play sound (pick random (1) to (2)) until done\n        wait (10) seconds\n    end\nend\n\nif <(username) = [finnagin5]> then\n    start sound [Thomas The Tank Engine Theme v]\nend\n\nwhen I receive [sound fade v]\nrepeat (50)\n    change volume by (-2)\nend\nstop all sounds\n\nset [current level v] to [7]\nswitch backdrop to (level7 v)\n\ndelete all of [unlocked levels v]\n\nadd [7] to [unlocked levels v]\n\nwhen I receive [intro done v]\nstart sound [Fastfall \(Dustforce OST\) - 10 Frozen Hot Sauce / Lifeformed v]\n\nwhen I receive [intro done v]\nrepeat (30)\n    change [brightness v] effect by (3.33)\nend\nclear graphic effects\n\nwhen flag clicked\nswitch backdrop to (main menu v)\nset [brightness v] effect to (-100)\n\nwhen I receive [render tick v]\nset [brightness v] effect to (game done brightness)\n\nwhen I receive [title v]\nset [brightness v] effect to (100)\nset volume to (100) %\nstart sound [Immerse \(Dustforce Extras\) - 27 Sun Bleach / Lifeformed v]\nwait (1) seconds\nswitch backdrop to (thanks, i guess v)\nrepeat (30)\n    change [brightness v] effect by (-3.33)\nend\nclear graphic effects\n\n@Tiles\n\nwhen flag clicked\nhide\nerase all\ndelete all of [tiles: collidable? v]\ndelete all of [smart tiling? v]\ndelete all of [invis? v]\nAdd tile [collidable?  smart tiling?  invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable?  smart tiling? <> invisible? <> ]\nAdd tile [collidable?  smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nreplace item (join [] [last]) of [tiles: collidable? v] with [x]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nreplace item (join [] [last]) of [tiles: collidable? v] with [x]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nAdd tile [collidable? <> smart tiling? <> invisible?  ]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nreplace item (join [] [last]) of [tiles: collidable? v] with [x]\nAdd tile [collidable? <> smart tiling? <> invisible? <> ]\nreplace item (join [] [last]) of [tiles: collidable? v] with [x]\n\ndefine draw <edit?> (tile size) cam pos (x) (y)\nif <edit?> then\n    show variable [edit: block v]\n    show variable [h v]\n    show variable [s v]\n    show variable [v v]\n    set [brightness v] effect to (0)\n    set [i v] to ((1) + ((([floor v] of ((y) / (tile size)) ) * (MapX)) + ([floor v] of ((x) / (tile size)) )))\n    switch costume to (1111-01 v)\n    set size to (1000) %\n    set y to (((-180) + ((tile size) * (.5))) - ((y) mod (tile size)))\n    repeat ([ceiling v] of (((360) / (tile size)) + (1)) )\n        set x to (((-240) + ((tile size) * (.5))) - ((x) mod (tile size)))\n        repeat ([ceiling v] of (((480) / (tile size)) + (1)) )\n            set size to ((tile size) * (6.375)) %\n            switch costume to (1111-01 v)\n            if <touching (mouse-pointer v)?> then\n                if <key (p v) pressed?> then\n                    set [h v] to ((1) + (letter (1) of (item (i) of [color v])))\n                    set [s v] to ((1) + (letter (2) of (item (i) of [color v])))\n                    set [v v] to ((1) + (letter (3) of (item (i) of [color v])))\n                end\n                if <key (o v) pressed?> then\n                    set [edit: block v] to (item (i) of [world v])\n                end\n                if <mouse down?> then\n                    replace item (i) of [world v] with (Edit: Block)\n                    replace item (i) of [color v] with (join ((H) - (1)) (join ((S) - (1)) ((V) - (1))))\n                    if <(item (i) of [world v]) < [10]> then\n                        replace item (i) of [costumes v] with (join [0] (Edit: Block))\n                    else\n                        replace item (i) of [costumes v] with (Edit: Block)\n                    end\n                end\n            end\n            if <(item (i) of [world v]) > [0]> then\n                switch costume to (join [] (item (i) of [costumes v]))\n                set [h v] to (letter (1) of (item (i) of [color v]))\n                set [s v] to (letter (2) of (item (i) of [color v]))\n                set [v v] to (letter (3) of (item (i) of [color v]))\n                Stamp (tile size)\n            end\n            switch costume to (1111-01 v)\n            set size to (1000) %\n            change x by (tile size)\n            change [i v] by (1)\n        end\n        change y by (tile size)\n        change [i v] by ((MapX) - ([ceiling v] of (((480) / (tile size)) + (1)) ))\n    end\n    if <(Edit: Block) > [0]> then\n        go to x: (80) y: (160)\n        if <(Edit: Block) < [10]> then\n            switch costume to (join [0] (Edit: Block))\n        else\n            switch costume to (join [] (Edit: Block))\n        end\n        set [h v] to ((H) - (1))\n        set [s v] to ((S) - (1))\n        set [v v] to ((V) - (1))\n        Stamp [25]\n    end\nelse\n    hide variable [edit: block v]\n    hide variable [h v]\n    hide variable [s v]\n    hide variable [v v]\n    set [brightness v] effect to (0)\n    set [i v] to ((1) + ((([floor v] of ((y) / (tile size)) ) * (MapX)) + ([floor v] of ((x) / (tile size)) )))\n    switch costume to (1111-01 v)\n    set size to (1000) %\n    set y to (((-180) + ((tile size) * (.5))) - ((y) mod (tile size)))\n    repeat ([ceiling v] of (((360) / (tile size)) + (1)) )\n        set x to (((-240) + ((tile size) * (.5))) - ((x) mod (tile size)))\n        repeat ([ceiling v] of (((480) / (tile size)) + (1)) )\n            set size to ((tile size) * (6.25)) %\n            switch costume to (1111-01 v)\n            if (item (item (i) of [world v]) of [invis? v]) then\n                switch costume to (join [] (item (i) of [costumes v]))\n                set [h v] to (letter (1) of (item (i) of [color v]))\n                set [s v] to (letter (2) of (item (i) of [color v]))\n                set [v v] to (letter (3) of (item (i) of [color v]))\n                Stamp (tile size)\n            end\n            switch costume to (1111-01 v)\n            set size to (1000) %\n            change x by (tile size)\n            change [i v] by (1)\n        end\n        change y by (tile size)\n        change [i v] by ((MapX) - ([ceiling v] of (((480) / (tile size)) + (1)) ))\n    end\nend\n\nwhen I receive [render tick v]\ndraw <(Edit Mode) = [1]> ((40) / (CamZ)) cam pos ((CamX) / (CamZ)) ((CamY) / (CamZ))\nset [debug v] to ((40) / (CamZ))\n\nwhen I receive [game tick v]\nif <(Edit Mode) = [1]> then\n    change [camx v] by ((20) * (<<key (d v) pressed?> or <key (right arrow v) pressed?>> - <<key (a v) pressed?> or <key (left arrow v) pressed?>>))\n    change [camy v] by ((20) * (<<key (w v) pressed?> or <key (up arrow v) pressed?>> - <<key (s v) pressed?> or <key (down arrow v) pressed?>>))\nend\n\ndefine Stamp (tile size)\nset size to ((tile size) * (6.3)) %\nset [color v] effect to ((100) + ((h) * (20)))\nset [ghost v] effect to (0)\nset [brightness v] effect to (((v) * ((100) / (9))) - (100))\nstamp\nset [color v] effect to ((h) * (20))\nset [ghost v] effect to ((50) - ((s) * ((50) / (9))))\nset [brightness v] effect to (((v) * ((100) / (9))) - (100))\nstamp\n\ndefine process costumes\ndelete all of [costumes v]\nset [i v] to [0]\nrepeat (MapY)\n    repeat (MapX)\n        change [i v] by (1)\n        if (item (item (i) of [world v]) of [smart tiling? v]) then\n            if <(item (i) of [world v]) < [10]> then\n                add (join (join ((0) + (item (item ((i) + (MapX)) of [world v]) of [tiles: collidable? v])) (join ((0) + (item (item ((i) - (1)) of [world v]) of [tiles: collidable? v])) (join ((0) + (item (item ((i) + (1)) of [world v]) of [tiles: collidable? v])) ((0) + (item (item ((i) - (MapX)) of [world v]) of [tiles: collidable? v]))))) (join [-] (join [0] (item (i) of [world v])))) to [costumes v]\n            else\n                add (join (join ((0) + <(item ((i) + (MapX)) of [world v]) = (item (i) of [world v])>) (join ((0) + <(item ((i) - (1)) of [world v]) = (item (i) of [world v])>) (join ((0) + <(item ((i) + (1)) of [world v]) = (item (i) of [world v])>) ((0) + <(item ((i) - (MapX)) of [world v]) = (item (i) of [world v])>)))) (join [-] (item (i) of [world v]))) to [costumes v]\n            end\n        else\n            if <(item (i) of [world v]) = [31]> then\n                add (join (item (i) of [world v]) (join [-] (completed levels))) to [costumes v]\n            else\n                if <(item (i) of [world v]) < [10]> then\n                    add (join [0] (item (i) of [world v])) to [costumes v]\n                else\n                    add (item (i) of [world v]) to [costumes v]\n                end\n            end\n        end\n    end\nend\n\ndefine Add tile [collidable? <collide> smart tiling? <smart> invisible? <invis> ]\nadd <collide> to [tiles: collidable? v]\nadd <smart> to [smart tiling? v]\nadd <not <invis>> to [invis? v]\n\nwhen I receive [start tick v]\nforever\n    erase all\n    if <(PAUSE) = [0]> then\n        if <not <(popup) = [10]>> then\n            set [popup v] to [-1]\n        end\n        broadcast (game tick v)\n    end\n    delete all of [enemy positions v]\n    broadcast (parallax v)\n    broadcast (prerender v)\n    broadcast (render tick v)\n    broadcast (particle tick v)\n    broadcast (postrender v)\nend\n\ndefine save level to slot (slot) (set to blank or 0 to save as new)\nset [i v] to [1]\nset [temp3 v] to []\nrepeat until <(i) > ((MapX) * (MapY))>\n    set [i2 v] to [0]\n    set [temp2 v] to (item (i) of [world v])\n    repeat until <<(i) > ((MapX) * (MapY))> or <<not <(temp2) = (item (i) of [world v])>> or <(i2) > [5000]>>>\n        change [i v] by (1)\n        change [i2 v] by (1)\n    end\n    set [temp3 v] to (join (temp3) (join (item (i2) of [encoding v]) (item ((temp2) + (1)) of [encoding v])))\nend\nset [temp v] to []\nset [i v] to [1]\nrepeat until <(i) > ((MapX) * (MapY))>\n    set [i2 v] to [0]\n    set [temp2 v] to ((0) + (item (i) of [color v]))\n    repeat until <<(i) > ((MapX) * (MapY))> or <<not <(temp2) = ((0) + (item (i) of [color v]))>> or <(i2) > [5000]>>>\n        change [i v] by (1)\n        change [i2 v] by (1)\n    end\n    set [temp v] to (join (temp) (join (item (i2) of [encoding v]) (item ((temp2) + (1)) of [encoding v])))\nend\nset [temp v] to (join (join (MapX) (join [/] (join (MapY) [/]))) (join (join ((length of (temp3)) / (2)) [/]) (join (temp3) (join (join (join [/] ((length of (temp)) / (2))) [/]) (temp)))))\nif <<((slot) + (0)) = [0]> or <(slot) > (length of [levels v])>> then\n    add (temp) to [levels v]\nelse\n    replace item (slot) of [levels v] with (temp)\nend\n\ndefine load level from slot (slot) (will not load if slot is empty)\nif <not <<((slot) + (0)) = [0]> or <(slot) > (length of [levels v])>>> then\n    delete all of [world v]\n    delete all of [color v]\n    set [temp v] to []\n    set [i v] to [1]\n    repeat until <(letter (i) of (item (slot) of [levels v])) = [/]>\n        set [temp v] to (join (temp) (letter (i) of (item (slot) of [levels v])))\n        change [i v] by (1)\n    end\n    set [mapx v] to (temp)\n    change [i v] by (1)\n    set [temp v] to []\n    repeat until <(letter (i) of (item (slot) of [levels v])) = [/]>\n        set [temp v] to (join (temp) (letter (i) of (item (slot) of [levels v])))\n        change [i v] by (1)\n    end\n    set [mapy v] to (temp)\n    change [i v] by (1)\n    set [temp v] to []\n    repeat until <(letter (i) of (item (slot) of [levels v])) = [/]>\n        set [temp v] to (join (temp) (letter (i) of (item (slot) of [levels v])))\n        change [i v] by (1)\n    end\n    set [temp2 v] to (temp)\n    change [i v] by (1)\n    repeat (temp2)\n        repeat (item # of (letter (i) of (item (slot) of [levels v])) in [encoding v])\n            add ((-1) + (item # of (letter ((i) + (1)) of (item (slot) of [levels v])) in [encoding v])) to [world v]\n        end\n        change [i v] by (2)\n    end\n    change [i v] by (1)\n    set [temp v] to []\n    repeat until <(letter (i) of (item (slot) of [levels v])) = [/]>\n        set [temp v] to (join (temp) (letter (i) of (item (slot) of [levels v])))\n        change [i v] by (1)\n    end\n    set [temp2 v] to (temp)\n    change [i v] by (1)\n    repeat (temp2)\n        repeat (item # of (letter (i) of (item (slot) of [levels v])) in [encoding v])\n            set [temp v] to ((-1) + (item # of (letter ((i) + (1)) of (item (slot) of [levels v])) in [encoding v]))\n            if <(length of (temp)) = [1]> then\n                set [temp v] to (join [00] (temp))\n            else\n                if <(length of (temp)) = [2]> then\n                    set [temp v] to (join [0] (temp))\n                end\n            end\n            add (temp) to [color v]\n        end\n        change [i v] by (2)\n    end\n    process costumes\nend\n\nwhen I receive [die v]\nset [pause v] to [1]\nset [blind? v] to [0]\nset [blindness fade v] to [100]\nbroadcast (pause v)\n\nwhen I receive [start tick v]\nset [pause v] to [0]\nforever\n    if <not <(popup) = [10]>> then\n        if <<key (e v) pressed?> and <(Player Health) > [.01]>> then\n            wait until <not <key (e v) pressed?>>\n            set [pause v] to [1]\n            broadcast (pause v)\n            wait (0) seconds\n            if <(popup) = [8]> then\n                set [talking? v] to (npc)\n            end\n            if <(popup) = [9]> then\n                set [goal! v] to [0]\n                broadcast (win v)\n            end\n            wait until <<(Goal!) = [0]> and <<<key (e v) pressed?> and <(talking?) = [0]>> or <(PAUSE) = [0]>>>\n            wait until <<(customizing) = [0]> and <<not <key (e v) pressed?>> or <(PAUSE) = [0]>>>\n            set [pause v] to [0]\n            set [custom menu v] to [0]\n            broadcast (pause v)\n        end\n    end\nend\n\nwhen I receive [particle tick v]\nhide\nif <(blind?) = [1]> then\n    change [blindness fade v] by (-10)\n    if <(blindness fade) < [3]> then\n        set [blindness fade v] to [3]\n    end\nelse\n    change [blindness fade v] by (2)\n    if <[90] < (blindness fade)> then\n        set [blindness fade v] to [90]\n    end\nend\ngo to x: (0) y: (0)\nshow\nswitch costume to (vignette v)\nclear graphic effects\nif <(Current level) = [0]> then\n    set [ghost v] effect to ((20) + ((11) * (completed levels)))\nelse\n    set [ghost v] effect to (blindness fade)\nend\nchange [ghost v] effect by (game done brightness)\nset size to (100) %\n\ndefine Unicode (string)\nset [i v] to [0]\nrepeat (length of (string))\n    change [i v] by (1)\n    if <not <<[encoding v] contains (letter (i) of (string))?> or < [1234567890aeiou] contains (letter (i) of (string))?>>> then\n        add (letter (i) of (string)) to [encoding v]\n    end\nend\n\nwhen [i v] key pressed\nprocess costumes\n\nwhen I receive [load demo level v]\nstop [other scripts in sprite v]\nrepeat (5)\n    wait (0) seconds\nend\nswitch backdrop to (join [level] (popup))\nset [current level v] to (popup)\nload level from slot ((2) + (popup)) (will not load if slot is empty)\nbroadcast (sound fade v) and wait\n\nwhen I receive [load hub level v]\nstop [other scripts in sprite v]\nrepeat (5)\n    wait (0) seconds\nend\nswitch backdrop to (hub backdrop v)\nload level from slot [2] (will not load if slot is empty)\nbroadcast (sound fade v) and wait\n\nwhen I receive [start tick v]\nrepeat (10)\n    go to [front v] layer\n    go [backward v] (1) layers\n    if <(PAUSE) = [1]> then\n        go [backward v] (3) layers\n    end\nend\n\nload level from slot [4] (will not load if slot is empty)\n\nwhen I receive [title v]\nhide\n\n@Player\n\ndefine get index at (x) (y)\nset [index v] to ((1) + ((x) + (([floor v] of (y) ) * (MapX))))\nset [tile v] to (item (index) of [world v])\n\nwhen I receive [game tick v]\nif <(game done) = [0]> then\n    if <<(Edit Mode) = [0]> and <(id) = [1]>> then\n        show\n        if <(Player Health) < [1]> then\n            broadcast (die v)\n        end\n        if <(airtime) = [0]> then\n            set [double up-tap v] to [0]\n        else\n            if <<(Key UP) = [0]> and <(airtime) > [0]>> then\n                set [double up-tap v] to [-1]\n            end\n            if <<(double up-tap) = [-1]> and <<(Key UP) = [1]> and <(airtime) > [0]>>> then\n                set [double up-tap v] to [1]\n            end\n        end\n        if <(confused?) = [0]> then\n            set [key l/r v] to (<<key (d v) pressed?> or <key (right arrow v) pressed?>> - <<key (a v) pressed?> or <key (left arrow v) pressed?>>)\n        else\n            set [key l/r v] to (<<key (a v) pressed?> or <key (left arrow v) pressed?>> - <<key (d v) pressed?> or <key (right arrow v) pressed?>>)\n        end\n        set [key up v] to <<key (w v) pressed?> or <key (up arrow v) pressed?>>\n        set [key down v] to <<key (s v) pressed?> or <key (down arrow v) pressed?>>\n        if <(([abs v] of (Key L/R) ) + ((Key UP) + (Key Down))) > [0]> then\n            set [running? v] to [1]\n        end\n        if <<(running?) = [1]> and <(Beat the game?) = [0]>> then\n            change [\[speedrun timer v] by ((1) / (30))\n        end\n        Misc. Accessories\n        if <(Player Health) > [8]> then\n            set [player health v] to [8]\n        end\n        Mobility Accessories\n        Physics\n        Camera\n        if <(frozen?) = [0]> then\n            if <<(Key UP) = [1]> and <<(airtime) < [3]> and <(yv) < [.01]>>> then\n                start sound [jump v]\n                set [yv v] to [.6]\n            end\n            if <<(Key L/R) = [0]> and <(airtime) = [0]>> then\n                change [xv v] by ((xv) / (-2))\n            else\n                change [xv v] by (((((.5) + ((.125) * (jacked?))) * (Key L/R)) - (xv)) / (5))\n            end\n            if <(burning?) = [1]> then\n                if <(pick random (1) to (2)) = [1]> then\n                    add (x) to [particles v]\n                    add (y) to [particles v]\n                    add [3] to [particles v]\n                    add [180] to [particles v]\n                end\n            end\n        else\n            change [xv v] by (((((.15) * ((1) + (jacked?))) * (Key L/R)) - (xv)) / (10))\n            if <(pick random (1) to (2)) = [1]> then\n                add (x) to [particles v]\n                add (y) to [particles v]\n                add [4] to [particles v]\n                add [0] to [particles v]\n            end\n        end\n        if <(confused?) = [1]> then\n            if <(pick random (1) to (2)) = [1]> then\n                add (x) to [particles v]\n                add (y) to [particles v]\n                add [6] to [particles v]\n                add [0] to [particles v]\n            end\n        end\n        if <(hurt player) > [0]> then\n            if <(hurt player) < [3]> then\n                if <(hurt player) = [1]> then\n                    change [player health v] by (-1)\n                    change [xv v] by ((.2) * ([sin v] of (hurt direction) ))\n                    change [yv v] by ((.1) * ([cos v] of (hurt direction) ))\n                    start sound (join [hit] (pick random (1) to (3)))\n                    add (x) to [particles v]\n                    add (y) to [particles v]\n                    add [7] to [particles v]\n                    add [0] to [particles v]\n                else\n                    change [xv v] by ((1.5) * ([sin v] of (hurt direction) ))\n                    change [yv v] by ([cos v] of (hurt direction) )\n                end\n            else\n                if <(hurt player) = [3]> then\n                    set [frozen? v] to [1]\n                    set [burning? v] to [0]\n                    set [debuff cooldown1 v] to [90]\n                else\n                    if <(hurt player) = [4]> then\n                        set [burning? v] to [1]\n                        set [frozen? v] to [0]\n                        set [debuff cooldown1 v] to [90]\n                    else\n                        if <(hurt player) = [5]> then\n                            set [confused? v] to [1]\n                            set [blind? v] to [0]\n                            set [debuff cooldown2 v] to [150]\n                        else\n                            if <(hurt player) = [6]> then\n                                set [blind? v] to [1]\n                                set [confused? v] to [0]\n                                set [debuff cooldown2 v] to [150]\n                            else\n                                change [player health v] by (-1)\n                                change [xv v] by ((.4) * ([sin v] of (hurt direction) ))\n                                change [yv v] by ((.3) * ([cos v] of (hurt direction) ))\n                                start sound (join [hit] (pick random (1) to (3)))\n                                add (x) to [particles v]\n                                add (y) to [particles v]\n                                add [7] to [particles v]\n                                add [0] to [particles v]\n                            end\n                        end\n                    end\n                end\n            end\n            set [hurt player v] to [0]\n        end\n        if <(debuff cooldown2) < [1]> then\n            set [confused? v] to [0]\n            set [blind? v] to [0]\n        end\n        change [debuff cooldown2 v] by (-1)\n        if <(debuff cooldown1) > [0]> then\n            if <<(burning?) = [1]> and <((debuff cooldown1) mod (30)) = [29]>> then\n                add (x) to [particles v]\n                add (y) to [particles v]\n                add [10] to [particles v]\n                add [0] to [particles v]\n                start sound (join [hit] (pick random (1) to (3)))\n                change [player health v] by (-1)\n            end\n            change [debuff cooldown1 v] by (-1)\n        else\n            set [burning? v] to [0]\n            set [frozen? v] to [0]\n        end\n        change [weapon cooldown v] by (((-1) - ((.5) * (jacked?))) * ((1) + <(\[GAME MODE) = [2]>))\n        if <<(round (weapon cooldown)) < [1]> and <<mouse down?> or <<key (v v) pressed?> or <<key (c v) pressed?> or <key (x v) pressed?>>>>> then\n            if <(item (1) of [items v]) = [3]> then\n                set [weapon cooldown v] to [15]\n                add (x) to [projectiles v]\n                add (y) to [projectiles v]\n                add [7] to [projectiles v]\n                point towards (mouse-pointer v)\n                add (direction) to [projectiles v]\n                point in direction (90)\n                start sound [pistol v]\n            else\n                if <(item (1) of [items v]) = [4]> then\n                    set [weapon cooldown v] to [20]\n                    point towards (mouse-pointer v)\n                    shotgun [5]\n                    point in direction (90)\n                    start sound [i call shotgun!! v]\n                else\n                    if <(item (1) of [items v]) = [1]> then\n                        set [weapon cooldown v] to [10]\n                        add (x) to [projectiles v]\n                        add (y) to [projectiles v]\n                        add [9] to [projectiles v]\n                        point towards (mouse-pointer v)\n                        add (direction) to [projectiles v]\n                        point in direction (90)\n                        start sound [cannon v]\n                    else\n                        if <(item (1) of [items v]) = [2]> then\n                            set [weapon cooldown v] to [3]\n                            add (x) to [projectiles v]\n                            add (y) to [projectiles v]\n                            add [10] to [projectiles v]\n                            point towards (mouse-pointer v)\n                            add (direction) to [projectiles v]\n                            point in direction (90)\n                            start sound [pistol v]\n                        else\n                            if <(item (1) of [items v]) = [5]> then\n                                set [weapon cooldown v] to [4]\n                                add (x) to [projectiles v]\n                                add (y) to [projectiles v]\n                                add [13] to [projectiles v]\n                                point towards (mouse-pointer v)\n                                aimbot\n                                add (~bestdir) to [projectiles v]\n                                point in direction (90)\n                                start sound [pistol v]\n                            else\n                                if <(item (1) of [items v]) = [6]> then\n                                    set [weapon cooldown v] to [15]\n                                    point towards (mouse-pointer v)\n                                    shotgun [6]\n                                    point in direction (90)\n                                    start sound [i call shotgun!! v]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        point towards (mouse-pointer v)\n        set [homing dir v] to (direction)\n        point in direction (90)\n        get index at (x) ((y) - (.1))\n        if <<(tile) > [23]> and <(tile) < [31]>> then\n            set [popup v] to (((tile) - (23)) * <[unlocked levels v] contains ((tile) - (23))?>)\n            if <<(tile) = [30]> and <not <[unlocked levels v] contains ((tile) - (23))?>>> then\n                set [popup v] to [O]\n            end\n        end\n        if <(distance to [level goal v]) < [40]> then\n            set [popup v] to [9]\n        end\n        if <<(Current level) = [0]> and <(lift room condition) = [0]>> then\n            if <<(x) < [28]> and <(y) > [47]>> then\n                if <(mobility toggle) > [3]> then\n                    set [lift room condition v] to [2]\n                else\n                    set [lift room condition v] to [1]\n                end\n            end\n        end\n        get index at ((x) - (-.3)) (y)\n        spike check\n        get index at ((x) - (.3)) (y)\n        spike check\n    end\n    Limit Camera\nend\n\ndefine fix collision (dx) (dy)\nset [fix dx v] to (dx)\nset [fix dy v] to (dy)\nset [collision v] to [0]\nfix point at ((x) + (.3)) ((y) + (-.6))\nfix point at ((x) + (-.3)) ((y) + (-.6))\nfix point at ((x) + (.3)) ((y) + (.6))\nfix point at ((x) + (.3)) ((y) + (0))\nfix point at ((x) + (-.3)) ((y) + (.6))\nfix point at ((x) + (-.3)) ((y) + (0))\nif <(collision) = [1]> then\n    if <(dx) = [0]> then\n        set [yv v] to ((.5) * (yv))\n        if <(dy) < [0]> then\n            set [yv v] to [0]\n            set [airtime v] to [0]\n        end\n    else\n        set [xv v] to ((.9) * (xv))\n    end\nend\n\ndefine fix point at (x) (y)\nif <(y) > (y)> then\n    get index at (x) ((y) + (-.00000001))\nelse\n    get index at (x) ((y) + (.00000001))\nend\nif <(item (tile) of [tiles: collidable? v]) = [x]> then\n    if <<not <(y) > (y)>> or <(((y) mod (1)) - (fix dy)) < [.99999]>> then\n        stop [this script v]\n    end\n    if <(Key Down) = [1]> then\n        stop [this script v]\n    end\nend\nif (item (tile) of [tiles: collidable? v]) then\n    set [collision v] to [1]\n    if <(fix dx) < [0]> then\n        change [x v] by ((1) - ((x) mod (1)))\n    end\n    if <(fix dx) > [0]> then\n        change [x v] by ((-0.0000001) - ((x) mod (1)))\n    end\n    if <(fix dy) < [0]> then\n        change [y v] by ((1) - ((y) mod (1)))\n    end\n    if <(fix dy) > [0]> then\n        change [y v] by ((-0.0000001) - ((y) mod (1)))\n    end\nend\n\ndefine Camera\nchange [camx v] by (((((x) * (40)) - ((240) * (CamZ))) - (CamX)) * (.6))\nchange [camy v] by (((((y) * (40)) - ((180) * (CamZ))) - (CamY)) * (.6))\nLimit Camera\n\nwhen I receive [prerender v]\nif <<(id) = [1]> and <(Player Health) > [0]>> then\n    set size to (10000) %\n    go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n    set size to (((200) * (.75)) / (CamZ)) %\n    set [ghost v] effect to ((75) + ((25) * ((1) - ((Player Health) / (8)))))\n    switch costume to (aura v)\n    stamp\n    clear graphic effects\n    set size to (((100) * (.666)) / (CamZ)) %\n    set [ghost v] effect to ((100) - (shield effect))\n    switch costume to (shield v)\n    stamp\n    clear graphic effects\nend\n\ndefine Misc. Accessories\nchange [buff cooldown v] by (-1)\nif <(item (2) of [items v]) = [1]> then\n    if <key (space v) pressed?> then\n        change [shield effect v] by ((((80) - ((26.67) * (buff var))) - (shield effect)) * (.5))\n    else\n        change [shield effect v] by (((0) - (shield effect)) * (.3))\n    end\n    if <(buff cooldown) < [1]> then\n        if <(buff var) = [3]> then\n            set [buff var v] to [0]\n        end\n        if <key (space v) pressed?> then\n            if <<(hurt player) > [0]> or <(hurt player) = [-1]>> then\n                start sound [shield v]\n                set [hurt player v] to [0]\n                change [buff var v] by (1)\n            end\n            if <(buff var) = [3]> then\n                set [buff cooldown v] to [300]\n            end\n        end\n    end\nend\nif <(item (2) of [items v]) = [2]> then\n    if <(buff cooldown) < [1]> then\n        if <key (space v) pressed?> then\n            set [buff var v] to [150]\n            set [buff cooldown v] to [300]\n            set [jacked? v] to [1]\n        end\n    else\n        if <(buff var) < [1]> then\n            set [jacked? v] to [0]\n        else\n            change [buff var v] by (-1)\n        end\n    end\nend\nif <(item (2) of [items v]) = [3]> then\n    if <(buff cooldown) < [1]> then\n        if <key (space v) pressed?> then\n            set [blind? v] to [0]\n            set [burning? v] to [0]\n            set [confused? v] to [0]\n            set [frozen? v] to [0]\n            set [debuff cooldown1 v] to [0]\n            set [debuff cooldown2 v] to [0]\n            set [buff cooldown v] to [300]\n            change [player health v] by (1)\n        end\n    end\nend\n\ndefine Mobility Accessories\nif <(frozen?) = [0]> then\n    if <(item (3) of [items v]) = [2]> then\n        if <<(double up-tap) = [1]> and <<(mobility toggle) = [0]> and <<(airtime) > [0]> and <not <(Key L/R) = [0]>>>>> then\n            set [mobility toggle v] to [1]\n            set [xv v] to (Key L/R)\n        else\n            if <(airtime) = [0]> then\n                set [mobility toggle v] to [0]\n            end\n        end\n    end\n    if <(item (3) of [items v]) = [3]> then\n        if <<(double up-tap) = [1]> and <<(mobility toggle) < [30]> and <(airtime) > [0]>>> then\n            change [mobility toggle v] by (1)\n            change [yv v] by ((((.5) * (Key UP)) - (yv)) / (5))\n        else\n            if <(airtime) = [0]> then\n                set [mobility toggle v] to [0]\n            end\n        end\n    end\n    if <(item (3) of [items v]) = [1]> then\n        if <<(Key UP) = [1]> and <<(airtime) > [0]> and <(yv) < [0]>>> then\n            change [yv v] by ((yv) / ((-2) + ((-2) * ([abs v] of (Key L/R) ))))\n            set [paragliding? v] to [1]\n        else\n            set [paragliding? v] to [0]\n        end\n    end\nend\n\ndefine Physics\nchange [yv v] by (-.05)\nchange [airtime v] by (1)\nchange [x v] by (xv)\nfix collision (xv) [0]\nif <(yv) < [-1]> then\n    set [yv v] to [-1]\nend\nif <[1] < (yv)> then\n    set [yv v] to [1]\nend\nchange [y v] by (yv)\nfix collision [0] (yv)\n\ndefine Limit Camera\nif <[0] > (CamY)> then\n    set [camy v] to [0]\nend\nif <[0] > (CamX)> then\n    set [camx v] to [0]\nend\nif <(CamY) > (((40) * (MapY)) - ((360) * (CamZ)))> then\n    set [camy v] to (((40) * (MapY)) - ((360) * (CamZ)))\nend\nif <(CamX) > (((40) * (MapX)) + ((-480) * (CamZ)))> then\n    set [camx v] to (((40) * (MapX)) + ((-480) * (CamZ)))\nend\n\nwhen I receive [render tick v]\nset [brightness v] effect to (game done brightness)\nif <<(Player Health) > [0]> and <<(id) = [1]> or <(PAUSE) = [0]>>> then\n    if <(PAUSE) = [0]> then\n        change [timer v] by (.03333333333)\n    end\n    if <(id) = [1]> then\n        point in direction (90)\n        if <(Key L/R) = [-1]> then\n            set [temp v] to [5]\n        else\n            if <(Key L/R) = [1]> then\n                set [temp v] to [4]\n            end\n        end\n        set [offsetx v] to [0]\n        if <<(item (3) of [items v]) = [3]> and <<(mobility toggle) > [0]> and <<(mobility toggle) < [30]> and <(Key UP) = [1]>>>> then\n            if <([weapon cooldown v] of [player v]) > [-5]> then\n                switch costume to ((10) + <(mouse x) < (x position)>)\n            else\n                switch costume to ((6) + (temp))\n            end\n        else\n            if <([weapon cooldown v] of [player v]) > [-5]> then\n                switch costume to ((4) + <(mouse x) < (x position)>)\n            else\n                switch costume to ((0) + (temp))\n            end\n        end\n    else\n        switch costume to (join [] ((id) - (1)))\n        set [temp v] to ((((((id) mod (2)) - (.5)) * ([abs v] of ([xv v] of [player v]) )) * ([sin v] of ((timer) * ((900) / ((1) + ((2) * <([airtime v] of [player v]) > [0]>)))) )) / ((1) + <([airtime v] of [player v]) > [0]>))\n        point in direction (90)\n        if <(id) < [4]> then\n            if <([weapon cooldown v] of [player v]) > [-5]> then\n                point towards (mouse-pointer v)\n                change [offsetx v] by ((((.5) * ([sin v] of (direction) )) - (offsetX)) * (.5))\n                change [offsety v] by ((((.5) * ([cos v] of (direction) )) - (offsetY)) * (.5))\n                if <(id) = [3]> then\n                    switch costume to ((11) + (item (1) of [items v]))\n                end\n            else\n                if <(paragliding?) = [1]> then\n                    change [offsety v] by (((.7) - (offsetY)) * (.7))\n                    change [offsetx v] by (((0) - (offsetX)) * (.7))\n                else\n                    change [offsety v] by (((((-.3) * ([yv v] of [player v])) - (.1)) - (offsetY)) * (.5))\n                    change [offsetx v] by ((((-.5) * (temp)) - (offsetX)) * (.9))\n                end\n            end\n            if <<(id) = [3]> and <<(offsetY) > [.2]> and <not <([weapon cooldown v] of [player v]) > [-5]>>>> then\n                point in direction (90)\n                switch costume to (join [glider] (([temp v] of [player v]) - (3)))\n            end\n        else\n            change [offsetx v] by ((((-.5) * (temp)) - (offsetX)) * (.9))\n        end\n    end\nend\nif <(Player Health) > [0]> then\n    go to x: (((((([x v] of [player v]) + (offsetX)) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((([y v] of [player v]) + (offsetY)) * (40)) - (CamY)) / (CamZ)) - (180))\nend\n\nwhen I receive [start tick v]\nif  then\n    delete this clone\nend\nset [id v] to [1]\nset [blind? v] to [0]\nset [burning? v] to [0]\nset [confused? v] to [0]\nset [frozen? v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset [player health v] to ((8) - ((7) * <(\[GAME MODE) = [3]>))\nset [timer v] to [0]\nset [running? v] to [0]\nsetup body\n\ndefine setup body\nclear graphic effects\ngo to [front v] layer\nshow\nset [offsetx v] to [0]\nset [offsety v] to [0]\nset [id v] to [1]\nrepeat (4)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nset [id v] to [1]\n\nchange [xv v] by ((-0.1) * ([sin v] of (direction) ))\nchange [yv v] by ((-0.05) * ([cos v] of (direction) ))\n\ndefine shotgun (amount)\nrepeat (5)\n    add (x) to [projectiles v]\n    add (y) to [projectiles v]\n    add [8] to [projectiles v]\n    add ((direction) + (pick random (-7) to (7))) to [projectiles v]\nend\n\nwhen I receive [die v]\nset [xv v] to ((1.6) * (([xv v] of [player v]) + (pick random (2) to (-2))))\nset [yv v] to (pick random (0) to (5))\nrepeat (33)\n    change [ghost v] effect by (3)\n    turn right (xv) degrees\n    change x by (xv)\n    change y by (yv)\n    change [yv v] by (-.5)\nend\nclear graphic effects\nhide\n\nwhen flag clicked\nset [beat the game? v] to [0]\nset [\[speedrun timer v] to [0]\nset [mobility accessory v] to []\nset [second accessory v] to []\nset [weapon v] to [1]\nset [secondary weapon v] to []\nreplace item (1) of [items v] with (Weapon)\nhide\n\nwhen I receive [start tick v]\nif <(Current level) = [0]> then\n    set [x v] to [40]\n    set [y v] to [8.6]\nelse\n    set [x v] to ((-.5) + ((item # of [35] in [world v]) mod (MapX)))\n    set [y v] to ((.6) + ([floor v] of ((item # of [35] in [world v]) / (MapX)) ))\nend\nset [camx v] to (((x) * (40)) - ((240) * (CamZ)))\nset [camy v] to (((y) * (40)) - ((180) * (CamZ)))\nLimit Camera\n\nwhen I receive [start tick v]\nset [buff cooldown v] to [0]\nset [buff var v] to [0]\nset [shield effect v] to [0]\n\nwhen I start as a clone\ngo to [front v] layer\n\nwhen I receive [loading v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\ndefine spike check\nif <<(tile) = [33]> or <<(tile) = [34]> or <(y) < [0]>>> then\n    change [player health v] by (-1)\n    if <[0] < (Player Health)> then\n        set [x v] to (item (3) of [recovery v])\n        set [y v] to (item (4) of [recovery v])\n        get index at ((item (3) of [recovery v]) - (.4)) (item (4) of [recovery v])\n        if <[tiles: collidable? v] contains (tile)?> then\n            fix collision [-1] [0]\n        else\n            get index at ((item (3) of [recovery v]) + (.4)) (item (4) of [recovery v])\n            if <[tiles: collidable? v] contains (tile)?> then\n                fix collision [1] [0]\n            end\n        end\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\nelse\n    if <<(airtime) < [1]> and <not <<(round ((item ((index) + (-1)) of [world v]) / (2))) = [17]> or <(round ((item ((index) + (1)) of [world v]) / (2))) = [17]>>>> then\n        insert (round (x)) at (1) of [recovery v] \n        insert ((round (y)) - (.4)) at (2) of [recovery v] \n        delete (5) of [recovery v]\n        delete (5) of [recovery v]\n        delete (5) of [recovery v]\n    end\nend\n\nwhen [1 v] key pressed\nreplace item (1) of [items v] with (Weapon)\nif <((Weapon) + (0)) = [0]> then\n    set [weapon cooldown v] to [-10]\nend\n\nwhen [2 v] key pressed\nreplace item (1) of [items v] with (Secondary Weapon)\nif <((Secondary Weapon) + (0)) = [0]> then\n    set [weapon cooldown v] to [-10]\nend\n\nwhen I receive [particle tick v]\nreplace item (2) of [items v] with (Second accessory)\nreplace item (3) of [items v] with (Mobility accessory)\nreplace item (4) of [items v] with (Weapon)\nreplace item (5) of [items v] with (Secondary Weapon)\n\nset [\[save code v] to (join (item (1) of [items v]) (join ((Mobility accessory) + (0)) (join ((Second accessory) + (0)) (join ((Weapon) + (0)) ((Secondary Weapon) + (0))))))\nset [\[save code v] to (join (\[SAVE CODE) (join (completed levels) (join (Beat the game?) (\[GAME MODE))))\n\nadd val (item # of (letter (1) of (username)) in [encoding2 v]) to savecode\nadd val (item # of (letter (2) of (username)) in [encoding2 v]) to savecode\nadd val (item # of (letter (length of (username)) of (username)) in [encoding2 v]) to savecode\nadd val ((79) + (length of (username))) to savecode\nset [\[compressed code v] to (item (join (letter (1) of (\[SAVE CODE)) (join (letter (2) of (\[SAVE CODE)) (join (letter (3) of (\[SAVE CODE)) (letter (4) of (\[SAVE CODE))))) of [encoding v])\nset [i v] to [5]\nrepeat (4)\n    set [\[compressed code v] to (join (\[Compressed code) (item (join (letter (i) of (\[SAVE CODE)) (join (letter ((i) + (1)) of (\[SAVE CODE)) (letter ((i) + (2)) of (\[SAVE CODE)))) of [encoding v]))\n    change [i v] by (3)\nend\n\ndefine add val (number) to savecode\nif <(length of (number)) < [2]> then\n    set [\[save code v] to (join (\[SAVE CODE) (join [0] (number)))\nelse\n    set [\[save code v] to (join (\[SAVE CODE) (number))\nend\n\ndefine aimbot\nset [i v] to [-1]\nset [~dist v] to [100]\nset [~bestdir v] to (direction)\nrepeat ((length of [enemy positions v]) / (2))\n    change [i v] by (2)\n    get dir (mouse x) (mouse y) [0] [0]\n    set [~vx v] to ([sin v] of (dir) )\n    set [~vy v] to ([cos v] of (dir) )\n    set [~tx v] to (item (i) of [enemy positions v])\n    set [~ty v] to (item ((i) + (1)) of [enemy positions v])\n    get dir (~tx) (~ty) (x) (y)\n    set [~tx v] to ([sin v] of (dir) )\n    set [~ty v] to ([cos v] of (dir) )\n    get dist (x) (y) (item (i) of [enemy positions v]) (item ((i) + (1)) of [enemy positions v])\n    if <(dist) < [20]> then\n        get dist (~tx) (~ty) (~vx) (~vy)\n        if <<(dist) < (~dist)> and <(dist) < [.45]>> then\n            set [~dist v] to (dist)\n            get dir (~tx) (~ty) [0] [0]\n            set [~bestdir v] to (dir)\n        end\n    end\nend\n\ndefine get dist (x1) (y1) (x2) (y2)\nset [dist v] to ([sqrt v] of ((((x1) - (x2)) * ((x1) - (x2))) + (((y1) - (y2)) * ((y1) - (y2)))) )\n\ndefine get dir (x1) (y1) (x2) (y2)\nset [dir v] to (([atan v] of (((x2) - (x1)) / ((y2) - (y1))) ) + ((180) * <(y2) < (y1)>))\n\nset size to (((100) * (.666)) / (CamZ)) %\nset size to (10000) %\n\nset size to (((100) * (.666)) / (CamZ)) %\n\nwhen I receive [title v]\nhide\n\n@NPCs\n\nwhen I receive [prerender v]\nif <(id) > [0]> then\n    set size to (1000) %\n    go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n    set size to (((200) * (.75)) / (CamZ)) %\n    set [ghost v] effect to (75)\n    if <(item (id) of [colors v]) = [b]> then\n        set [color v] effect to (120)\n        set [brightness v] effect to (-60)\n        set [ghost v] effect to (80)\n    else\n        set [color v] effect to ((2) * (item (id) of [colors v]))\n        set [brightness v] effect to (0)\n    end\n    change [ghost v] effect by (game done brightness)\n    switch costume to (aura v)\n    stamp\n    clear graphic effects\n    if <(talking?) = (id)> then\n        change [camx v] by ((((((([x v] of [player v]) + (x)) / (2)) * (40)) - ((240) * (CamZ))) - (CamX)) * (.3))\n        change [camy v] by ((((((([y v] of [player v]) + (y)) / (2)) * (40)) - ((180) * (CamZ))) - (CamY)) * (.3))\n    end\nelse\nend\n\nwhen I receive [render tick v]\nif <(id) > [0]> then\n    set size to (1000) %\n    go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n    switch costume to (id)\n    set size to (((100) * (.666)) / (CamZ)) %\nelse\n    switch costume to (liam \(weapons\) v)\nend\n\nwhen I start as a clone\nlocation\n\nwhen I receive [load hub level v]\nsetup\n\ndefine setup\nshow\nset [id v] to [0]\nrepeat (5)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nset [id v] to [0]\nhide\n\nwhen [i v] key pressed\nlocation\n\ndefine location\npoint in direction (90)\nset rotation style [left-right v]\nif <(id) = [5]> then\n    if <(completed levels) < [4]> then\n        set [x v] to [37]\n        set [y v] to [8.6]\n    else\n        if <(completed levels) < [7]> then\n            set [x v] to [52.5]\n            set [y v] to [26.9]\n        else\n            set [x v] to [55]\n            set [y v] to [45.6]\n        end\n    end\nelse\n    if <(id) = [1]> then\n        if <(length of [unlocked levels v]) < [5]> then\n            set [x v] to [23]\n            set [y v] to [20.6]\n            point in direction (-90)\n        else\n            set [x v] to [35]\n            set [y v] to [35.6]\n        end\n    else\n        if <(id) = [2]> then\n            if <(length of [unlocked levels v]) < [5]> then\n                set [x v] to [18]\n                set [y v] to [20.6]\n            else\n                set [x v] to [44.5]\n                set [y v] to [35.6]\n                point in direction (-90)\n            end\n        else\n            if <(id) = [3]> then\n                if <(completed levels) < [1]> then\n                    set [x v] to [18]\n                    set [y v] to [14.6]\n                    point in direction (-90)\n                else\n                    if <(completed levels) < [2]> then\n                        set [x v] to [43]\n                        set [y v] to [8.6]\n                        point in direction (-90)\n                    else\n                        if <(completed levels) < [7]> then\n                            set [x v] to [47]\n                            set [y v] to [26.6]\n                            point in direction (-90)\n                        else\n                            set [x v] to [42.5]\n                            set [y v] to [8.6]\n                            point in direction (-90)\n                        end\n                    end\n                end\n            else\n                if <(id) = [4]> then\n                    if <(completed levels) = [0]> then\n                        set [x v] to [64.3]\n                        set [y v] to [8.6]\n                    else\n                        if <(completed levels) < [2]> then\n                            set [x v] to [35.5]\n                            set [y v] to [35.6]\n                            point in direction (-90)\n                        else\n                            if <(completed levels) < [7]> then\n                                set [x v] to [20]\n                                set [y v] to [35.6]\n                                point in direction (-90)\n                            else\n                                set [x v] to [46.5]\n                                set [y v] to [8.6]\n                                point in direction (-90)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset [dir v] to (direction)\n\nwhen I receive [start tick v]\nif <not <((MapX) * (MapY)) = [4800]>> then\n    delete this clone\nend\n\nwhen I receive [game tick v]\nif <(id) > [0]> then\n    if <(distance to [player v]) < [50]> then\n        point towards (player v)\n        set [popup v] to [8]\n        set [npc v] to (id)\n        get dialog\n    else\n        point in direction (dir)\n    end\nend\n\ndefine get dialog\nif <(id) = [5]> then\n    set [conversation v] to ((completed levels) + (1))\nelse\n    if <(id) = [1]> then\n        if <(completed levels) < [1]> then\n            set [conversation v] to [9]\n        else\n            if <(completed levels) < [3]> then\n                set [conversation v] to (pick random (1) to (3))\n            else\n                if <(completed levels) < [7]> then\n                    set [conversation v] to (pick random (4) to (6))\n                else\n                    set [conversation v] to [7]\n                end\n            end\n        end\n    else\n        if <(id) = [2]> then\n            if <(completed levels) < [1]> then\n                set [conversation v] to [9]\n            else\n                if <(completed levels) < [4]> then\n                    set [conversation v] to (pick random (1) to (3))\n                else\n                    if <(completed levels) < [6]> then\n                        set [conversation v] to (pick random (4) to (6))\n                    else\n                        if <(completed levels) < [7]> then\n                            set [conversation v] to [7]\n                        else\n                            set [conversation v] to [8]\n                        end\n                    end\n                end\n            end\n        else\n            if <(id) = [3]> then\n                if <(completed levels) = [0]> then\n                    set [conversation v] to [1]\n                else\n                    if <(completed levels) = [1]> then\n                        set [conversation v] to [2]\n                    else\n                        if <(completed levels) < [5]> then\n                            set [conversation v] to [3]\n                        else\n                            if <(completed levels) < [7]> then\n                                if <(length of [unlocked levels v]) < [7]> then\n                                    set [conversation v] to [4]\n                                else\n                                    set [conversation v] to [5]\n                                end\n                            else\n                                if <(\[GAME MODE) = [1]> then\n                                    set [conversation v] to [7]\n                                else\n                                    set [conversation v] to [6]\n                                end\n                            end\n                        end\n                    end\n                end\n            else\n                if <(id) = [4]> then\n                    if <(completed levels) = [0]> then\n                        set [conversation v] to [1]\n                    else\n                        if <(completed levels) < [2]> then\n                            set [conversation v] to [2]\n                        else\n                            if <(completed levels) < [7]> then\n                                if <(lift room condition) = [0]> then\n                                    set [conversation v] to [3]\n                                else\n                                    if <(lift room condition) = [1]> then\n                                        set [conversation v] to [4]\n                                    else\n                                        set [conversation v] to [5]\n                                    end\n                                end\n                            else\n                                set [conversation v] to [6]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nset [dir v] to (direction)\n\n@Enemies\n\ndefine get index at (x) (y)\nset [index v] to ((1) + ((x) + (([floor v] of (y) ) * (MapX))))\nset [tile v] to (item (index) of [world v])\n\nwhen I receive [game tick v]\nif <<(Edit Mode) = [0]> and <not <(id) = [0]>>> then\n    turn right (5) degrees\n    if <(Health) < [0.01]> then\n        start sound [this sound means that i am dead! v]\n        delete this clone\n    end\n    show\n    change [frames v] by (1)\n    get dist (([x v] of [player v]) - (spawn x)) (([y v] of [player v]) - (spawn y))\n    if <((frames) mod (45)) = [0]> then\n        if <(dist) > [600]> then\n            set [target v] to [2]\n        else\n            set [target v] to (pick random (0) to (pick random (0) to (1)))\n        end\n        if <(target) = [1]> then\n            set [player dist v] to [1000]\n            if <(y) > ([y v] of [player v])> then\n                set [player dir v] to (pick random (-90) to (-270))\n            else\n                set [player dir v] to (pick random (-90) to (90))\n            end\n        end\n    end\n    if <(target) = [0]> then\n        get values (([x v] of [player v]) - (x)) (([y v] of [player v]) - (y)) ([y v] of [player v])\n    end\n    if <(target) = [2]> then\n        get values ((spawn x) - (x)) ((spawn y) - (y)) (spawn y)\n    end\n    change [xv v] by (((.03) * ([sin v] of (player dir) )) * (<[150] < (player dist)> - (.6)))\n    change [yv v] by (((.03) * ([cos v] of (player dir) )) * (<[150] < (player dist)> - (.6)))\n    laser check\n    change [x v] by (xv)\n    change [y v] by (yv)\n    set [xv v] to ((xv) * (.95))\n    set [yv v] to ((yv) * (.95))\n    change [cooldown v] by ((-1) - ((.5) * <(\[GAME MODE) = [2]>))\n    if <<(cooldown) < [.01]> and <not <(target) = [2]>>> then\n        get index at (x) (y)\n        if <not (item (tile) of [tiles: collidable? v])> then\n            if <((costume [number v]) - (1)) < [3]> then\n                if <((costume [number v]) - (1)) = [1]> then\n                    set [cooldown v] to [30]\n                else\n                    set [cooldown v] to [30]\n                end\n            else\n                if <((costume [number v]) - (1)) = [3]> then\n                    set [cooldown v] to [60]\n                else\n                    if <((costume [number v]) - (1)) = [4]> then\n                        set [cooldown v] to [60]\n                    else\n                        if <((costume [number v]) - (1)) = [5]> then\n                            set [cooldown v] to [60]\n                        else\n                            if <((costume [number v]) - (1)) = [6]> then\n                                set [cooldown v] to [60]\n                            else\n                                set [cooldown v] to [20]\n                            end\n                        end\n                    end\n                end\n            end\n            add (x) to [projectiles v]\n            add (y) to [projectiles v]\n            if <(costume [number v]) < [7]> then\n                add (costume [number v]) to [projectiles v]\n            else\n                add ((costume [number v]) + (4)) to [projectiles v]\n            end\n            if <(pick random (1) to (2)) = [1]> then\n                add (player dir) to [projectiles v]\n                change [xv v] by ((-.2) * ([sin v] of (player dir) ))\n                change [yv v] by ((-.2) * ([cos v] of (player dir) ))\n            else\n                add (direction) to [projectiles v]\n                change [xv v] by ((-.2) * ([sin v] of (direction) ))\n                change [yv v] by ((-.2) * ([cos v] of (direction) ))\n            end\n        end\n    end\nend\n\nwhen I start as a clone\ngo to [front v] layer\ngo [backward v] (1) layers\npoint in direction (pick random (1) to (360))\nset [x v] to ((spawn x) + (pick random (-.1) to (.1)))\nset [y v] to ((spawn y) + (pick random (-.1) to (.1)))\nset [frames v] to (pick random (1) to (45))\nset [id v] to ((costume [number v]) - (1))\nset [health v] to [3]\nset [size v] to [0]\n\ndefine get values (x) (y) (#)\nset [player dir v] to (([atan v] of ((x) / (y)) ) + ((180) * <(#) < (y)>))\nget dist (x) (y)\nset [player dist v] to (dist)\n\ndefine setup\nset [i v] to [0]\nset [spawn y v] to [1]\nrepeat (MapY)\n    set [spawn x v] to [1]\n    repeat (MapX)\n        change [i v] by (1)\n        change [spawn x v] by (1)\n        repeat ((1) + (((pick random (1) to (2)) * <(\[GAME MODE) = [2]>) + ((pick random (0) to (1)) * <(\[GAME MODE) = [3]>)))\n            if <(item (i) of [world v]) = [6]> then\n                if <(pick random (1) to (2)) = [1]> then\n                    switch costume to (regular red v)\n                    create clone of (_myself_ v)\n                else\n                    if <<(pick random (1) to (2)) = [1]> and <(completed levels) > [4]>> then\n                        switch costume to (quick silver v)\n                        create clone of (_myself_ v)\n                    else\n                        switch costume to (flaming orange v)\n                        create clone of (_myself_ v)\n                    end\n                end\n            else\n                if <(item (i) of [world v]) = [7]> then\n                    switch costume to (purple punch v)\n                    create clone of (_myself_ v)\n                else\n                    if <(item (i) of [world v]) = [8]> then\n                        if <(pick random (1) to (2)) = [1]> then\n                            switch costume to (purple punch v)\n                            create clone of (_myself_ v)\n                        else\n                            switch costume to (icy blue v)\n                            create clone of (_myself_ v)\n                        end\n                    else\n                        if <(item (i) of [world v]) = [9]> then\n                            switch costume to (confusing green v)\n                            create clone of (_myself_ v)\n                        else\n                            if <(item (i) of [world v]) = [10]> then\n                                if <<(pick random (1) to (2)) = [1]> and <(completed levels) > [4]>> then\n                                    switch costume to (quick silver v)\n                                    create clone of (_myself_ v)\n                                else\n                                    switch costume to (regular red v)\n                                    create clone of (_myself_ v)\n                                end\n                            else\n                                if <(item (i) of [world v]) = [36]> then\n                                    switch costume to (black blindness v)\n                                    create clone of (_myself_ v)\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [spawn y v] by (1)\nend\n\ndefine laser check\nset [i v] to [1]\nrepeat ((length of [lasers v]) / (5))\n    get dist ((x) - (item ((i) + (1)) of [lasers v])) ((y) - (item ((i) + (2)) of [lasers v]))\n    if <(dist) < [32]> then\n        start sound (pick random (1) to (3))\n        add (item (i) of [lasers v]) to [delete lasers v]\n        add (x) to [particles v]\n        add (y) to [particles v]\n        if <(item ((i) + (4)) of [lasers v]) = [1]> then\n            change [xv v] by ((.35) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n            change [yv v] by ((.35) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n            change [health v] by (-1)\n            add [7] to [particles v]\n        else\n            if <(item ((i) + (4)) of [lasers v]) = [2]> then\n                change [xv v] by ((.1) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                change [yv v] by ((.1) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                change [health v] by (-.3)\n                add [8] to [particles v]\n            else\n                if <(item ((i) + (4)) of [lasers v]) = [3]> then\n                    change [xv v] by ((.25) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                    change [yv v] by ((.25) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                    change [health v] by (-.8)\n                    add [9] to [particles v]\n                else\n                    if <(item ((i) + (4)) of [lasers v]) = [4]> then\n                        change [xv v] by ((.1) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                        change [yv v] by ((.1) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                        change [health v] by (-.3)\n                        add [8] to [particles v]\n                    else\n                        if <(item ((i) + (4)) of [lasers v]) = [5]> then\n                            change [xv v] by ((.1) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                            change [yv v] by ((.1) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                            change [health v] by (-.3)\n                            add [8] to [particles v]\n                        end\n                    end\n                end\n            end\n        end\n        add [0] to [particles v]\n    end\n    change [i v] by (5)\nend\n\ndefine get dist (x) (y)\nset [dist v] to (([sqrt v] of (((x) * (x)) + ((y) * (y))) ) * (40))\n\nwhen I receive [start tick v]\nif  then\n    delete this clone\nend\nsetup\n\nwhen I receive [prerender v]\nif <not <(id) = [0]>> then\n    change [size v] by (((200) - (size)) * (.3))\n    set [temp v] to (costume [number v])\n    set size to (10000) %\n    switch costume to (aura v)\n    go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n    switch costume to (regular red v)\n    set size to ((size) / (CamZ)) %\n    if < [bw] contains (item ((temp) - (1)) of [colors v])?> then\n        set [brightness v] effect to ((200) * (<(item ((temp) - (1)) of [colors v]) = [w]> - (.5)))\n        set [ghost v] effect to ((50) + ((50) * ((1) - ((Health) / (3)))))\n    else\n        set [color v] effect to ((item ((temp) - (1)) of [colors v]) * (2))\n        set [ghost v] effect to ((75) + ((25) * ((1) - ((Health) / (3)))))\n    end\n    switch costume to (aura v)\n    stamp\n    clear graphic effects\n    switch costume to (temp)\nend\n\nwhen I receive [loading v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\nset [spawn x v] to ([x v] of [player v])\nset [spawn y v] to ([y v] of [player v])\n\nwhen I receive [boss spawn v]\nif <(id) = [0]> then\n    set [spawn x v] to (Boss X)\n    set [spawn y v] to (Boss Y)\n    if <(pick random (1) to (2)) = [1]> then\n        switch costume to (regular red v)\n        create clone of (_myself_ v)\n    else\n        if <(pick random (1) to (2)) = [1]> then\n            switch costume to (quick silver v)\n            create clone of (_myself_ v)\n        else\n            switch costume to (flaming orange v)\n            create clone of (_myself_ v)\n        end\n    end\nend\n\nwhen I receive [particle tick v]\nif <not <(id) = [0]>> then\n    add (x) to [enemy positions v]\n    add (y) to [enemy positions v]\n    wait (0) seconds\nend\n\n@Boss\n\ndefine get index at (x) (y)\nset [index v] to ((1) + ((x) + (([floor v] of (y) ) * (MapX))))\nset [tile v] to (item (index) of [world v])\n\nwhen I receive [game tick v]\nif <<<(Edit Mode) = [0]> and <(Current level) = [7]>> and <(Boss death animation) < [100]>> then\n    if <(id) = [0]> then\n        set [boss health v] to (Health)\n    end\n    if <(Boss health) > [0]> then\n        if <(id) = [0]> then\n            change [boss rotation speed v] by (((5) - (Boss rotation speed)) * (.05))\n            turn right (Boss rotation speed) degrees\n            get values (([x v] of [player v]) - (Boss X)) (([y v] of [player v]) - (Boss Y)) ([y v] of [player v])\n            set [player dist v] to (dist)\n            set [player dir v] to (dir)\n            get dist ((spawn x) - ([x v] of [player v])) ((spawn y) - ([y v] of [player v]))\n            get dir (spawn x) (spawn y) (Boss X) (Boss Y)\n            if <(Health) < [25]> then\n                set [spawn x v] to [30]\n                set [spawn y v] to [90]\n            else\n                if <(Health) < [50]> then\n                    set [spawn x v] to [70]\n                    set [spawn y v] to [85]\n                else\n                    if <(Health) < [70]> then\n                        set [spawn x v] to [120]\n                        set [spawn y v] to [80]\n                    end\n                end\n            end\n            if <((dist) / (40)) < [35]> then\n                change [boss xv v] by (((.02) * ([sin v] of (player dir) )) * (<(pick random (180) to (200)) < (player dist)> - (.5)))\n                change [boss yv v] by (((.02) * ([cos v] of (player dir) )) * (<(pick random (180) to (200)) < (player dist)> - (.5)))\n                set [boss fight v] to [1]\n                if <not <((player dist) / (40)) < [35]>> then\n                    set [cooldown v] to [60]\n                    set [frames v] to [-100]\n                    set [boss attack v] to [0]\n                    set [boss fire id v] to [0]\n                end\n            else\n                change [boss xv v] by (((.05) * ([sin v] of (dir) )) * (<(pick random (10) to (20)) < (dist)> - (.5)))\n                change [boss yv v] by (((.05) * ([cos v] of (dir) )) * (<(pick random (10) to (20)) < (dist)> - (.5)))\n                set [cooldown v] to [60]\n                set [frames v] to [-100]\n                set [boss attack v] to [0]\n                set [boss fire id v] to [0]\n            end\n            laser check\n            change [boss x v] by (Boss XV)\n            change [boss y v] by (Boss YV)\n            set [boss xv v] to ((Boss XV) * (.96))\n            set [boss yv v] to ((Boss YV) * (.96))\n            set [boss dir v] to (direction)\n            set [x v] to (Boss X)\n            set [y v] to (Boss Y)\n            get index at (x) (y)\n            change [cooldown v] by (-1)\n            if <<(cooldown) < [0]> and <not (item (tile) of [tiles: collidable? v])>> then\n                if <(pick random (1) to ((12) / ((1) + <(\[GAME MODE) = [2]>))) = [1]> then\n                    broadcast (boss spawn v)\n                    set [cooldown v] to [90]\n                    set [boss status v] to [2]\n                    set [frames v] to [-5]\n                    set [window v] to [15]\n                else\n                    if <(pick random (1) to (2)) = [1]> then\n                        set [boss attack v] to [1]\n                        set [cooldown v] to [25]\n                        if <(Boss status) = [1]> then\n                            broadcast (shuffle boss v)\n                        end\n                        set [boss status v] to [0]\n                        set [frames v] to [-10]\n                        set [window v] to [45]\n                    else\n                        if <(pick random (1) to (2)) = [1]> then\n                            set [boss attack v] to [2]\n                            set [cooldown v] to [75]\n                            if <(Boss status) = [1]> then\n                                broadcast (shuffle boss v)\n                            end\n                            set [boss status v] to [0]\n                            set [frames v] to [-10]\n                            set [window v] to [45]\n                        else\n                            if <(pick random (1) to (1)) = [1]> then\n                                set [boss attack v] to [3]\n                                set [cooldown v] to [75]\n                                if <(Boss status) = [1]> then\n                                    broadcast (shuffle boss v)\n                                end\n                                set [boss status v] to [0]\n                                set [frames v] to [-10]\n                                set [window v] to [45]\n                            end\n                        end\n                    end\n                end\n            end\n            change [window v] by (-1)\n            if <(window) < [0]> then\n                set [boss status v] to [1]\n            end\n            if <(Boss status) = [2]> then\n                change [frames v] by (1)\n                if <(frames) = [0]> then\n                    set [boss status v] to [0]\n                end\n            end\n            if <(Boss attack) = [1]> then\n                change [frames v] by (1)\n                if <(frames) = [1]> then\n                    set [boss fire id v] to [2]\n                else\n                    if <(frames) = [4]> then\n                        set [boss fire id v] to [3]\n                    else\n                        if <(frames) = [7]> then\n                            set [boss fire id v] to [1]\n                        else\n                            if <(frames) = [8]> then\n                                set [boss attack v] to [0]\n                                set [boss fire id v] to [0]\n                            else\n                                set [boss fire id v] to [0]\n                            end\n                        end\n                    end\n                end\n            else\n                if <(Boss attack) = [2]> then\n                    change [frames v] by (1)\n                    if <(frames) = [10]> then\n                        set [boss attack v] to [0]\n                        set [boss fire id v] to [0]\n                    else\n                        if <(frames) > [0]> then\n                            change [boss rotation speed v] by (3)\n                            set [boss fire id v] to ((1) + ((frames) mod (3)))\n                        end\n                    end\n                else\n                    if <(Boss attack) = [3]> then\n                        change [frames v] by (1)\n                        if <(frames) = [10]> then\n                            set [boss attack v] to [0]\n                            set [boss fire id v] to [0]\n                        else\n                            if <(frames) = [0]> then\n                                get attack dir\n                            else\n                                set [boss fire id v] to [0]\n                                if <<(frames) > [0]> and <((frames) mod (2)) = [0]>> then\n                                    change [boss rotation speed v] by (5)\n                                    set [boss fire id v] to (closest)\n                                    set [boss xv v] to ((Boss XV) * (.5))\n                                    set [boss yv v] to ((Boss YV) * (.5))\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        else\n            get index at (x) (y)\n            if <(Boss fire id) = (id)> then\n                if <not (item (tile) of [tiles: collidable? v])> then\n                    shoot projectile ((1) + (temp)) in direction (direction)\n                    set [open v] to ((open) / (2))\n                    change [boss xv v] by ((-.2) * ([sin v] of ((Boss dir) + (dir offset)) ))\n                    change [boss yv v] by ((-.2) * ([cos v] of ((Boss dir) + (dir offset)) ))\n                    change [boss rotation speed v] by (((6) - (Boss rotation speed)) * (.5))\n                end\n            end\n        end\n    else\n        if <(id) = [0]> then\n            hide variable [boss health v]\n            set [boss status v] to [0]\n            change [boss rotation speed v] by ((((2.5) + ((Boss death animation) / (5))) - (Boss rotation speed)) * (.02))\n            turn right (Boss rotation speed) degrees\n            change [boss x v] by (Boss XV)\n            change [boss y v] by (Boss YV)\n            set [boss xv v] to ((Boss XV) * (.9))\n            set [boss yv v] to (((Boss YV) + (.1)) * (.8))\n            set [boss dir v] to (direction)\n            change [boss x v] by (((25) - (Boss X)) * (.1))\n            change [boss y v] by ((((85) + ((Boss death animation) / (33.33334))) - (Boss Y)) * (.1))\n            set [x v] to (Boss X)\n            set [y v] to (Boss Y)\n            change [boss death animation v] by ((1) / (3))\n            if <(pick random (1) to (pick random (1) to (round (((100) - (Boss death animation)) / (3))))) = [1]> then\n                add (Boss X) to [particles v]\n                add (Boss Y) to [particles v]\n                add [14] to [particles v]\n                add (pick random (1) to (360)) to [particles v]\n            end\n            if <(Boss death animation) > [100]> then\n                set [beat the game? v] to [1]\n                kaboom\n                broadcast (boss die lolololololol v)\n                if <(\[GAME MODE) = [1]> then\n                    add record [time: (\[Speedrun timer) holder: (username) ]\n                end\n            end\n        else\n            set [open v] to ((open) * (pick random (1) to ((1) + ((Boss death animation) / (100)))))\n            set [ghost v] effect to ((pick random (0) to (Boss death animation)) * (.5))\n            change [color v] effect by ((pick random (0) to (Boss death animation)) * (.25))\n            change [brightness v] effect by ((pick random ((0) - (Boss death animation)) to (Boss death animation)) * (.25))\n        end\n    end\nend\n\ndefine get values (x) (y) (#)\nset [dir v] to (([atan v] of ((x) / (y)) ) + ((180) * <(#) < (y)>))\nget dist (x) (y)\n\ndefine setup\nset [spawn x v] to ((item # of [39] in [world v]) mod (MapX))\nset [spawn y v] to ([floor v] of ((item # of [39] in [world v]) / (MapX)) )\ngo to [front v] layer\ngo [backward v] (1) layers\npoint in direction (pick random (1) to (360))\nset [boss x v] to ((spawn x) + (pick random (-1) to (1.0)))\nset [boss y v] to ((spawn y) + (pick random (-1) to (1.0)))\nset [boss xv v] to [0]\nset [boss yv v] to [0]\nset [boss attack v] to [0]\nset [boss rotation speed v] to [0]\nset [boss status v] to [0]\nset [boss fire id v] to [0]\nset [boss dir v] to [0]\nset [frames v] to [1000]\nset [id v] to [0]\nset [health v] to [75]\nswitch costume to (triangle bit v)\nset [dir offset v] to [0]\nset [id v] to [1]\nrepeat (3)\n    create clone of (_myself_ v)\n    change [id v] by (1)\n    change [dir offset v] by (120)\nend\nset [id v] to [0]\n\ndefine laser check\nif <(window) > [0]> then\n    set [i v] to [1]\n    repeat ((length of [lasers v]) / (5))\n        get dist ((x) - (item ((i) + (1)) of [lasers v])) ((y) - (item ((i) + (2)) of [lasers v]))\n        if <(dist) < [120]> then\n            start sound (pick random (1) to (3))\n            add (item (i) of [lasers v]) to [delete lasers v]\n            add (x) to [particles v]\n            add (y) to [particles v]\n            if <(item ((i) + (4)) of [lasers v]) = [1]> then\n                change [boss xv v] by ((.15) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                change [boss yv v] by ((.15) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                change [health v] by (-1)\n                add [7] to [particles v]\n            else\n                if <(item ((i) + (4)) of [lasers v]) = [2]> then\n                    change [boss xv v] by ((.05) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                    change [boss yv v] by ((.05) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                    change [health v] by (-.3)\n                    add [8] to [particles v]\n                else\n                    if <(item ((i) + (4)) of [lasers v]) = [3]> then\n                        change [boss xv v] by ((.1) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                        change [boss yv v] by ((.1) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                        change [health v] by (-.8)\n                        add [9] to [particles v]\n                    else\n                        if <(item ((i) + (4)) of [lasers v]) = [4]> then\n                            change [boss xv v] by ((.05) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                            change [boss yv v] by ((.05) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                            change [health v] by (-.3)\n                            add [8] to [particles v]\n                        else\n                            if <(item ((i) + (4)) of [lasers v]) = [5]> then\n                                change [boss xv v] by ((.05) * ([sin v] of (item ((i) + (3)) of [lasers v]) ))\n                                change [boss yv v] by ((.05) * ([cos v] of (item ((i) + (3)) of [lasers v]) ))\n                                change [health v] by (-.3)\n                                add [8] to [particles v]\n                            end\n                        end\n                    end\n                end\n            end\n            add [0] to [particles v]\n        end\n        change [i v] by (5)\n    end\nend\n\ndefine get dist (x) (y)\nset [dist v] to (([sqrt v] of (((x) * (x)) + ((y) * (y))) ) * (40))\n\nwhen I receive [start tick v]\nset [boss fight v] to [0]\nhide variable [boss health v]\nif  then\n    delete this clone\nend\nif <(Current level) = [7]> then\n    setup\nend\n\nwhen I receive [render tick v]\nif <<(Current level) = [7]> and <(Boss death animation) < [100]>> then\n    if <(id) = [0]> then\n        set [temp v] to [1]\n        set size to (10000) %\n        switch costume to (aura v)\n        go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n        switch costume to (body shape3 v)\n        set size to ((400) / (CamZ)) %\n        set [color v] effect to (boss color)\n        set [brightness v] effect to (boss brightness)\n        set [ghost v] effect to ((25) + ((75) * ((1) - ((Health) / (15)))))\n        switch costume to (aura v)\n        stamp\n        set [ghost v] effect to (0)\n        switch costume to (triangle bit v)\n        change [open v] by ((((0) + ((400) * <(Boss status) = [1]>)) - (open)) * (.5))\n        set size to ((open) / (CamZ)) %\n        switch costume to (body shape4 v)\n        stamp\n        set [color v] effect to ((Boss color) / (3))\n        set [brightness v] effect to ((Boss brightness) / (3))\n        set size to ((400) / (CamZ)) %\n        switch costume to (body shape3 v)\n        stamp\n        switch costume to (body shape5 v)\n        clear graphic effects\n        stamp\n        if <(Boss status) = [1]> then\n            add (Boss X) to [enemy positions v]\n            add (Boss Y) to [enemy positions v]\n        end\n    else\n        set size to (10000) %\n        switch costume to (aura v)\n        change [open v] by ((.5) * <(Boss status) = [2]>)\n        change [open v] by ((((.9) + ((.6) * <(Boss status) = [0]>)) - (open)) * (.5))\n        set [x v] to ((Boss X) + ((open) * ([sin v] of ((Boss dir) + (dir offset)) )))\n        set [y v] to ((Boss Y) + ((open) * ([cos v] of ((Boss dir) + (dir offset)) )))\n        go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n        point in direction ((Boss dir) + (dir offset))\n        switch costume to (triangle bit v)\n        set size to ((400) / (CamZ)) %\n        stamp\n    end\nend\n\nwhen I receive [loading v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\ndefine shoot projectile (type) in direction (dir)\nadd (x) to [projectiles v]\nadd (y) to [projectiles v]\nif <(type) < [7]> then\n    add (type) to [projectiles v]\nelse\n    add ((4) + (type)) to [projectiles v]\nend\nadd (dir) to [projectiles v]\n\nwhen I start as a clone\nset [temp v] to (pick random (2) to (8))\n\ndefine get dir (x1) (y1) (x2) (y2)\nset [dir v] to (([atan v] of (((x2) - (x1)) / ((y2) - (y1))) ) + ((180) * <(y1) < (y2)>))\n\nwhen I receive [particle tick v]\nchange [interpolate v] by ((<(Boss status) = [0]> - (interpolate)) * (.5))\nif <not <(id) = [0]>> then\n    if < [bw] contains (item (temp) of [colors v])?> then\n        set [a v] to ((Boss color) / (3))\n    else\n        set [b v] to [0]\n    end\n    set [brightness v] effect to (((b) * (interpolate)) + ((boss brightness) * ((1) - (interpolate))))\n    set [color v] effect to (((a) * (interpolate)) + ((boss color) * ((1) - (interpolate))))\nend\n\nwhen I receive [prerender v]\nif <(id) = [0]> then\n    set [boss color v] to [0]\n    set [boss brightness v] to [0]\nelse\n    if < [bw] contains (item (temp) of [colors v])?> then\n        set [b v] to ((200) * (<(item (temp) of [colors v]) = [w]> - (.5)))\n    else\n        set [a v] to ((item (temp) of [colors v]) * (2))\n    end\n    if <not < [b] contains (item (temp) of [colors v])?>> then\n        change [boss brightness v] by (b)\n    end\n    change [boss color v] by (a)\nend\n\nwhen I receive [shuffle boss v]\nif <not <(id) = [0]>> then\n    if <(pick random (1) to (2)) = [1]> then\n        if <(pick random (1) to (2)) = [1]> then\n            if <(pick random (1) to (2)) = [1]> then\n                set [temp v] to [1]\n            else\n                set [temp v] to [7]\n            end\n        else\n            if <(pick random (1) to (2)) = [1]> then\n                set [temp v] to (pick random (4) to (7))\n            else\n                set [temp v] to (pick random (1) to (4))\n            end\n        end\n    end\nend\n\nwhen I receive [parallax v]\nif <(id) = [0]> then\n    change [boss color v] by ((((Boss color) / (3)) - (boss color)) * (.01))\n    change [boss brightness v] by ((((Boss brightness) / (3)) - (boss brightness)) * (.01))\nend\n\nset [boss x v] to ((spawn x) + (pick random (-1) to (1)))\nset [boss y v] to ((spawn y) + (pick random (-1) to (1)))\n\ndefine get attack dir\nget dist (((Boss X) + ([sin v] of ((Boss dir) + (0)) )) - ([x v] of [player v])) (((Boss Y) + ([cos v] of ((Boss dir) + (0)) )) - ([y v] of [player v]))\nset [dist 2 v] to (dist)\nget dist (((Boss X) + ([sin v] of ((Boss dir) + (120)) )) - ([x v] of [player v])) (((Boss Y) + ([cos v] of ((Boss dir) + (120)) )) - ([y v] of [player v]))\nif <(dist 2) < (dist)> then\n    get dist (((Boss X) + ([sin v] of ((Boss dir) + (240)) )) - ([x v] of [player v])) (((Boss Y) + ([cos v] of ((Boss dir) + (240)) )) - ([y v] of [player v]))\n    if <(dist 2) < (dist)> then\n        set [closest v] to [1]\n    else\n        set [closest v] to [3]\n    end\nelse\n    set [dist 2 v] to (dist)\n    get dist (((Boss X) + ([sin v] of ((Boss dir) + (240)) )) - ([x v] of [player v])) (((Boss Y) + ([cos v] of ((Boss dir) + (240)) )) - ([y v] of [player v]))\n    if <(dist 2) < (dist)> then\n        set [closest v] to [2]\n    else\n        set [closest v] to [3]\n    end\nend\n\nwhen I receive [start tick v]\nset [boss death animation v] to [0]\n\ndefine kaboom\nrepeat (30)\n    add (Boss X) to [particles v]\n    add (Boss Y) to [particles v]\n    add [14] to [particles v]\n    add (pick random (1) to (360)) to [particles v]\nend\n\ndefine get records\ndelete all of [top 8 world records v]\ndelete all of [record sort v]\ndelete all of [record holders v]\nset [i v] to [0]\nset [tile v] to [0]\nrepeat (8)\n    change [i v] by (1)\n    change [tile v] by (1)\n    set [temp v] to []\n    repeat (letter (i) of (☁ Top 8 world records))\n        change [i v] by (1)\n        set [temp v] to (join (temp) (letter (i) of (☁ Top 8 world records)))\n    end\n    add (temp) to [record sort v]\n    if <not <((0) + (temp)) = [0]>> then\n        if <(((temp) / (100)) mod (60)) < [10]> then\n            if <([floor v] of ((temp) mod (100)) ) < [10]> then\n                set [temp v] to (join ([floor v] of (((temp) / (100)) / (60)) ) (join [:0] (join ([floor v] of (((temp) / (100)) mod (60)) ) (join [.0] ([floor v] of ((temp) mod (100)) )))))\n            else\n                set [temp v] to (join ([floor v] of (((temp) / (100)) / (60)) ) (join [:0] (join ([floor v] of (((temp) / (100)) mod (60)) ) (join [.] ([floor v] of ((temp) mod (100)) )))))\n            end\n        else\n            if <([floor v] of ((temp) mod (100)) ) < [10]> then\n                set [temp v] to (join ([floor v] of (((temp) / (100)) / (60)) ) (join [:] (join ([floor v] of (((temp) / (100)) mod (60)) ) (join [.0] ([floor v] of ((temp) mod (100)) )))))\n            else\n                set [temp v] to (join ([floor v] of (((temp) / (100)) / (60)) ) (join [:] (join ([floor v] of (((temp) / (100)) mod (60)) ) (join [.] ([floor v] of ((temp) mod (100)) )))))\n            end\n        end\n        add (temp) to [top 8 world records v]\n    end\n    set [temp v] to []\n    change [i v] by (2)\n    repeat (join (letter ((i) + (-1)) of (☁ Top 8 world records)) (letter (i) of (☁ Top 8 world records)))\n        set [temp v] to (join (temp) (item (join (letter ((i) + (1)) of (☁ Top 8 world records)) (letter ((i) + (2)) of (☁ Top 8 world records))) of [encoding2 v]))\n        change [i v] by (2)\n    end\n    add (temp) to [record holders v]\n    if <(tile) = [1]> then\n        replace item (tile) of [top 8 world records v] with (join (item (tile) of [top 8 world records v]) (join [ by ] (join [♕] (temp))))\n    else\n        replace item (tile) of [top 8 world records v] with (join (item (tile) of [top 8 world records v]) (join [ by ] (temp)))\n    end\nend\n\ndefine add record [time: (time) holder: (name) ]\nget records\nset [temp v] to (round ((time) * (100)))\nif <[record holders v] contains (name)?> then\n    if <((temp) + (1)) < (item (item # of (name) in [record holders v]) of [record sort v])> then\n        delete (item # of (name) in [record holders v]) of [record sort v]\n        delete (item # of (name) in [record holders v]) of [record holders v]\n    else\n        encode records to cloud\n        stop [this script v]\n    end\nend\nset [i v] to [1]\nrepeat until <<((temp) + (1)) < (item (i) of [record sort v])> or <(item (i) of [record sort v]) = []>>\n    change [i v] by (1)\nend\nif <<((temp) + (1)) < (item (i) of [record sort v])> or <(item (i) of [record sort v]) = []>> then\n    insert (temp) at (i) of [record sort v] \n    insert (name) at (i) of [record holders v] \n    delete (9) of [record sort v]\n    delete (9) of [record holders v]\nend\nencode records to cloud\n\ndefine encode records to cloud\nset [i v] to [0]\nset [temp v] to []\nrepeat (8)\n    change [i v] by (1)\n    set [temp v] to (join (temp) (join (length of (item (i) of [record sort v])) (item (i) of [record sort v])))\n    if <(length of (length of (item (i) of [record holders v]))) < [2]> then\n        set [temp v] to (join (temp) (join [0] (length of (item (i) of [record holders v]))))\n    else\n        set [temp v] to (join (temp) (length of (item (i) of [record holders v])))\n    end\n    set [tile v] to [0]\n    repeat (length of (item (i) of [record holders v]))\n        change [tile v] by (1)\n        if <(length of (item # of (letter (tile) of (item (i) of [record holders v])) in [encoding2 v])) < [2]> then\n            set [temp v] to (join (temp) (join [0] (item # of (letter (tile) of (item (i) of [record holders v])) in [encoding2 v])))\n        else\n            set [temp v] to (join (temp) (item # of (letter (tile) of (item (i) of [record holders v])) in [encoding2 v]))\n        end\n    end\n    if <(length of (temp)) > [230]> then\n        set [☁ top 8 world records v] to (temp)\n        stop [this script v]\n    end\nend\nset [☁ top 8 world records v] to (temp)\nget records\n\nwhen I receive [pause v]\nif <(id) = [0]> then\n    get records\nend\n\nwhen flag clicked\nshow list [top 8 world records v]\n\nwhen flag clicked\nset [boss fight v] to [0]\nhide variable [boss health v]\n\nset [☁ top 8 world records v] to []\n\n@Projectiles\n\ndefine get index at (x) (y)\nset [index v] to ((1) + ((x) + (([floor v] of (y) ) * (MapX))))\nset [tile v] to (item (index) of [world v])\n\nwhen I receive [game tick v]\nif <(id) = [0]> then\n    delete all of [lasers v]\n    spawn projectiles\nend\nif <<(Edit Mode) = [0]> and <not <(id) = [0]>>> then\n    show\n    compute collisions with substeps [3]\nend\n\nwhen I start as a clone\ngo to [back v] layer\nset [id v] to (pick random (1) to (99999999999999999999999))\nset [x v] to (item (1) of [projectiles v])\nset [y v] to (item (2) of [projectiles v])\nset [size v] to [0]\nswitch costume to (item (3) of [projectiles v])\npoint in direction (item (4) of [projectiles v])\nif <[player projectile types v] contains (costume [number v])?> then\n    set [xv v] to ((item (item # of (costume [number v]) in [player projectile types v]) of [player projectile speeds v]) * ([sin v] of (direction) ))\n    set [yv v] to ((item (item # of (costume [number v]) in [player projectile types v]) of [player projectile speeds v]) * ([cos v] of (direction) ))\nelse\n    if <(costume [number v]) = [12]> then\n        set [xv v] to ((.6) * ([sin v] of (direction) ))\n        set [yv v] to ((.6) * ([cos v] of (direction) ))\n    else\n        set [xv v] to (((.3) * ((1) + ((<(\[GAME MODE) = [2]> + <(\[GAME MODE) = [3]>) * ((1) / (3))))) * ([sin v] of (direction) ))\n        set [yv v] to (((.3) * ((1) + ((<(\[GAME MODE) = [2]> + <(\[GAME MODE) = [3]>) * ((1) / (3))))) * ([cos v] of (direction) ))\n    end\nend\ndelete (1) of [projectiles v]\ndelete (1) of [projectiles v]\ndelete (1) of [projectiles v]\ndelete (1) of [projectiles v]\n\ndefine spawn projectiles\nrepeat ((length of [projectiles v]) / (4))\n    create clone of (_myself_ v)\nend\n\ndefine compute collisions with substeps (s)\nrepeat (s)\n    change [x v] by ((xv) / (s))\n    change [y v] by ((yv) / (s))\n    get index at (x) (y)\n    if <<(item (tile) of [tiles: collidable? v]) = [true]> or <<<(tile) = []> or <(x) < [0]>> or <(MapX) < (x)>>> then\n        particles\n        delete this clone\n    end\n    get dist ((x) - ([x v] of [player v])) ((y) - ([y v] of [player v]))\n    if <<not <[player projectile types v] contains (costume [number v])?>> and <<(dist) < [2]> and <<(item (2) of [items v]) = [1]> and <<key (space v) pressed?> and <([buff var v] of [player v]) < [3]>>>>> then\n        set [hurt player v] to [-1]\n        particles\n        delete this clone\n    end\n    if <<not <[player projectile types v] contains (costume [number v])?>> and <<([abs v] of ((x) - ([x v] of [player v])) ) < [.3]> and <([abs v] of ((y) - ([y v] of [player v])) ) < [.6]>>> then\n        set [hurt direction v] to (direction)\n        if <((costume [number v]) - (1)) > [6]> then\n            set [hurt player v] to ((costume [number v]) - (5))\n        else\n            set [hurt player v] to ((costume [number v]) - (1))\n        end\n        particles\n        delete this clone\n    end\nend\nif <[player projectile types v] contains (costume [number v])?> then\n    if <[delete lasers v] contains (id)?> then\n        delete (item # of (id) in [delete lasers v]) of [delete lasers v]\n        particles\n        delete this clone\n    else\n        add (id) to [lasers v]\n        add (x) to [lasers v]\n        add (y) to [lasers v]\n        add (direction) to [lasers v]\n        add (item # of (costume [number v]) in [player projectile types v]) to [lasers v]\n    end\nend\n\ndefine particles\nif <((costume [number v]) - (1)) = [1]> then\n    repeat (3)\n        add (x) to [particles v]\n        add (y) to [particles v]\n        add [1] to [particles v]\n        add (direction) to [particles v]\n    end\nelse\n    if <((costume [number v]) - (1)) = [2]> then\n        add (x) to [particles v]\n        add (y) to [particles v]\n        add [2] to [particles v]\n        add [0] to [particles v]\n    else\n        if <((costume [number v]) - (1)) = [3]> then\n            repeat (6)\n                add (x) to [particles v]\n                add (y) to [particles v]\n                add [4] to [particles v]\n                add (direction) to [particles v]\n            end\n        else\n            if <((costume [number v]) - (1)) = [4]> then\n                repeat (6)\n                    add (x) to [particles v]\n                    add (y) to [particles v]\n                    add [3] to [particles v]\n                    add (direction) to [particles v]\n                end\n            else\n                if <((costume [number v]) - (1)) = [5]> then\n                    repeat (5)\n                        add (x) to [particles v]\n                        add (y) to [particles v]\n                        add [6] to [particles v]\n                        add (direction) to [particles v]\n                    end\n                else\n                    if <[player projectile types v] contains (costume [number v])?> then\n                        if <((costume [number v]) - (1)) = [12]> then\n                            repeat (4)\n                                add (x) to [particles v]\n                                add (y) to [particles v]\n                                add [13] to [particles v]\n                                add (direction) to [particles v]\n                            end\n                        else\n                            repeat (4)\n                                add (x) to [particles v]\n                                add (y) to [particles v]\n                                add [5] to [particles v]\n                                add (direction) to [particles v]\n                            end\n                        end\n                    else\n                        if <((costume [number v]) - (1)) = [10]> then\n                            repeat (6)\n                                add (x) to [particles v]\n                                add (y) to [particles v]\n                                add [11] to [particles v]\n                                add (direction) to [particles v]\n                            end\n                        else\n                            if <((costume [number v]) - (1)) = [11]> then\n                                repeat (5)\n                                    add (x) to [particles v]\n                                    add (y) to [particles v]\n                                    add [12] to [particles v]\n                                    add (direction) to [particles v]\n                                end\n                            else\n                                if <((costume [number v]) - (1)) = [12]> then\n                                    repeat (3)\n                                        add (x) to [particles v]\n                                        add (y) to [particles v]\n                                        add [13] to [particles v]\n                                        add (direction) to [particles v]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [start tick v]\nif  then\n    delete this clone\nend\nset [id v] to [0]\ndelete all of [delete lasers v]\n\nwhen I receive [prerender v]\nif <not <(id) = [0]>> then\n    set [temp v] to (costume [number v])\n    set size to (10000) %\n    switch costume to (aura v)\n    go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n    set size to ((size) / (CamZ)) %\n    switch costume to (temp)\n    if < [bw] contains (item ((costume [number v]) - (1)) of [colors v])?> then\n        set [brightness v] effect to ((200) * (<(item ((costume [number v]) - (1)) of [colors v]) = [w]> - (.5)))\n    else\n        set [color v] effect to ((item ((costume [number v]) - (1)) of [colors v]) * (2))\n    end\n    set [ghost v] effect to (75)\n    switch costume to (aura v)\n    stamp\n    clear graphic effects\n    switch costume to (temp)\n    change [size v] by (((200) - (size)) * (.5))\nend\n\ndefine get dist (x) (y)\nset [dist v] to ([abs v] of (((x) * (x)) + ((y) * (y))) )\n\nwhen I receive [loading v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\n@Particles\n\nwhen I start as a clone\nset [lifetime v] to [0]\nset [x v] to (item (1) of [particles v])\nset [y v] to (item (2) of [particles v])\ngo to [back v] layer\nswitch costume to (item (3) of [particles v])\npoint in direction (item (4) of [particles v])\nset [id v] to (costume [number v])\ndelete (1) of [particles v]\ndelete (1) of [particles v]\ndelete (1) of [particles v]\ndelete (1) of [particles v]\nset [turn v] to (pick random (-8) to (8))\nif <(id) = [1]> then\n    set [size v] to (pick random (.75) to (1))\n    set [xv v] to ((pick random (-.2) to (.2)) + ((.2) * ([sin v] of (direction) )))\n    set [yv v] to ((pick random (-.2) to (.2)) + ((.2) * ([cos v] of (direction) )))\nelse\n    if <(id) = [2]> then\n        set [size v] to [.125]\n        set [xv v] to [0]\n        set [yv v] to [0]\n    else\n        if <(id) = [3]> then\n            set [size v] to (pick random (.8) to (2))\n            set [xv v] to ((pick random (-.2) to (.2)) + ((.3) * ([sin v] of (direction) )))\n            set [yv v] to ((pick random (-.2) to (.2)) + ((.1) * ([cos v] of (direction) )))\n            set [brightness v] effect to (pick random (-20) to (50))\n        else\n            if <(id) = [4]> then\n                set [size v] to (pick random (.8) to (2))\n                set [xv v] to ((pick random (-.2) to (.2)) + ((.3) * ([sin v] of (direction) )))\n                set [yv v] to ((pick random (-.2) to (.2)) + ((.1) * ([cos v] of (direction) )))\n                set [brightness v] effect to (pick random (-20) to (50))\n            else\n                if <<(id) = [5]> or <(id) = [13]>> then\n                    set [size v] to (pick random (.8) to (1.2))\n                    set [xv v] to ((pick random (-.4) to (.4)) + ((.8) * ([sin v] of (direction) )))\n                    set [yv v] to ((pick random (-.4) to (.4)) + ((.8) * ([cos v] of (direction) )))\n                    set [brightness v] effect to (pick random (-20) to (50))\n                else\n                    if <(id) = [6]> then\n                        set [size v] to (pick random (1) to (1.5))\n                        set [xv v] to ((pick random (-.2) to (.2)) + ((.3) * ([sin v] of (direction) )))\n                        set [yv v] to ((pick random (-.2) to (.2)) + ((.3) * ([cos v] of (direction) )))\n                        set [brightness v] effect to (pick random (-50) to (20))\n                    else\n                        if <<(id) > [6]> and <(id) < [11]>> then\n                            set [size v] to [1]\n                            set [xv v] to (pick random (-.2) to (.2))\n                            set [yv v] to (pick random (.1) to (.3))\n                        else\n                            if <(id) = [11]> then\n                                set [size v] to (pick random (1) to (1.5))\n                                set [xv v] to ((pick random (-.2) to (.2)) + ((.3) * ([sin v] of (direction) )))\n                                set [yv v] to ((pick random (-.2) to (.2)) + ((.3) * ([cos v] of (direction) )))\n                            else\n                                if <(id) = [12]> then\n                                    set [size v] to (pick random (.5) to (1.5))\n                                    set [xv v] to ((pick random (-.2) to (.2)) + ((.6) * ([sin v] of (direction) )))\n                                    set [yv v] to ((pick random (-.2) to (.2)) + ((.6) * ([cos v] of (direction) )))\n                                else\n                                    if <(id) = [14]> then\n                                        set [size v] to [-1]\n                                        set [xv v] to ((pick random (0) to (1.1)) * ([sin v] of (direction) ))\n                                        set [yv v] to ((pick random (0) to (1.1)) * ([cos v] of (direction) ))\n                                        change [x v] by (xv)\n                                        change [y v] by (yv)\n                                    else\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine spawn particles\nrepeat ((length of [particles v]) / (4))\n    create clone of (_myself_ v)\nend\n\nwhen I receive [render tick v]\nif <(id) = [0]> then\n    hide\n    spawn particles\nelse\n    show\n    set size to (10000) %\n    go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: (((((y) * (40)) - (CamY)) / (CamZ)) - (180))\n    set size to (((200) * (size)) / (CamZ)) %\n    set [ghost v] effect to ((10) * (lifetime))\nend\n\nwhen I receive [particle tick v]\nif <(id) = [0]> then\n\nwhen I receive [start tick v]\nif  then\n    delete this clone\nend\nset [id v] to [0]\n\nwhen I receive [loading v]\nif  then\n    delete this clone\nend\nstop [other scripts in sprite v]\nhide\n\n@Level Goal\n\nwhen I receive [particle tick v]\nclear graphic effects\nif <(Goal!) = [1]> then\n    go to [front v] layer\n    switch costume to (fragment1 v)\n    set size to (10000) %\n    switch costume to (aura v)\n    change x by (((x) - (x position)) * (.3))\n    change y by (((y) - (y position)) * (.3))\n    turn right (turn) degrees\n    switch costume to (fragment1 v)\n    set size to ((size) / (CamZ)) %\n    switch costume to (aura v)\n    set [ghost v] effect to (aura ghost)\n    if <(completed levels) < (Current level)> then\n        set [color v] effect to (0)\n    else\n        set [color v] effect to (44)\n    end\n    stamp\n    set [ghost v] effect to (0)\n    switch costume to (temp)\n    set [y v] to ((1.15) * (y))\n    set [turn v] to ((1.05) * (turn))\n    set [size v] to ((1.025) * (size))\n    if <(y) > [1600]> then\n        set [goal! v] to [2]\n        broadcast (win screen v)\n    end\nelse\n    if <<(Goal!) = [2]> or <<(Current level) = [7]> and <(Boss death animation) < [100]>>> then\n        if <(Current level) = [7]> then\n            set [aura ghost v] to [100]\n            set [x v] to (Boss X)\n            set [y v] to (Boss Y)\n            point in direction (Boss dir)\n        end\n        hide\n    else\n        switch costume to (fragment1 v)\n        set size to (10000) %\n        switch costume to (aura v)\n        go to x: (((((x) * (40)) - (CamX)) / (CamZ)) - (240)) y: ((((((y) + ((.25) * ([sin v] of ((360) * ([timer v] of [player v])) ))) * (40)) - (CamY)) / (CamZ)) - (180))\n        turn right (10) degrees\n        switch costume to (fragment1 v)\n        set size to ((200) / (CamZ)) %\n        switch costume to (aura v)\n        set [ghost v] effect to (aura ghost)\n        if <(completed levels) < (Current level)> then\n            set [color v] effect to (0)\n        else\n            set [color v] effect to (44)\n        end\n        stamp\n        switch costume to (temp)\n        set [ghost v] effect to ()\n        if <(Current level) = [7]> then\n            set size to (((200) + (((aura ghost) - (60)) / (.2))) / (CamZ)) %\n            change [x v] by (((10.5) - (x)) * (.05))\n            change [y v] by (((85.5) - (y)) * (.05))\n            change [aura ghost v] by (((60) - (aura ghost)) * (.05))\n        end\n    end\nend\n\nwhen I receive [start tick v]\nset [aura ghost v] to [60]\nset [goal! v] to [0]\nif <[world v] contains [32]?> then\n    set [x v] to ((-.5) + ((item # of [32] in [world v]) mod (MapX)))\n    set [y v] to ((.5) + ([floor v] of ((item # of [32] in [world v]) / (MapX)) ))\n    show\n    set [temp v] to (pick random (1) to (3))\nelse\n    hide\nend\n\nwhen I receive [win v]\nset [x v] to [0]\nset [y v] to [1]\nset [turn v] to [10]\nset [goal! v] to [1]\nset [size v] to [200]\n\nwhen flag clicked\nhide\n\nwhen I receive [boss die lolololololol v]\nset [aura ghost v] to [100]\nset [x v] to (Boss X)\nset [y v] to (Boss Y)\npoint in direction (Boss dir)\nshow\nset [temp v] to [4]\n\n@Parallaxes\n\nwhen I receive [parallax v]\nif <(main menu) = [1]> then\n    change [x v] by (((mouse x) - (x)) * (.05))\n    change [y v] by (((mouse y) - (y)) * (.05))\n    switch costume to (i am so small, v)\n    set size to (200) %\n    switch costume to (menu3 v)\n    go to x: ((x) / (-14)) y: ((y) / (-14))\n    set size to (100) %\n    stamp\n    switch costume to (i am so small, v)\n    set size to (200) %\n    switch costume to (menu2 v)\n    go to x: ((x) / (-10)) y: ((y) / (-10))\n    set size to (100) %\n    stamp\n    switch costume to (i am so small, v)\n    set size to (200) %\n    switch costume to (menu3 v)\n    go to x: ((x) / (-6)) y: ((y) / (-6))\n    switch costume to (menu1 v)\n    set size to (100) %\n    stamp\nelse\n    if <(Current level) = [5]> then\n        if <(CamY) < [2950]> then\n            switch backdrop to (level5-2 v)\n        else\n            switch backdrop to (level5-1 v)\n        end\n    end\n    if <<(Current level) > [0]> and <not <(backdrop [name v]) = [level5-2]>>> then\n        set [x v] to ((((CamX) * (40)) / (MapX)) + (-960))\n        set [y v] to [0]\n        switch costume to (join (Current level) [3])\n        go to x: ((x) / (-12)) y: ((y) / (-12))\n        stamp\n        switch costume to (join (Current level) [2])\n        go to x: ((x) / (-10)) y: ((y) / (-10))\n        stamp\n        switch costume to (join (Current level) [1])\n        go to x: ((x) / (-8)) y: ((y) / (-8))\n        stamp\n    end\nend\n\nwhen I receive [loading v]\nset [main menu v] to [0]\nstop [other scripts in sprite v]\n\nwhen I receive [intro done v]\nset [x v] to [0]\nset [y v] to [8000]\nset [main menu v] to [1]\nforever\n    erase all\n    broadcast (parallax v)\nend\n\nset [brightness v] effect to (0)\nrepeat (60)\n    erase all\n    broadcast (parallax v)\nend\n\nwhen I receive [title v]\nwait (1) seconds\nset [x v] to [0]\nset [y v] to [8000]\nrepeat (200)\n    change [x v] by (((0) - (x)) * (.05))\n    change [y v] by (((0) - (y)) * (.05))\n    switch costume to (i am so small, v)\n    set size to (200) %\n    switch costume to (menu3 v)\n    go to x: ((x) / (-14)) y: ((y) / (-14))\n    set size to (100) %\n    stamp\n    switch costume to (i am so small, v)\n    set size to (200) %\n    switch costume to (menu2 v)\n    go to x: ((x) / (-10)) y: ((y) / (-10))\n    set size to (100) %\n    stamp\n    switch costume to (i am so small, v)\n    set size to (200) %\n    switch costume to (menu3 v)\n    go to x: ((x) / (-6)) y: ((y) / (-6))\n    switch costume to (menu1 v)\n    set size to (100) %\n    stamp\nend\n\n@Intro\n\ndefine move type (1) frame duration (2) cut speed (3)\nset [i2 v] to (1)\nset [i1 v] to (2)\nif <(1) = [0]> then\n    go to x: (0) y: (0)\n    set [brightness v] to [-100]\n    repeat (3)\n        change [brightness v] by ((100) / (3))\n        if <(brightness) > [0]> then\n            set [brightness v] to [0]\n        end\n        set [brightness v] effect to (brightness)\n    end\n    repeat (3)\n        repeat (2)\n            go to x: (0) y: (0)\n        end\n        create clone of (_myself_ v)\n        next costume\n    end\n    repeat (2)\n        go to x: (0) y: (0)\n    end\n    repeat (3)\n        change [brightness v] by ((-100) / (3))\n        if <[-100] > (brightness)> then\n            set [brightness v] to [-100]\n        end\n        set [brightness v] effect to (brightness)\n    end\nelse\n    if <(1) = [1]> then\n        go to x: (120) y: (0)\n        set [brightness v] to [-100]\n        repeat (3)\n            change [brightness v] by ((100) / (3))\n            if <(brightness) > [0]> then\n                set [brightness v] to [0]\n            end\n            set [brightness v] effect to (brightness)\n            change x by ((-30) / (2))\n        end\n        repeat (3)\n            repeat (2)\n                change x by ((-30) / (2))\n            end\n            create clone of (_myself_ v)\n            next costume\n        end\n        repeat (2)\n            change x by ((-30) / (2))\n        end\n        repeat (3)\n            change [brightness v] by ((-100) / (3))\n            if <[-100] > (brightness)> then\n                set [brightness v] to [-100]\n            end\n            set [brightness v] effect to (brightness)\n            change x by ((-30) / (2))\n        end\n    else\n        if <(1) = [2]> then\n            go to x: (0) y: (90)\n            set [brightness v] to [-100]\n            repeat (3)\n                change [brightness v] by ((100) / (3))\n                if <(brightness) > [0]> then\n                    set [brightness v] to [0]\n                end\n                set [brightness v] effect to (brightness)\n                change y by ((-30) / (2))\n            end\n            repeat (3)\n                repeat (2)\n                    change y by ((-30) / (2))\n                end\n                create clone of (_myself_ v)\n                next costume\n            end\n            repeat (2)\n                change y by ((-30) / (2))\n            end\n            repeat (3)\n                change [brightness v] by ((-100) / (3))\n                if <[-100] > (brightness)> then\n                    set [brightness v] to [-100]\n                end\n                set [brightness v] effect to (brightness)\n                change y by ((-30) / (2))\n            end\n        end\n    end\nend\n\nwhen flag clicked\nshow\nset [pitch v] effect to (0)\nstart sound [RPT intro v]\nswitch costume to (ruby2 v)\ncreate clone of (_myself_ v)\nswitch costume to (intro 1-1 v)\n\nstart sound [Compass Wild World intro v]\nreset timer\nshow\ngo to [front v] layer\nswitch costume to (launch1 v)\nmove type [2] frame duration [30] cut speed [10]\nwait until <(timer) > ((17) / (3))>\nswitch costume to (landing1 v)\nmove type [1] frame duration [30] cut speed [10]\nwait until <(timer) > ((34) / (3))>\nswitch costume to (flag1 v)\nmove type [1] frame duration [30] cut speed [10]\nwait until <(timer) > (((17) * (3)) / (3))>\nswitch costume to (sunrise1 v)\nmove type [1] frame duration [30] cut speed [10]\nwait until <(timer) > (((17) * (4)) / (3))>\nswitch costume to (city1 v)\nmove type [1] frame duration [30] cut speed [10]\nwait until <(timer) > (((17) * (6)) / (3))>\nswitch costume to (attack1 v)\nmove type [0] frame duration [30] cut speed [10]\nstop all sounds\nhide\n\nwhen I start as a clone\nif <(costume [name v]) = [Intro 1-1]> then\n    delete this clone\nelse\n    if <(costume [name v]) = [costume1]> then\n        set size to (100) %\n        go [forward v] (1) layers\n        repeat (60)\n            change size by (((484) - (size)) * (.125))\n        end\n        delete this clone\n    else\n        if <(costume [name v]) = [Ruby]> then\n            set size to (100) %\n            repeat (8)\n                change size by (((480) - (size)) * (.1))\n            end\n            go to x: (-110) y: (0)\n            switch costume to (teamtxt v)\n            create clone of (_myself_ v)\n            go to x: (110) y: (0)\n            switch costume to (rubytxt v)\n            create clone of (_myself_ v)\n            go to x: (0) y: (0)\n            switch costume to (ruby v)\n            repeat (2)\n                change size by (((500) - (size)) * (.1))\n            end\n            switch costume to (costume1 v)\n            create clone of (_myself_ v)\n            go to x: (0) y: (0)\n            switch costume to (ruby v)\n            repeat (50)\n                change size by (((500) - (size)) * (.1))\n            end\n            delete this clone\n        else\n            if <(costume [name v]) = [ruby2]> then\n                go to [front v] layer\n                set size to (0) %\n                repeat (30)\n                    change size by (((100) - (size)) * (.1))\n                end\n                switch costume to (ruby v)\n                create clone of (_myself_ v)\n                switch costume to (ruby2 v)\n                repeat (20)\n                    go to [front v] layer\n                end\n            else\n                go to [front v] layer\n                set size to (100) %\n                set [i1 v] to (x position)\n                go to x: (0) y: (0)\n                repeat (30)\n                    change x by (((i1) - (x position)) * (.15))\n                    change size by (((100) - (size)) * (.1))\n                end\n                repeat (30)\n                    change [brightness v] effect by (3.334)\n                end\n                repeat (15)\n                    wait (0) seconds\n                end\n                broadcast (end intro v) and wait\n            end\n        end\n    end\nend\n\nset [intro v] to [0]\nif <(intro) = [0]> then\n    set [intro v] to [1]\nend\n\nshow\nwait (1) seconds\nrepeat (30)\n    change [ghost v] effect by (3.34)\nend\nhide\n\nif <not <(i2) = [0]>> then\n    go to [front v] layer\n    repeat ((i1) / (3))\n        change [ghost v] effect by ((100) / ((i1) / (3)))\n        change x by (((((i2) mod (2)) * ((2) * (([floor v] of (((i2) mod (4)) / (2)) ) - (.5)))) * (30)) / (i1))\n        change y by ((((((i2) + (1)) mod (2)) * ((2) * (([floor v] of (((i2) mod (4)) / (2)) ) - (.5)))) * (-30)) / (i1))\n    end\n    delete this clone\nelse\n    go to [front v] layer\n    repeat ((i1) / (3))\n        change [ghost v] effect by ((100) / ((i1) / (3)))\n    end\n    delete this clone\nend\n\nhide\n\nif <(costume [name v]) = [ruby2]> then\n\nwhen I receive [end intro v]\nrepeat (60)\n    change [ghost v] effect by (1.666)\nend\nif  then\n    delete this clone\nend\nbroadcast (intro done v)\nhide\n\n@UI\n\nwhen I receive [pause v]\nshow list [top 8 world records v]\nif <not <(id) < [-2]>> then\n    point in direction (90)\nend\nset [nyeh v] to (costume [name v])\nif <not <(id) < [0]>> then\n    if  then\n        delete this clone\n    end\n    go to [front v] layer\n    set [ghost v] effect to (40)\n    set size to (100) %\n    if <<(PAUSE) = [1]> and <(popup) = [9]>> then\n        go to x: (0) y: (0)\n        set size to (100) %\n        if <(completed levels) < (Current level)> then\n            switch costume to (win bg v)\n        else\n            switch costume to (won bg v)\n        end\n        show\n        set [ghost v] effect to (100)\n    else\n        if <<(PAUSE) = [1]> and <(popup) = [8]>> then\n            if <(npc) = [1]> then\n                set [customizing v] to [1]\n            else\n                if <(npc) = [2]> then\n                    set [customizing v] to [2]\n                end\n            end\n            go to x: (0) y: (0)\n            set size to (30) %\n            switch costume to (join [dialog] (npc))\n            show\n            set [ghost v] effect to (100)\n            repeat (5)\n                change [ghost v] effect by (-16)\n                change size by (((100) - (size)) * (.6))\n            end\n            begin dialog for npc (npc) with conversation (conversation)\n            set [custom menu v] to [1]\n            if <(npc) = [1]> then\n                set [customizing v] to [1]\n                go to x: (0) y: (0)\n                set size to (100) %\n                switch costume to (item bg1 v)\n                show\n                set [ghost v] effect to (100)\n                menu buttons [7]\n                repeat (10)\n                    change [ghost v] effect by (-8)\n                end\n                wait until <key (e v) pressed?>\n                set [customizing v] to [0]\n            else\n                if <(npc) = [2]> then\n                    set [customizing v] to [2]\n                    go to x: (0) y: (0)\n                    set size to (100) %\n                    switch costume to (item bg2 v)\n                    show\n                    set [ghost v] effect to (100)\n                    menu buttons [8]\n                    repeat (10)\n                        change [ghost v] effect by (-8)\n                    end\n                    wait until <key (e v) pressed?>\n                    set [customizing v] to [0]\n                end\n            end\n        else\n            if <<(PAUSE) = [1]> and <<((popup) + (0)) > [0]> and <(popup) < [8]>>> then\n                switch costume to (play level bg v)\n                show\n                menu buttons [3]\n                set [ghost v] effect to (100)\n                repeat (10)\n                    change [ghost v] effect by (-6)\n                end\n            else\n                if <<(PAUSE) = [1]> and <((MapX) * (MapY)) = ((80) * (60))>> then\n                    switch costume to (pause bg v)\n                    show\n                    menu buttons [4]\n                    set [ghost v] effect to (100)\n                    repeat (10)\n                        change [ghost v] effect by (-8)\n                    end\n                else\n                    if <<(PAUSE) = [1]> and <(Player Health) > [0]>> then\n                        switch costume to (pause bg v)\n                        show\n                        menu buttons [1]\n                        set [ghost v] effect to (100)\n                        repeat (10)\n                            change [ghost v] effect by (-6)\n                        end\n                    else\n                        if <<(PAUSE) = [1]> and <not <(Player Health) > [0]>>> then\n                            switch costume to (death bg v)\n                            show\n                            menu buttons [2]\n                            set [ghost v] effect to (100)\n                            repeat (10)\n                                change [ghost v] effect by (-8)\n                            end\n                        else\n                            if <not <(id) = [-1]>> then\n                                hide\n                                delete this clone\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine menu buttons (context)\nif <(context) = [1]> then\n    go to x: (-100) y: (-50)\n    set [id v] to [9]\n    create clone of (_myself_ v)\n    set [id v] to [0]\n    repeat (2)\n        change x by (100)\n        change [id v] by (1)\n        create clone of (_myself_ v)\n    end\n    go to x: (0) y: (0)\n    set size to (100) %\n    set [id v] to [0]\nelse\n    if <(context) = [2]> then\n        go to x: (-50) y: (-50)\n        set [id v] to [9]\n        create clone of (_myself_ v)\n        set [id v] to [0]\n        repeat (1)\n            change x by (100)\n            change [id v] by (1)\n            create clone of (_myself_ v)\n        end\n        go to x: (0) y: (0)\n        set size to (100) %\n        set [id v] to [0]\n    else\n        if <(context) = [3]> then\n            go to x: (-50) y: (-50)\n            set [id v] to [6]\n            repeat (2)\n                change [id v] by (1)\n                create clone of (_myself_ v)\n                change x by (100)\n            end\n            go to x: (0) y: (0)\n            set size to (100) %\n            set [id v] to [0]\n        else\n            if <(context) = [4]> then\n                go to x: (0) y: (-50)\n                set [id v] to [1]\n                repeat (1)\n                    change [id v] by (1)\n                    create clone of (_myself_ v)\n                    change x by (100)\n                end\n                if <(\[GAME MODE) = [1]> then\n                    set [id v] to [15]\n                    go to x: (220) y: (160)\n                    create clone of (_myself_ v)\n                end\n                go to x: (0) y: (0)\n                set size to (100) %\n                set [id v] to [0]\n            else\n                if <(context) = [5]> then\n                    go to x: (0) y: (-50)\n                    set [id v] to [9]\n                    create clone of (_myself_ v)\n                    set size to (100) %\n                    go to x: (0) y: (0)\n                    set [id v] to [0]\n                else\n                    if <(context) = [6]> then\n                        set [id v] to [4]\n                        point in direction (0)\n                        switch costume to (m1 v)\n                        repeat (4)\n                            go to x: (0) y: (-50)\n                            move ((18) * ((4) + ((1.333) * (((direction) mod (180)) / (90))))) steps\n                            create clone of (_myself_ v)\n                            next costume\n                            turn right (90) degrees\n                        end\n                        set [id v] to [6]\n                        delete this clone\n                    else\n                        if <(context) = [7]> then\n                            delete all of [delete v]\n                            switch costume to (gun1 v)\n                            go to x: (-100) y: (-50)\n                            set [id v] to [13]\n                            set [id2 v] to [0]\n                            repeat (3)\n                                change [id2 v] by (1)\n                                if <not <<<(item (id2) of [all items v]) = []> or <(item (4) of [items v]) = (id2)>> or <(item (5) of [items v]) = (id2)>>> then\n                                    show\n                                else\n                                    hide\n                                end\n                                create clone of (_myself_ v)\n                                change x by (50)\n                                next costume\n                            end\n                            go to x: (-100) y: (-100)\n                            repeat (3)\n                                change [id2 v] by (1)\n                                if <not <<<(item (id2) of [all items v]) = []> or <(item (4) of [items v]) = (id2)>> or <(item (5) of [items v]) = (id2)>>> then\n                                    show\n                                else\n                                    hide\n                                end\n                                create clone of (_myself_ v)\n                                change x by (50)\n                                next costume\n                            end\n                            set [id v] to [14]\n                            go to x: (100) y: (-50)\n                            set [id2 v] to [1]\n                            if <not <(item (4) of [items v]) = []>> then\n                                show\n                            else\n                                hide\n                            end\n                            switch costume to (join [gun] (item (4) of [items v]))\n                            create clone of (_myself_ v)\n                            go to x: (100) y: (-100)\n                            set [id2 v] to [2]\n                            if <not <(item (5) of [items v]) = []>> then\n                                show\n                            else\n                                hide\n                            end\n                            switch costume to (join [gun] (item (5) of [items v]))\n                            create clone of (_myself_ v)\n                            go to x: (0) y: (0)\n                            set size to (100) %\n                            set [id v] to [0]\n                            show\n                            switch costume to (item bg1 v)\n                            broadcast (sort weapons v)\n                        else\n                            if <(context) = [8]> then\n                                delete all of [delete v]\n                                switch costume to (item1 v)\n                                go to x: (-100) y: (-50)\n                                set [id v] to [13]\n                                set [id2 v] to [0]\n                                repeat (3)\n                                    change [id2 v] by (1)\n                                    if <<not <(item ((id2) + (6)) of [all items v]) = []>> and <not <(item (3) of [items v]) = (id2)>>> then\n                                        show\n                                    else\n                                        hide\n                                    end\n                                    create clone of (_myself_ v)\n                                    change x by (50)\n                                    next costume\n                                end\n                                go to x: (-100) y: (-100)\n                                repeat (3)\n                                    change [id2 v] by (1)\n                                    if <not <<(item ((id2) + (6)) of [all items v]) = []> or <((item (2) of [items v]) + (3)) = (id2)>>> then\n                                        show\n                                    else\n                                        hide\n                                    end\n                                    create clone of (_myself_ v)\n                                    change x by (50)\n                                    next costume\n                                end\n                                set [id v] to [14]\n                                go to x: (100) y: (-50)\n                                set [id2 v] to [1]\n                                if <not <(item (3) of [items v]) = []>> then\n                                    show\n                                else\n                                    hide\n                                end\n                                set [temp3 v] to (item (3) of [items v])\n                                switch costume to (join [item] (item (3) of [items v]))\n                                create clone of (_myself_ v)\n                                go to x: (100) y: (-100)\n                                set [id2 v] to [2]\n                                if <not <(item (2) of [items v]) = []>> then\n                                    show\n                                else\n                                    hide\n                                end\n                                set [temp3 v] to ((item (2) of [items v]) + (3))\n                                switch costume to (join [item] ((item (2) of [items v]) + (3)))\n                                create clone of (_myself_ v)\n                                go to x: (0) y: (0)\n                                set size to (100) %\n                                set [id v] to [0]\n                                show\n                                switch costume to (item bg2 v)\n                                broadcast (sort weapons v)\n                            else\n                                if <(context) = [9]> then\n                                    go to x: (220) y: (160)\n                                    set [id v] to [16]\n                                    create clone of (_myself_ v)\n                                    set size to (100) %\n                                    go to x: (0) y: (0)\n                                    set [id v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nif <(id) < [0]> then\n    if <(id) = [-1]> then\n        set [ghost v] effect to (100)\n        show\n        go to x: (200) y: (140)\n        wait until <not <(Player Health) < [.01]>>\n        repeat until <(Player Health) < [.01]>\n            if <not <(Player Health) = (temp)>> then\n                set [temp v] to (Player Health)\n                set [ghost v] effect to (100)\n                set size to (50) %\n                repeat (5)\n                    go to [front v] layer\n                    change size by (((133.333333333) - (size)) * (.8))\n                    change [ghost v] effect by (-20)\n                    switch costume to (join [health] (Player Health))\n                end\n                repeat (30)\n                    switch costume to (join [health] (Player Health))\n                    if <not <(Player Health) = (temp)>> then\n                        set [temp v] to (Player Health)\n                        repeat (30)\n                            switch costume to (join [health] (Player Health))\n                        end\n                    end\n                end\n                repeat (5)\n                    go to [front v] layer\n                    change size by (((50) - (size)) * (.8))\n                    change [ghost v] effect by (20)\n                    switch costume to (join [health] (Player Health))\n                end\n            end\n            set [temp v] to (Player Health)\n        end\n    else\n        if <(id) = [-2]> then\n            set [ghost v] effect to (100)\n            show\n            go to x: (-200) y: (140)\n            wait until <not <(Player Health) < [.01]>>\n            repeat until <(Player Health) < [.01]>\n                if <([buff cooldown v] of [player v]) > [0]> then\n                    switch costume to (health0 v)\n                    set [ghost v] effect to (100)\n                    set size to (50) %\n                    repeat (5)\n                        go to [front v] layer\n                        change size by (((133.333333333) - (size)) * (.8))\n                        change [ghost v] effect by (-20)\n                    end\n                    switch costume to (cooldown0 v)\n                    wait until <not <([buff cooldown v] of [player v]) > [0]>>\n                    switch costume to (health8 v)\n                    repeat (5)\n                        go to [front v] layer\n                        change size by (((50) - (size)) * (.8))\n                        change [ghost v] effect by (20)\n                    end\n                end\n            end\n        else\n            set [ghost v] effect to (100)\n            show\n            go to x: (-200) y: (140)\n            wait until <not <(Player Health) < [.01]>>\n            repeat until <(Player Health) < [.01]>\n                if <([buff cooldown v] of [player v]) > [0]> then\n                    set [ghost v] effect to (100)\n                    set size to (50) %\n                    repeat (5)\n                        go to [front v] layer\n                        change size by (((133.333333333) - (size)) * (.8))\n                    end\n                    show\n                    clear graphic effects\n                    repeat until <not <([buff cooldown v] of [player v]) > [0]>>\n                        switch costume to (join [cooldown] ((2) - (round (([buff cooldown v] of [player v]) / (300)))))\n                        point in direction (([buff cooldown v] of [player v]) * (-1.2))\n                    end\n                    hide\n                end\n            end\n        end\n    end\nelse\n    set [ghost v] effect to (100)\n    if <(id) = [1]> then\n        switch costume to (restart v)\n    else\n        if <(id) = [2]> then\n            switch costume to (resume v)\n        else\n            if <(id) = [3]> then\n        end\n    end\n    if <<(id) > [9]> and <not <(id) > [14]>>> then\n    if <<(id) > [3]> and <(id) < [7]>> then\n        forever\n            set [brightness v] effect to (0)\n            set size to (200) %\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (5)\n                set size to (225) %\n                set [compass x v] to (x position)\n                set [compass y v] to (y position)\n                if <(id) = [5]> then\n                    set [popup v] to [1]\n                else\n                    if <(id) = [6]> then\n                        set [popup v] to [2]\n                    else\n                        set [popup v] to ((2) + (letter (2) of (costume [name v])))\n                    end\n                end\n            end\n        end\n    else\n        if <(id) = [12]> then\n            forever\n                change [x v] by (((compass x) - (x)) * (.3))\n                change [y v] by (((compass y) - (y)) * (.3))\n                point in direction ((90) + (([atan v] of (((x) - (x position)) / ((y) - (y position))) ) + ((180) * <(y) < (y position)>)))\n            end\n        end\n    end\nend\n\nwhen this sprite clicked\nwait until <not <mouse down?>>\nif <(id) = [1]> then\n    set [pause v] to [0]\n    broadcast (pause v)\n    broadcast (start tick v)\nelse\n    if <(id) = [2]> then\n        set [pause v] to [0]\n    else\n        if <(id) = [3]> then\n    end\nend\n\nwhen flag clicked\nshow\nprocess costume sizes\nhide\n\nif <(username) = [finnagin5]> then\n    if <(username) = [finnagin5]> then\n        turn right (20) degrees\n        set [whirl v] effect to (pick random (-100) to (100))\n        set [fisheye v] effect to (pick random (-100) to (150))\n    end\n    point in direction (180)\n    forever\n        set [whirl v] effect to (pick random (-100) to (100))\n        set [fisheye v] effect to (pick random (-100) to (150))\n    end\nend\n\nwhen I receive [start tick v]\nif  then\n    delete this clone\nend\nset [jacked? v] to [0]\nset [temp v] to ((8) - ((7) * <(\[GAME MODE) = [3]>))\nset [id v] to [-1]\ncreate clone of (_myself_ v)\nset [id v] to [-2]\ncreate clone of (_myself_ v)\nset [id v] to [-3]\ncreate clone of (_myself_ v)\nset [id v] to [0]\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nclear graphic effects\nhide\n\nwhen I receive [die v]\nif <(id) < [0]> then\n    delete this clone\nend\n\ndefine begin dialog for npc (npc) with conversation (#)\nset [i2 v] to (item # of (join (npc) (join [-] (#))) in [conversations v])\nif <(i2) > [0]> then\n    repeat until <<(letter (2) of (item ((i2) + (1)) of [conversations v])) = [-]> or <(item ((i2) + (1)) of [conversations v]) = []>>\n        change [i2 v] by (1)\n        set [word id v] to [0]\n        set [word ct. v] to [0]\n        delete all of [delete v]\n        type (item (npc) of [npcs v]) at position [-103] [-43] with size [50]\n        if <(i2) = [110]> then\n            type (join (item (i2) of [conversations v]) (join (round (((\[Speedrun timer) / (60)) - (.25))) [ minutes.])) at position [-95] [-62] with size [50]\n        else\n            type (item (i2) of [conversations v]) at position [-95] [-60] with size [50]\n        end\n        if <<(letter (2) of (item ((i2) + (1)) of [conversations v])) = [-]> or <(item ((i2) + (1)) of [conversations v]) = []>> then\n            set [talking? v] to [0]\n        end\n        wait until <key (e v) pressed?>\n        wait until <not <key (e v) pressed?>>\n        broadcast (erase text v)\n        if <(talking?) = [0]> then\n            repeat (5)\n                change [ghost v] effect by (16)\n            end\n        else\n            repeat (3)\n                wait (0) seconds\n            end\n        end\n    end\n    set [talking? v] to [0]\nelse\n    set [talking? v] to [0]\nend\n\ndefine type (string) at position (x) (y) with size (size)\nset [i v] to ((1) + <(letter (1) of (string)) = [ ]>)\nswitch costume to (a v)\nset [a v] to ((costume [number v]) - (1))\nset size to (1000) %\nswitch costume to (letter (i) of (string))\nset [b v] to (item ((costume [number v]) - (a)) of [widths v])\nswitch costume to (pause bg v)\ngo to x: ((x) + ((b) * ((size) / (100)))) y: (y)\nset size to (size) %\nset [next line v] to []\nchange [word id v] by (3)\nset [word ct. v] to (word id)\nrepeat (length of (string))\n    switch costume to (letter (i) of (string))\n    set [b v] to (item ((costume [number v]) - (a)) of [widths v])\n    set [c v] to ((0) + <<(letter ((i) + (1)) of (string)) = []> or <(letter (i) of (string)) = [ ]>>)\n    change [word id v] by (c)\n    change [word ct. v] by (c)\n    if <(x position) > [98]> then\n        change [word id v] by ((0) - (c))\n    else\n        set [id v] to [10]\n        create clone of (_myself_ v)\n        set [id v] to [0]\n    end\n    if <<(c) = [1]> and <(word id) = (word ct.)>> then\n        set [next line v] to []\n    else\n        set [next line v] to (join (next line) (letter (i) of (string)))\n    end\n    switch costume to (letter ((i) + (1)) of (string))\n    change x by ((((item ((costume [number v]) - (a)) of [widths v]) + (b)) + (2)) * ((size) / (100)))\n    change [i v] by (1)\nend\nif <not <(word id) = (word ct.)>> then\n    add (word id) to [delete v]\n    type (next line) at position (x) ((y) - ((28) * ((size) / (100)))) with size (size)\nend\nswitch costume to (join [dialog] (npc))\nset size to (100) %\ngo to x: (0) y: (0)\n\nwhen I receive [erase text v]\nif <(id) = [10]> then\n    repeat (5)\n        change [ghost v] effect by (16)\n    end\n    delete this clone\nend\n\ndefine process costume sizes\ndelete all of [widths v]\nswitch costume to (a v)\nset size to (100) %\nset rotation style [don't rotate v]\nrepeat (74)\n    go to x: (-3000) y: (0)\n    repeat until <not <touching (_edge_ v)?>>\n        change x by (1)\n    end\n    if <(costume [name v]) = [ ]> then\n        add [3] to [widths v]\n    else\n        add (round ((x position) + (240))) to [widths v]\n    end\n    next costume\nend\nset rotation style [all around v]\npoint in direction (90)\n\nwhen I receive [win screen v]\nif <not <(id) < [0]>> then\n    if  then\n        delete this clone\n    end\n    repeat (30)\n        change [ghost v] effect by (-3)\n    end\n    if <(completed levels) < (Current level)> then\n        broadcast (unlock items v)\n    end\n    repeat (15)\n        wait (0) seconds\n    end\n    menu buttons [5]\nend\n\nwhen I receive [load hub level v]\nset [current level v] to [0]\n\nwhen flag clicked\nset [customizing v] to [0]\nset [goal! v] to [0]\nset [lift room condition v] to [0]\nset [completed levels v] to [0]\ndelete all of [unlocked levels v]\nadd [1] to [unlocked levels v]\ndelete all of [all items v]\nrepeat (12)\n    add [] to [all items v]\nend\nreplace item (1) of [all items v] with [1]\n\nwhen I receive [loading v]\nif <not <(id) = [0]>> then\n    hide\nelse\n    show\n    go to x: (0) y: (0)\n    clear graphic effects\n    switch costume to (loading v)\n    set size to (100) %\nend\n\nwhen I receive [menu transition v]\nif <<(id) > [3]> and <(id) < [7]>> then\n    repeat (5)\n        go to [front v] layer\n        change size by (((50) - (size)) * (.5))\n        change [ghost v] effect by (20)\n    end\nend\n\nwhen I receive [sort weapons v]\nif <(id) = [13]> then\n    if <(npc) = [1]> then\n        set [temp v] to ((id2) + (((-1) * <<(item (4) of [items v]) < (id2)> and <not <(item (id2) of [all items v]) = []>>>) + ((-1) * <<(item (5) of [items v]) < (id2)> and <not <(item (id2) of [all items v]) = []>>>)))\n        if <not <<<(item (id2) of [all items v]) = []> or <(item (4) of [items v]) = (id2)>> or <(item (5) of [items v]) = (id2)>>> then\n            switch costume to (join [gun] (id2))\n            show\n            repeat (4)\n                wait (0) seconds\n            end\n            repeat (3)\n                change [ghost v] effect by (-25)\n            end\n            clear graphic effects\n        else\n            repeat (3)\n                change [ghost v] effect by (34)\n            end\n            hide\n        end\n    else\n        if <(npc) = [2]> then\n            set [temp v] to ((id2) + (((-1) * <<((item (2) of [items v]) + (3)) < (id2)> and <not <(item (id2) of [all items v]) = []>>>) + ((-1) * <<(item (3) of [items v]) < (id2)> and <not <(item (id2) of [all items v]) = []>>>)))\n            if <(item ((id2) + (6)) of [all items v]) = []> then\n                repeat (3)\n                    change [ghost v] effect by (34)\n                end\n                hide\n                stop [this script v]\n            else\n                if <(id2) < [4]> then\n                    if <(item (3) of [items v]) = (id2)> then\n                        repeat (3)\n                            change [ghost v] effect by (34)\n                        end\n                        hide\n                        stop [this script v]\n                    end\n                else\n                    if <((item (2) of [items v]) + (3)) = (id2)> then\n                        repeat (3)\n                            change [ghost v] effect by (34)\n                        end\n                        hide\n                        stop [this script v]\n                    end\n                end\n            end\n            switch costume to (join [item] (id2))\n            show\n            repeat (4)\n                wait (0) seconds\n            end\n            repeat (3)\n                change [ghost v] effect by (-25)\n            end\n            clear graphic effects\n        end\n    end\nelse\n    if <(id) = [14]> then\n        if <(npc) = [1]> then\n            if <(id2) = [1]> then\n                if <not <(item (4) of [items v]) = []>> then\n                    show\n                    if <not <(item (4) of [items v]) = (temp3)>> then\n                        set [temp3 v] to (item (4) of [items v])\n                        repeat (3)\n                            change [ghost v] effect by (34)\n                        end\n                        switch costume to (join [gun] (item (4) of [items v]))\n                        repeat (2)\n                            wait (0) seconds\n                        end\n                    end\n                    repeat (3)\n                        change [ghost v] effect by (-25)\n                    end\n                    clear graphic effects\n                else\n                    repeat (3)\n                        change [ghost v] effect by (34)\n                    end\n                    hide\n                end\n                switch costume to (join [gun] (item (4) of [items v]))\n            else\n                if <not <(item (5) of [items v]) = []>> then\n                    show\n                    if <not <(item (5) of [items v]) = (temp3)>> then\n                        set [temp3 v] to (item (5) of [items v])\n                        repeat (3)\n                            change [ghost v] effect by (34)\n                        end\n                        switch costume to (join [gun] (item (5) of [items v]))\n                        repeat (2)\n                            wait (0) seconds\n                        end\n                    end\n                    repeat (3)\n                        change [ghost v] effect by (-25)\n                    end\n                    clear graphic effects\n                else\n                    repeat (3)\n                        change [ghost v] effect by (34)\n                    end\n                    hide\n                end\n                switch costume to (join [gun] (item (5) of [items v]))\n            end\n        else\n            if <(npc) = [2]> then\n                if <(id2) = [1]> then\n                    if <not <(item (3) of [items v]) = []>> then\n                        if <not <(item (3) of [items v]) = (temp3)>> then\n                            set [temp3 v] to (item (3) of [items v])\n                            repeat (3)\n                                change [ghost v] effect by (34)\n                            end\n                            switch costume to (join [item] (item (3) of [items v]))\n                            repeat (2)\n                                wait (0) seconds\n                            end\n                        end\n                        show\n                        repeat (3)\n                            change [ghost v] effect by (-25)\n                        end\n                        clear graphic effects\n                    else\n                        repeat (3)\n                            change [ghost v] effect by (34)\n                        end\n                        hide\n                    end\n                    switch costume to (join [item] (item (3) of [items v]))\n                else\n                    if <not <(item (2) of [items v]) = []>> then\n                        if <not <((item (2) of [items v]) + (3)) = (temp3)>> then\n                            set [temp3 v] to ((item (2) of [items v]) + (3))\n                            repeat (3)\n                                change [ghost v] effect by (34)\n                            end\n                            switch costume to (join [item] ((item (2) of [items v]) + (3)))\n                            repeat (2)\n                                wait (0) seconds\n                            end\n                        end\n                        show\n                        repeat (3)\n                            change [ghost v] effect by (-25)\n                        end\n                        clear graphic effects\n                    else\n                        repeat (3)\n                            change [ghost v] effect by (34)\n                        end\n                        hide\n                    end\n                    switch costume to (join [item] ((item (2) of [items v]) + (3)))\n                end\n            end\n        end\n    end\nend\n\nwhen [1 v] key pressed\nif <<(custom menu) > [0]> and <(id) = [0]>> then\n    if <(npc) = [1]> then\n        set [temp v] to (item (((3) + ([floor v] of (((mouse x) + (175)) / (50)) )) + ((-3) * ([floor v] of (((mouse y) + (125)) / (50)) ))) of [all items v])\n        if <<([abs v] of ((-50) - (mouse x)) ) < [75]> and <<([abs v] of ((-75) - (mouse y)) ) < [50]> and <not <<(item (4) of [items v]) = (temp)> or <(item (5) of [items v]) = (temp)>>>>> then\n            set [weapon v] to (temp)\n            broadcast (sort weapons v)\n            start sound [interact v]\n        end\n    else\n        set [temp v] to (item (([floor v] of (((mouse x) + (175)) / (50)) ) + (6)) of [all items v])\n        if <<([abs v] of ((-50) - (mouse x)) ) < [75]> and <<([abs v] of ((-50) - (mouse y)) ) < [25]> and <<not <(item (3) of [items v]) = (temp)>> and <not <(temp) = []>>>>> then\n            set [mobility accessory v] to (temp)\n            broadcast (sort weapons v)\n            start sound [interact v]\n        end\n    end\nend\n\nwhen [2 v] key pressed\nif <<(custom menu) > [0]> and <(id) = [0]>> then\n    if <(npc) = [1]> then\n        set [temp v] to (item (((3) + ([floor v] of (((mouse x) + (175)) / (50)) )) + ((-3) * ([floor v] of (((mouse y) + (125)) / (50)) ))) of [all items v])\n        if <<([abs v] of ((-50) - (mouse x)) ) < [75]> and <<([abs v] of ((-75) - (mouse y)) ) < [50]> and <not <<(item (4) of [items v]) = (temp)> or <(item (5) of [items v]) = (temp)>>>>> then\n            set [secondary weapon v] to (temp)\n            broadcast (sort weapons v)\n            start sound [interact v]\n        end\n    else\n        set [temp v] to (item (((3) + ([floor v] of (((mouse x) + (175)) / (50)) )) + (6)) of [all items v])\n        if <<([abs v] of ((-50) - (mouse x)) ) < [75]> and <<([abs v] of ((-100) - (mouse y)) ) < [25]> and <<not <(item (2) of [items v]) = ((temp) - (3))>> and <not <(temp) = []>>>>> then\n            set [second accessory v] to ((temp) - (3))\n            broadcast (sort weapons v)\n            start sound [interact v]\n        end\n    end\nend\n\nwhen flag clicked\nset [custom menu v] to [0]\n\nwhen I receive [start tick v]\nset [custom menu v] to [0]\n\nwhen I receive [unlock items v]\nif <not <(id) < [0]>> then\n    if <(completed levels) < [7]> then\n        change [completed levels v] by (1)\n        add ((completed levels) + (1)) to [unlocked levels v]\n        replace item (completed levels) of [all items v] with (completed levels)\n        if <(completed levels) < [3]> then\n            replace item ((completed levels) + (6)) of [all items v] with (completed levels)\n        else\n            if <(completed levels) < [4]> then\n                replace item (10) of [all items v] with [4]\n            else\n                if <(completed levels) < [5]> then\n                    replace item (9) of [all items v] with [3]\n                else\n                    replace item ((completed levels) + (6)) of [all items v] with (completed levels)\n                end\n            end\n        end\n    end\nend\n\nbroadcast (load save data v)\nbroadcast (load save data v)\n\nwhen I receive [intro done v]\ngo to x: (0) y: (0)\nset [talking? v] to [0]\nset [npc v] to [0]\nset [conversation v] to [0]\nset [current level v] to [-5]\nhide variable [weapon v]\nhide variable [mobility accessory v]\nhide variable [second accessory v]\nshow\ngo to [front v] layer\nswitch costume to (title v)\nset size to (100) %\nset [ghost v] effect to (100)\nswitch backdrop to (main menu v)\nrepeat (30)\n    change [ghost v] effect by (-3.3333)\nend\nclear graphic effects\nbroadcast (get save data v)\nwait (3) seconds\nset [id v] to [11]\ncreate clone of (_myself_ v)\nset [id v] to [12]\ncreate clone of (_myself_ v)\nset [id v] to [0]\nrepeat (34)\n    change x by (((0) - (x position)) * (.2))\n    change y by (((120) - (y position)) * (.2))\n    change size by (((60) - (size)) * (.2))\nend\nset [id v] to [5]\ncreate clone of (_myself_ v)\nif  then\n    set [id v] to [6]\n    create clone of (_myself_ v)\nend\nset [id v] to [0]\nrepeat (30)\n    change x by (((0) - (x position)) * (.2))\n    change y by (((120) - (y position)) * (.2))\n    change size by (((60) - (size)) * (.2))\nend\nset size to (60) %\nrepeat until <not <(Current level) = [-5]>>\n    set [popup v] to [0]\n    broadcast (menu popup tick v)\nend\n\nset [mobility accessory v] to []\nset [second accessory v] to []\n\nwhen I receive [wr's v]\nif <(id) = [0]> then\n    type (item (1) of [top 8 world records v]) at position [-100] [70] with size [50]\n    type (item (2) of [top 8 world records v]) at position [-100] [50] with size [50]\n    type (item (3) of [top 8 world records v]) at position [-100] [30] with size [50]\n    type (item (4) of [top 8 world records v]) at position [-100] [10] with size [50]\n    type (item (5) of [top 8 world records v]) at position [-100] [-10] with size [50]\n    type (item (6) of [top 8 world records v]) at position [-100] [-30] with size [50]\n    type (item (7) of [top 8 world records v]) at position [-100] [-50] with size [50]\n    type (item (8) of [top 8 world records v]) at position [-100] [-70] with size [50]\n    menu buttons [9]\n    switch costume to (leaderboard bg v)\nend\ndelete this clone\n\nwhen I receive [pause v]\nif <(nyeh) = [leaderboard bg]> then\n    repeat (10)\n        set [ghost v] effect to (20)\n    end\nend\n\nwhen I receive [title v]\nwait (1) seconds\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nswitch costume to (title v)\nset size to (100) %\nset [ghost v] effect to (100)\nswitch backdrop to (main menu v)\nrepeat (30)\n    change [ghost v] effect by (-3.3333)\nend\nclear graphic effects\n\n@Variable Txt\n\nwhen I receive [postrender v]\nget time\nif <not <(id) = [0]>> then\n    if <(id) < [9]> then\n        go to [front v] layer\n        set [brightness v] effect to (90)\n        switch costume to (letter (id) of (temp))\n        go to x: ((-242) + ((13) * (id))) y: (-170)\n    else\n        if <<(Boss FIGHT) = [1]> and <not <(Boss health) < [.01]>>> then\n            show\n            go to x: (0) y: (152)\n            if <(id) = [9]> then\n                set x to ((((Boss health) - (.01)) mod (37.5)) - (37.5))\n                switch costume to (join [BH] ((1) + ([ceiling v] of ((Boss health) / (37.5)) )))\n                go to [front v] layer\n            else\n                switch costume to (bh1 v)\n                go to [front v] layer\n                go [backward v] (2) layers\n                if <(\[GAME MODE) = [1]> then\n                    go [backward v] (8) layers\n                end\n            end\n            clear graphic effects\n        else\n            hide\n        end\n    end\nelse\n    hide\n    if <<(Boss FIGHT) = [1]> and <not <(Boss health) < [.01]>>> then\n        go to [front v] layer\n        show\n        set [brightness v] effect to (90)\n        switch costume to (vecter the viamint v)\n        go to x: (0) y: (165)\n    end\nend\n\ndefine get time\nif <<<(\[GAME MODE) = [1]> and <(PAUSE) = [0]>> and <(Beat the game?) = [0]>> then\n    if <([floor v] of ((\[Speedrun timer) / (60)) ) < [10]> then\n        set [temp v] to (join (join [0] ([floor v] of ((\[Speedrun timer) / (60)) )) [:])\n    else\n        set [temp v] to (join ([floor v] of ((\[Speedrun timer) / (60)) ) [:])\n    end\n    if <([floor v] of ((\[Speedrun timer) mod (60)) ) < [10]> then\n        set [temp v] to (join (join (join (temp) [0]) ([floor v] of ((\[Speedrun timer) mod (60)) )) [.])\n    else\n        set [temp v] to (join (join (temp) ([floor v] of ((\[Speedrun timer) mod (60)) )) [.])\n    end\n    if <([floor v] of (((\[Speedrun timer) * (100)) mod (100)) ) < [10]> then\n        set [temp v] to (join (join (temp) [0]) ([floor v] of (((\[Speedrun timer) * (100)) mod (100)) ))\n    else\n        set [temp v] to (join (temp) ([floor v] of (((\[Speedrun timer) * (100)) mod (100)) ))\n    end\nend\n\ndefine make timer\nshow\nset [id v] to [0]\nrepeat (8)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nset [id v] to [0]\nhide\n\nwhen I receive [loading v]\ndelete this clone\n\nwhen I receive [start tick v]\nif  then\n    delete this clone\nend\nif <(\[GAME MODE) = [1]> then\n    make timer\nend\nif <(Current level) = [7]> then\n    make boss bar\nend\n\ndefine make boss bar\nshow\nset [id v] to [8]\nrepeat (2)\n    change [id v] by (1)\n    create clone of (_myself_ v)\nend\nset [id v] to [0]\nhide\n\nwhen flag clicked\nhide\n\n@Pop-up info\n\nwhen I receive [particle tick v]\nif <(custom menu) = [0]> then\n    if <<(popup) > [-1]> and <<(talking?) = [0]> and <(Goal!) = [0]>>> then\n        show\n        switch costume to (join [] (popup))\n        change size by (((100) - (size)) * (.5))\n        set [ghost v] effect to (((100) - (size)) * (2))\n    else\n        change size by (((30) - (size)) * (.3))\n        set [ghost v] effect to (((100) - (size)) * (2))\n    end\n    go to [front v] layer\n    change size by (200)\n    go to (player v)\n    change y by (30)\n    change size by (-200)\nelse\n    set [temp v] to (item ((((3) + ([floor v] of (((mouse x) + (175)) / (50)) )) + ((-3) * ([floor v] of (((mouse y) + (125)) / (50)) ))) + (((npc) - (1)) * (6))) of [all items v])\n    if <<([abs v] of ((-50) - (mouse x)) ) < [75]> and <([abs v] of ((-75) - (mouse y)) ) < [50]>> then\n        if <<(npc) = [1]> and <not <<(item (4) of [items v]) = (temp)> or <<(item (5) of [items v]) = (temp)> or <(temp) = []>>>>> then\n            show\n            switch costume to (swap v)\n            change size by (((100) - (size)) * (.5))\n            set [ghost v] effect to (((100) - (size)) * (2))\n            set [mx v] to (mouse x)\n            set [my v] to (mouse y)\n        else\n            if <<(npc) = [2]> and <not <<((item (2) of [items v]) + (3)) = (temp)> or <<(item (3) of [items v]) = (temp)> or <(temp) = []>>>>> then\n                show\n                if <(mouse y) < [-75]> then\n                    switch costume to (swap2 v)\n                else\n                    switch costume to (swap1 v)\n                end\n                change size by (((100) - (size)) * (.5))\n                set [ghost v] effect to (((100) - (size)) * (2))\n                set [mx v] to (mouse x)\n                set [my v] to (mouse y)\n            else\n                change size by (((30) - (size)) * (.3))\n                set [ghost v] effect to (((100) - (size)) * (2))\n            end\n        end\n    else\n        change size by (((30) - (size)) * (.3))\n        set [ghost v] effect to (((100) - (size)) * (2))\n    end\n    go to [front v] layer\n    change x by ((((round ((mx) / (50))) * (50)) - (x position)) * (.75))\n    change y by (((((-120) * (<(my) < [-75]> - (.5))) - (75)) - (y position)) * (.75))\nend\nchange [ghost v] effect by ((game done brightness) * (20))\n\nwhen flag clicked\nhide\n\nwhen I receive [loading v]\nhide\n\nwhen I receive [menu popup tick v]\nif <(popup) > [0]> then\n    show\n    switch costume to (join [m] ((popup) - (2)))\n    if <(popup) = [1]> then\n        switch costume to (join [play] ((1) + <(\[SAVE CODE) = [null]>))\n    end\n    if <(popup) = [2]> then\n        switch costume to (join [load] (\[GAME MODE))\n    end\n    change size by (((100) - (size)) * (.5))\n    set [ghost v] effect to (((100) - (size)) * (2))\nelse\n    change size by (((30) - (size)) * (.3))\n    set [ghost v] effect to (((100) - (size)) * (2))\nend\ngo to [front v] layer\ngo to x: (0) y: (-159)\n\nwhen I receive [get save data v]\nget user code (username)\nfind data for user code (i)\nif <(i) = [null]> then\n    set [\[save code v] to [null]\nelse\n    set [\[save code v] to (save code)\n    set [\[game mode v] to (letter (8) of (\[SAVE CODE))\nend\n\ndefine find data for user code (code)\nif < (☁ Save data 1-16) contains (code)?> then\n    get player data from cloud (☁ Save data 1-16) code: (code)\n    set [slot v] to [1]\nelse\n    if < (☁ Save data 17-32) contains (code)?> then\n        get player data from cloud (☁ Save data 17-32) code: (code)\n        set [slot v] to [2]\n    else\n        if < (☁ Save data 33-48) contains (code)?> then\n            get player data from cloud (☁ Save data 33-48) code: (code)\n            set [slot v] to [3]\n        else\n            if < (☁ Save data 49-64) contains (code)?> then\n                get player data from cloud (☁ Save data 49-64) code: (code)\n                set [slot v] to [4]\n            else\n                if < (☁ Save data 65-80) contains (code)?> then\n                    get player data from cloud (☁ Save data 65-80) code: (code)\n                    set [slot v] to [5]\n                else\n                    set [i v] to [null]\n                    set [i2 v] to [0]\n                    set [slot v] to [0]\n                end\n            end\n        end\n    end\nend\n\ndefine join (value)\nset [i v] to (join (i) (join (letter (2) of ((value) + (100))) (letter (3) of ((value) + (100)))))\n\ndefine get user code (username)\nset [i v] to []\njoin (item # of (letter (1) of (username)) in [encoding2 v])\njoin (item # of (letter (2) of (username)) in [encoding2 v])\njoin (item # of (letter (length of (username)) of (username)) in [encoding2 v])\njoin ((79) + (length of (username)))\n\ndefine get player data from cloud (cloud) code: (code)\nset [i2 v] to [1230]\nset [i v] to [-7]\nrepeat until <<(i2) = (code)> or <((i2) + (0)) = [0]>>\n    change [i v] by (16)\n    set [i2 v] to (join (letter (i) of (cloud)) (join (letter ((i) + (1)) of (cloud)) (join (letter ((i) + (2)) of (cloud)) (join (letter ((i) + (3)) of (cloud)) (join (letter ((i) + (4)) of (cloud)) (join (letter ((i) + (5)) of (cloud)) (join (letter ((i) + (6)) of (cloud)) (letter ((i) + (7)) of (cloud)))))))))\nend\nif <(i2) = (code)> then\n    change [i v] by (-8)\n    set [save code v] to (join (join (letter (i) of (cloud)) (join (letter ((i) + (1)) of (cloud)) (join (letter ((i) + (2)) of (cloud)) (join (letter ((i) + (3)) of (cloud)) (join (letter ((i) + (4)) of (cloud)) (join (letter ((i) + (5)) of (cloud)) (join (letter ((i) + (6)) of (cloud)) (letter ((i) + (7)) of (cloud))))))))) (i2))\nelse\n    set [i v] to [null]\nend\nset [i2 v] to (cloud)\n\ndefine Save game to cloud\nget user code (username)\nset [\[save code v] to (join (item (1) of [items v]) (join ((Mobility accessory) + (0)) (join ((Second accessory) + (0)) (join ((Weapon) + (0)) ((Secondary Weapon) + (0))))))\nset [\[save code v] to (join (\[SAVE CODE) (join (completed levels) (join (Beat the game?) (join (\[GAME MODE) (i)))))\nfind data for user code (i)\nif <(i) = [null]> then\n    get save slot data from (☁ Save slot)\n    if <(length of (i2)) < [255]> then\n        save (join (i2) (\[SAVE CODE)) to slot (☁ Save slot)\n    else\n        remove oldest save from (i2)\n        save (join (i2) (\[SAVE CODE)) to slot (☁ Save slot)\n    end\nelse\n    replace code at index (i) with (\[SAVE CODE)\n    save (i3) to slot (slot)\nend\n\ndefine get save slot data from (slot)\nif <(slot) = [1]> then\n    set [i2 v] to (☁ Save data 1-16)\nelse\n    if <(slot) = [2]> then\n        set [i2 v] to (☁ Save data 17-32)\n    else\n        if <(slot) = [3]> then\n            set [i2 v] to (☁ Save data 33-48)\n        else\n            if <(slot) = [4]> then\n                set [i2 v] to (☁ Save data 49-64)\n            else\n                set [i2 v] to (☁ Save data 65-80)\n            end\n        end\n    end\nend\n\ndefine remove oldest save from (cloud)\nset [i v] to [17]\nrepeat (240)\n    set [i2 v] to (join (i2) (letter (i) of (cloud)))\n    change [i v] by (1)\nend\n\ndefine save (code) to slot (slot)\nif <(slot) = [1]> then\n    set [☁ save data 1-16 v] to (code)\nelse\n    if <(slot) = [2]> then\n        set [☁ save data 17-32 v] to (code)\n    else\n        if <(slot) = [3]> then\n            set [☁ save data 33-48 v] to (code)\n        else\n            if <(slot) = [4]> then\n                set [☁ save data 49-64 v] to (code)\n            else\n                set [☁ save data 65-80 v] to (code)\n            end\n        end\n    end\nend\n\ndefine replace code at index (index) with (code)\nget save slot data from (slot)\nset [i v] to [0]\nset [i3 v] to []\nrepeat until <(i) = ((index) - (1))>\n    change [i v] by (1)\n    set [i3 v] to (join (i3) (letter (i) of (i2)))\nend\nrepeat (16)\n    change [i v] by (1)\n    set [i3 v] to (join (i3) (letter ((i) - ((index) - (1))) of (code)))\nend\nrepeat until <(i) > ((length of (i2)) - (1))>\n    change [i v] by (1)\n    set [i3 v] to (join (i3) (letter (i) of (i2)))\nend\n\nwhen I receive [save game v]\nSave game to cloud\nwait (1) seconds\nset [☁ save slot v] to (((☁ Save slot) mod (5)) + (1))\n\nwhen [timer v] > (timer)\nhide\nif <(\[Speedrun timer) > [10]> then\n    broadcast (save game v)\nend\nif <(game done) = [1]> then\n    broadcast (Title v)\nend\n\nwhen flag clicked\nforever\n    set [timer v] to ((timer) + (.5))\nend\n\nwhen flag clicked\nforever\n    wait (15) seconds\n    if <(\[Speedrun timer) > [10]> then\n        broadcast (save game v)\n    end\nend\n\nset [☁ save data 1-16 v] to []\nwait (.2) seconds\nset [☁ save data 17-32 v] to []\nwait (.2) seconds\nset [☁ save data 33-48 v] to []\nwait (.2) seconds\nset [☁ save data 49-64 v] to []\nwait (.2) seconds\nset [☁ save data 65-80 v] to []\n\nwhen I receive [load save data v]\nget user code (username)\nfind data for user code (i)\nif <(i) = [null]> then\n    set [\[save code v] to [null]\nelse\n    set [\[save code v] to (save code)\n    delete all of [items v]\n    add (letter (1) of (\[SAVE CODE)) to [items v]\n    add (letter (2) of (\[SAVE CODE)) to [items v]\n    add (letter (3) of (\[SAVE CODE)) to [items v]\n    add (letter (4) of (\[SAVE CODE)) to [items v]\n    add (letter (5) of (\[SAVE CODE)) to [items v]\n    set [mobility accessory v] to (letter (2) of (\[SAVE CODE))\n    set [second accessory v] to (letter (3) of (\[SAVE CODE))\n    set [weapon v] to (letter (4) of (\[SAVE CODE))\n    set [secondary weapon v] to (letter (5) of (\[SAVE CODE))\n    repeat (letter (6) of (\[SAVE CODE))\n        broadcast (unlock items v)\n    end\n    set [beat the game? v] to (letter (7) of (\[SAVE CODE))\n    set [\[game mode v] to (letter (8) of (\[SAVE CODE))\nend\n\n@End game\n\nwhen I receive [render tick v]\nif <<(Current level) = [0]> and <(completed levels) = [7]>> then\n    go to [back v] layer\n    show\n    set size to (10000) %\n    go to x: (((((60.5) * (40)) - (CamX)) / (CamZ)) - (240)) y: ((((((y) + ((.25) * ([sin v] of ((360) * ([timer v] of [player v])) ))) * (40)) - (CamY)) / (CamZ)) - (180))\n    set size to ((200) / (CamZ)) %\n    turn right (10) degrees\n    if <<(distance to [player v]) < [75]> and <(game done) = [0]>> then\n        set [popup v] to [10]\n        if <key (e v) pressed?> then\n            set [game done v] to [1]\n            broadcast (save game v)\n            broadcast (sound fade v)\n        end\n    end\n    if <<(game done) = [1]> and <(y) < [7000]>> then\n        set [y v] to ((((y) - (45)) * (1.1)) + (45))\n        change [camx v] by (((((60.5) * (40)) - ((240) * (CamZ))) - (CamX)) * (.6))\n        change [camy v] by (((((y) * (40)) - ((180) * (CamZ))) - (CamY)) * (.6))\n        change [game done brightness v] by ((500) / (465))\n        set [popup v] to [10]\n    end\n    if <(y) > [7000]> then\n        broadcast (Title v)\n        stop [all v]\n    end\nelse\n    set [y v] to [46]\n    set [game done v] to [0]\n    set [game done brightness v] to [0]\n    hide\nend\n\nwhen flag clicked\nset [y v] to [46]\nset [game done v] to [0]\nset [game done brightness v] to [0]\nset [popup v] to [-1]\nhide\n\n