Paper Glider - XY Scrolling Platformer
@Stage\n\nwhen [x v] key pressed\nif <(username) = [23ScratchMan]> then\n    ask [BRO WHAT LEVEL?????] and wait\n    set [currentlevel v] to (answer)\n    broadcast (StartGame v) and wait\n    broadcast (PLAY v)\nend\n\nwhen flag clicked\nswitch backdrop to (black v)\nset [currentlevel v] to [1]\nset [backwards? v] to [false]\nset [bgmusic v] to [IN]\nbroadcast (PlayBGMusic v)\nbroadcast (CutsceneGameIntro v) and wait\n\nif <(username) = [23ScratchMan]> then\n    set [currentlevel v] to [10]\nelse\n    set [currentlevel v] to [1]\nend\nset [backwards? v] to [false]\nset [clonesamde v] to [0]\nset [collected v] to [0]\nbroadcast (StartGame v) and wait\nbroadcast (PLAY v)\n\nbroadcast (StartGame v)\n\nset [backwards? v] to [true]\n\nwhen I receive [startgame v]\nset [clonesamde v] to [0]\nset [collected v] to [0]\nbroadcast (DeleteAllClones v) and wait\nif <not <(CurrentLevel) = [11]>> then\n    broadcast (SetUpScrollingBG v) and wait\nend\nif <(CurrentLevel) = [11]> then\n    broadcast (SetUpBossBG v) and wait\n    broadcast (SetUpPlayerGlow v) and wait\nend\nbroadcast (SetUpHitBox1 v) and wait\nbroadcast (SetUpHitBox2 v) and wait\nbroadcast (SetUpHazards v) and wait\nbroadcast (SetUpBounce v) and wait\nbroadcast (SetUpArt v) and wait\nif <(CurrentLevel) > [11]> then\n    broadcast (SetUpExtraArrows v) and wait\nend\nbroadcast (SetUpBreakPlats v) and wait\nbroadcast (SetUpEnd v) and wait\nbroadcast (SetUpCollectible v) and wait\nbroadcast (SetUpPortals v) and wait\nif <(CurrentLevel) = [11]> then\n    broadcast (SetUpAttacks v) and wait\n    broadcast (SetUpLives v) and wait\n    broadcast (SetUpHideCutscene v) and wait\nend\nif <<(CurrentLevel) > [4]> and <(CurrentLevel) < [11]>> then\n    broadcast (SetUpCoinCounter v) and wait\nend\nif <(@MOBILEMODE?) = [true]> then\n    broadcast (SetUpMobileControls v) and wait\nend\nif <(CurrentLevel) = [11]> then\n    broadcast (STARTBOSS v) and wait\nend\n\nset [currentlevel v] to [4]\n\nbroadcast (DeleteAllClones v) and wait\n\nbroadcast (SetUpHitBox1 v) and wait\nbroadcast (SetUpHitBox2 v) and wait\nbroadcast (SetUpArt v) and wait\nbroadcast (SetUpHazards v) and wait\nbroadcast (SetUpBreakPlats v) and wait\n\nwhen flag clicked\n\nset [currentlevel v] to [10]\nset [backwards? v] to [false]\n\nbroadcast (CutsceneGameIntro v) and wait\n\nset [bosshp v] to [1]\n\nset [bossphase v] to [3]\n\nbroadcast (Transition Out v) and wait\n\nset [playerhp v] to [1]\n\nbroadcast (StartGame v) and wait\nbroadcast (PLAY v)\n\nwhen I receive [backwardsmessage v]\n\n@Blank\n\n@The Glidy Boy\n\ndefine Dev Controls - Fly\nif <key (w v) pressed?> then\n    change [playersy v] by (10)\nend\nif <key (s v) pressed?> then\n    change [playersy v] by (-10)\nend\nif <key (a v) pressed?> then\n    change [playersx v] by (-10)\nend\nif <key (d v) pressed?> then\n    change [playersx v] by (10)\nend\nchange [playersx v] by (x position)\nset [camsx v] to (round (PlayerSX))\nset x to (0)\nchange [playersy v] by (y position)\nset [camsy v] to (round (PlayerSY))\nset y to (0)\n\ndefine Cam Controls\nif <(CurrentLevel) = [11]> then\n    if <<((CamSX) + (x position)) < [480]> or <((CamSX) + (x position)) > ((480) * (2))>> then\n        if <(CamSX) > ((480) * (1.5))> then\n            set [camsx v] to ((480) * (2))\n        else\n            set [camsx v] to [480]\n        end\n    else\n        change [playersx v] by (round (x position))\n        set [camsx v] to (round (PlayerSX))\n        set x to (0)\n    end\nelse\n    if <<((CamSX) + (x position)) < [480]> or <((CamSX) + (x position)) > [4320]>> then\n        if <(CamSX) > ((480) * (5))> then\n            set [camsx v] to [4320]\n        else\n            set [camsx v] to [480]\n        end\n    else\n        change [playersx v] by (round (x position))\n        set [camsx v] to (round (PlayerSX))\n        set x to (0)\n    end\nend\nif <((CamSY) + (y position)) < [360]> then\n    set [camsy v] to [360]\nelse\n    change [playersy v] by (round (y position))\n    set [camsy v] to (round (PlayerSY))\n    set y to (0)\nend\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<(item (1) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> then\n    if <(gliding?) > [0]> then\n        change [speed x v] by (-2.5)\n    else\n        change [speed x v] by (-1.5)\n    end\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<(item (2) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> then\n    if <(gliding?) > [0]> then\n        change [speed x v] by (2.5)\n    else\n        change [speed x v] by (1.5)\n    end\nend\n\ndefine Walk (direction) (speed) max step (step)\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (([abs v] of (speed) ) / (8))\nset [slope v] to [0]\nGet Touching <(in platforrm) = [1]>\nswitch costume to (hitbox v)\nrepeat until <<(slope) = (step)> or <(touch) = [0]>>\n    change y by (1)\n    change [slope v] by (1)\n    Get Touching <(in platforrm) = [1]>\nend\nswitch costume to (hitbox v)\nif <(slope) = (step)> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<(touch) = [1]> and <(in platforrm) = [1]>> then\n        set [in platforrm v] to [2]\n        Walk (direction) (speed) max step (step)\n        if <(speed x) = [0]> then\n            set [in platforrm v] to [1]\n        end\n    else\n        if <<<([abs v] of (speed) ) > [3.5]> and <(touch) > [1]>> and <(falling?) > [6]>> then\n            if <not <(lastwalljumpdir) = (direction)>> then\n                set [lastwalljumpdir v] to (direction)\n                set [speed x v] to [0]\n                set [speed y v] to [0]\n                set [falling? v] to [6]\n                set [wall grab v] to [90]\n                if <(updraft?) = [1]> then\n                    set [updraft? v] to [2]\n                end\n                turn left (180) degrees\n            end\n        else\n            set [speed x v] to [0]\n        end\n    end\nend\n\ndefine Controls - Jump, Crouch, GroundPound, Glide, UpDraft, Bounce\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(item (3) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> then\n    if <(wall grab) > [0]> then\n        set [speed x v] to ((([abs v] of (direction) ) / (direction)) * (6))\n        set [speed y v] to [14]\n        set [wall grab v] to [0]\n        set [wall jump v] to [10]\n        start sound [jump2 v]\n    else\n        if <<(jump key) = [0]> and <(falling?) < [3]>> then\n            start sound [jump v]\n            set [speed y v] to [14]\n            set [falling? v] to [6]\n            set [jump key v] to [1]\n        end\n    end\nelse\n    set [jump key v] to [0]\nend\nif <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n    if <(falling?) > [10]> then\n        if <<(groundpoundFC) = [0]> and <<not <key (w v) pressed?>> and <not <key (up arrow v) pressed?>>>> then\n            if <<(wall grab) = [0]> and <(wall jump) = [0]>> then\n                start sound [groundpound v]\n                set [speed x v] to [0]\n                set [speed y v] to [0]\n                set [groundpoundfc v] to [1]\n            end\n        end\n    end\nend\nif <(groundpoundFC) > [0]> then\n    change [groundpoundfc v] by (1)\n    if <(falling?) = [0]> then\n        set [groundpoundfc v] to [0]\n    end\nend\nif <<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(item (3) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> and <<<<(speed y) < [0]> or <(gliding?) = [1]>> and <(falling?) > [10]>> and <<(updraft?) = [0]> or <(updraft?) = [2]>>>> then\n    change [gliding? v] by (1)\nelse\n    set [gliding? v] to [0]\nend\nif <<touching (bouncer v)?> and <<(falling?) > [0]> and <(speed y) < [0]>>> then\n    set [speed y v] to [30]\n    set [bounced v] to [10]\n    set [gliding? v] to [0]\n    set [updraft? v] to [0]\nend\nif <<key (space v) pressed?> or <<(item (4) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> then\n    if <<<<(falling?) > [0]> and <(updraft?) = [0]>> and <(wall jump) = [0]>> and <<(groundpoundFC) = [0]> and <(wall grab) = [0]>>> then\n        start sound [djump v]\n        set [updraft? v] to [1]\n        set [speed y v] to [14]\n        set [speed x v] to ((([abs v] of (direction) ) / (direction)) * (5))\n    end\nend\nif <(speed y) < [-15]> then\n    set [speed y v] to [-15]\nend\n\ndefine Gravity\nif <<<not <(groundpoundFC) > [0]>> and <(groundpoundFC) < [20]>> and <not <(wall grab) > [83]>>> then\n    if <(wall grab) > [10]> then\n        change [speed y v] by (-0.1)\n        switch costume to (wall v)\n        move (-5) steps\n        if <not <touching (level hitbox v)?>> then\n            set [wall grab v] to [0]\n            set [wall jump v] to [0]\n        end\n        move (5) steps\n        switch costume to (hitbox v)\n    else\n        if <<(gliding?) > [0]> and <<(updraft?) = [0]> or <(updraft?) = [2]>>> then\n            if <<<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (right arrow v) pressed?>>> or <<(@MOBILEMODE?) = [true]> and <<(item (1) of [mobilekeyspressed? v]) = [1]> or <(item (2) of [mobilekeyspressed? v]) = [1]>>>> then\n                set [speed y v] to [-0.6]\n            else\n                set [speed y v] to [-2]\n            end\n        else\n            if <<(updraft?) = [0]> or <(updraft?) = [2]>> then\n                if <<<(speed y) < [4]> or <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<(@MOBILEMODE?) = [true]> and <(item (3) of [mobilekeyspressed? v]) = [1]>>>> and <(bounced) < [1]>> then\n                    change [speed y v] by (-1)\n                else\n                    change [speed y v] by (-2)\n                end\n            else\n                if <(speed y) > [0]> then\n                    change [speed y v] by (-1)\n                else\n                    change [speed y v] by (-0.2)\n                end\n            end\n        end\n    end\nelse\n    if <(groundpoundFC) > [5]> then\n        if <(speed y) > [-10]> then\n            set [speed y v] to [-10]\n        else\n            change [speed y v] by (-0.5)\n            if <(speed y) < [-15]> then\n                set [speed y v] to [-15]\n            end\n        end\n    end\nend\nchange y by (speed y)\nchange [falling? v] by (1)\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <<(touch) < (in platforrm)> or <<not <up?>> and <(falling?) = [0]>>>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by ((speed y) * (-1))\n        set [falling? v] to [0]\n    end\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <touching (level hitbox v)?> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <touching (breakplats v)?>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\ndefine Reset Level\nset size to (25) %\nset rotation style [left-right v]\npoint in direction (90)\ngo to [front v] layer\nclear graphic effects\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [bounced v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall grab v] to [0]\nset [groundpoundfc v] to [0]\nset [updraft? v] to [0]\nset [wall jump v] to [0]\nset [gliding? v] to [0]\nset [lastwalljumpdir v] to [0]\nif <(Backwards?) = [false]> then\n    set [camsx v] to [480]\n    set [camsy v] to [360]\n    set [playersx v] to [480]\n    set [playersy v] to [360]\n    go to x: (-150) y: (0)\nelse\n    set [camsx v] to [4320]\n    set [camsy v] to [360]\n    set [playersx v] to [4320]\n    set [playersy v] to [360]\n    go to x: (150) y: (0)\nend\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand_1 v)\n    else\n        switch costume to ([floor v] of ((11) + ((frame) mod (3))) )\n    end\nelse\n    if <(groundpoundFC) = [0]> then\n        if <(wall grab) > [0]> then\n            switch costume to (wallgrab1 v)\n        else\n            if <(updraft?) = [1]> then\n                if <(speed y) > [0]> then\n                    switch costume to (updraft1 v)\n                else\n                    switch costume to (updraft2 v)\n                end\n            else\n                if <(gliding?) > [0]> then\n                    switch costume to (glide1 v)\n                else\n                    if <(speed y) > [0]> then\n                        switch costume to (jump_1 v)\n                    else\n                        switch costume to (fall_1 v)\n                    end\n                end\n            end\n        end\n    else\n        switch costume to (groundpound1 v)\n    end\nend\n\nwhen flag clicked\nclear graphic effects\nset size to (25) %\nhide\n\ndefine Player Physics Engine 1.0\nswitch costume to (hitbox v)\nControls - Jump, Crouch, GroundPound, Glide, UpDraft, Bounce\nGravity\nCheck Hit Ceiling / Floor <(speed y) > [0]>\nif <(y position) < [-189]> then\n    start sound [die v]\n    Reset Level\nend\nif <(falling?) = [0]> then\n    set [wall grab v] to [0]\n    set [wall jump v] to [0]\n    set [updraft? v] to [0]\n    set [groundpoundfc v] to [0]\n    set [lastwalljumpdir v] to [0]\nend\nif <(wall jump) > [0]> then\n    change [wall jump v] by (-1)\nelse\n    if <(wall grab) > [0]> then\n        change [wall grab v] by (-1)\n        if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<(item (1) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> then\n            if <(direction) = [-90]> then\n                set [wall grab v] to [0]\n            end\n        end\n        if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<(item (2) of [mobilekeyspressed? v]) = [1]> and <(@MOBILEMODE?) = [true]>>> then\n            if <(direction) = [90]> then\n                set [wall grab v] to [0]\n            end\n        end\n    else\n        if <(groundpoundFC) = [0]> then\n            Controls - Left and Right\n        end\n    end\nend\nif <(bounced) > [0]> then\n    change [bounced v] by (-1)\nend\nif <(speed x) < [-0.5]> then\n    Walk (-90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\nelse\n    if <(speed x) > [0.5]> then\n        Walk (90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n    else\n        set [frame v] to [0]\n    end\nend\n\ndefine Player_Tick\nif <(Portal) = [0]> then\n    if <(CameraMode) = [1]> then\n        Dev Controls - Fly\n        Set Costume\n        Cam Controls\n        Other Controls\n    else\n        Player Physics Engine 1.0\n        Cam Controls\n        Set Costume\n        Other Controls\n    end\nelse\n    hide\n    change x by ((((item (Portal) of [portal2x v]) - (CamSX)) - (x position)) / (10))\n    change y by ((((item (Portal) of [portal2y v]) - (CamSY)) - (y position)) / (10))\n    if <[20] > ([sqrt v] of ((((x position) - ((item (Portal) of [portal2x v]) - (CamSX))) * ((x position) - ((item (Portal) of [portal2x v]) - (CamSX)))) + (((y position) - ((item (Portal) of [portal2y v]) - (CamSY))) * ((y position) - ((item (Portal) of [portal2y v]) - (CamSY))))) )> then\n        change x by (((item (Portal) of [portal2x v]) - (CamSX)) - (x position))\n        change y by (((item (Portal) of [portal2y v]) - (CamSY)) - (y position))\n        set [portal v] to [0]\n        set [speed x v] to [10]\n        set [speed y v] to [10]\n        switch costume to (fall_1 v)\n        show\n    end\n    Cam Controls\nend\n\nwhen I receive [startgame v]\nwait (0.5) seconds\nReset Level\nbroadcast (Game_Tick v) and wait\n\nwhen I receive [play v]\nReset Level\ngo to [front v] layer\nif <(CurrentLevel) = [12]> then\n    set [bgmusic v] to [EN1]\nelse\n    set [bgmusic v] to [AC]\nend\nbroadcast (PlayBGMusic v)\nforever\n    if <(CurrentLevel) = [11]> then\n        if <(HURTSEQUENCE) = [0]> then\n            Player_Tick\n        else\n            change [hurtsequence v] by (1)\n            switch costume to (stand_1 v)\n            point in direction (90)\n            change x by ((((300) - (CamSX)) - (x position)) / (10))\n            change y by ((((360) - (CamSY)) - (y position)) / (10))\n            Cam Controls\n            if <(HURTSEQUENCE) > [60]> then\n                set [hurtsequence v] to [0]\n            end\n        end\n    else\n        Player_Tick\n    end\n    if <touching (end v)?> then\n        start sound [win v]\n        wait (0.8) seconds\n        Out\n        point in direction (90)\n        set size to (100) %\n        switch costume to (end1 v)\n        go to x: (-292) y: (87)\n        wait (0.5) seconds\n        show\n        glide (0.8) secs to x: (297) y: (0)\n        hide\n        set size to (25) %\n        broadcast (Transition In v) and wait\n        if <(SelectedLevelTrue?) = [true]> then\n            hide\n            broadcast (DeleteAllClones v) and wait\n            broadcast (BackToLevelSelectMenu v) and wait\n        end\n        if <not <(CurrentLevel) = [15]>> then\n            if <(SelectedLevelTrue?) = [false]> then\n                broadcast (LevelStory v) and wait\n            end\n        end\n        set [collected v] to [0]\n        set [clonesamde v] to [0]\n        if <(Backwards?) = [false]> then\n            if <(SelectedLevelTrue?) = [false]> then\n                if <(CurrentLevel) = [15]> then\n                    if <(username) = [23ScratchMan]> then\n                        play sound [Pop v] until done\n                        play sound [Pop v] until done\n                        play sound [Pop v] until done\n                        play sound [Pop v] until done\n                    else\n                        if <(SelectedLevelTrue?) = [false]> then\n                            change [☁ respecttothepeoplewho100%thisgame v] by (1)\n                            set [timer v] to (timer)\n                            if <(Timer) < [50]> then\n                            end\n                        end\n                    end\n                end\n            end\n            if <(SelectedLevelTrue?) = [false]> then\n                change [currentlevel v] by (1)\n            end\n            if <(CurrentLevel) = [4]> then\n                broadcast (StopBGMusic v) and wait\n                set [bgmusic v] to [FG]\n                broadcast (PlayBGMusic v)\n            end\n            if <(CurrentLevel) = [7]> then\n                broadcast (StopBGMusic v) and wait\n                set [bgmusic v] to [3D]\n                broadcast (PlayBGMusic v)\n            end\n            if <(CurrentLevel) = [14]> then\n                broadcast (StopBGMusic v) and wait\n                set [bgmusic v] to [EN2]\n                broadcast (PlayBGMusic v)\n            end\n            if <(SelectedLevelTrue?) = [false]> then\n                if <(CurrentLevel) = [16]> then\n                    broadcast (DeleteAllClones v) and wait\n                    switch backdrop to (black v)\n                    hide\n                    broadcast (StopBGMusic v) and wait\n                    wait (5) seconds\n                    broadcast (Cutscene END v)\n                    stop [this script v]\n                end\n                if <(CurrentLevel) = [11]> then\n                    broadcast (StopBGMusic v) and wait\n                    go to x: (0) y: (-77)\n                    show\n                    switch costume to (stand_1 v)\n                    broadcast (CutsceneBossIntroSetUp v) and wait\n                    go to [front v] layer\n                    broadcast (Transition Out v) and wait\n                    wait (2) seconds\n                    broadcast (CutsceneBossIntro v) and wait\n                    broadcast (Transition In v) and wait\n                    set [bgmusic v] to [BOSS]\n                    broadcast (PlayBGMusic v)\n                end\n                if <(CurrentLevel) = [999]> then\n                    set [currentlevel v] to [4]\n                    set [backwards? v] to [true]\n                    wait (2) seconds\n                    broadcast (BackwardsMessage v) and wait\n                end\n            end\n        else\n            change [currentlevel v] by (-1)\n            if <(CurrentLevel) = [0]> then\n                wait (2) seconds\n                broadcast (BackwardsMessage v) and wait\n                stop [all v]\n            end\n        end\n        broadcast (StartGame v) and wait\n        if <(SelectedLevelTrue?) = [true]> then\n        end\n        broadcast (Transition Out v) and wait\n        if <not <(CurrentLevel) = [11]>> then\n        go to [front v] layer\n    end\n    if <(CurrentLevel) = [11]> then\n        if <<(BossVulnerable?) = [true]> and <<<touching (boss head hitbox v)?> and <(speed y) < [-0.1]>> and <(HURTSEQUENCE) = [0]>>> then\n            start sound [nsmbwiiParaBeetle1up v]\n            set [hurtsequence v] to [1]\n            change [bossphase v] by (1)\n            change [bosshp v] by (-1)\n            if <(BossHP) = [0]> then\n                if <(username) = [23ScratchMan]> then\n                    play sound [Pop v] until done\n                    play sound [Pop v] until done\n                    play sound [Pop v] until done\n                    play sound [Pop v] until done\n                else\n                    change [☁ goodjobbeatingtheboss v] by (1)\n                    set [timer v] to (timer)\n                    if <(Timer) < [50]> then\n                    end\n                end\n                broadcast (Transition In v) and wait\n                broadcast (DeleteAllClones v) and wait\n                hide\n                broadcast (CutsceneBossDieSetUp v) and wait\n                broadcast (Transition Out v) and wait\n                broadcast (CutsceneBosDie v)\n                stop [this script v]\n            end\n        end\n        if <<<(PlayerVulnerable?) = [true]> and <<touching (bossfire attack4 v)?> or <<touching (boss body hitbox v)?> or <<touching (attack3 v)?> or <<touching (attack1 laser v)?> and <([costume # v] of [attack1 laser v]) = [2]>>>>>> and <(HURTSEQUENCE) = [0]>> then\n            start sound [die v]\n            set [hurtsequence v] to [1]\n            change [playerhp v] by (-1)\n            if <(PlayerHP) = [0]> then\n                broadcast (StopBGMusic v) and wait\n                broadcast (Transition In v) and wait\n                wait (4) seconds\n                broadcast (MessageYouDied v) and wait\n                broadcast (DeleteAllClones v) and wait\n                hide\n                go to x: (0) y: (-77)\n                show\n                switch costume to (stand_1 v)\n                broadcast (CutsceneBossIntroSetUp v) and wait\n                go to [front v] layer\n                broadcast (Transition Out v) and wait\n                wait (2) seconds\n                broadcast (CutsceneBossIntro v) and wait\n                broadcast (Transition In v) and wait\n                set [bgmusic v] to [BOSS]\n                broadcast (PlayBGMusic v)\n                broadcast (StartGame v) and wait\n                broadcast (Transition Out v) and wait\n            end\n        end\n    end\n    if <touching (hazard v)?> then\n        start sound [die v]\n        if <(pick random (0) to (1)) = [0]> then\n            set [speed x v] to [-5]\n        else\n            set [speed x v] to [5]\n        end\n        set [speed y v] to [12]\n        switch costume to (dead v)\n        point in direction (90)\n        set rotation style [all around v]\n        repeat (30)\n            change x by (speed x)\n            change y by (speed y)\n            change [speed y v] by (-1)\n            set [speed x v] to ((speed x) * (0.9))\n            turn right (5) degrees\n            change size by (4)\n            change [brightness v] effect by (3)\n            change [ghost v] effect by (3)\n        end\n        hide\n        Reset Level\n    end\n    broadcast (Game_Tick v) and wait\nend\n\ndefine Out\nset [ghost v] effect to (0)\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nclear graphic effects\n\ndefine Other Controls\nif <key (r v) pressed?> then\n    Reset Level\nend\n\nwhen I receive [play v]\nforever\n    Other Controls\nend\n\nbroadcast (PLAYBGMUSIC v)\n\nbroadcast (StopBGMusic v) and wait\n\n\n\nbroadcast (BackToLevelSelectMenu v)\n\nstop [other scripts in sprite v]\nstop [this script v]\n\nstart sound [Pop v]\n\nReset Level\n\nchange [currentlevel v] by (1)\n\n@Art\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\n\nwhen I receive [setupart v]\ngo to [front v] layer\nCreate\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at X (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\ndefine Find Costume Numbers\nset [costumenumb v] to (join (CurrentLevel) [_11])\nswitch costume to (costumeNumb)\nnext costume\nchange [costumenumb v] by (1)\nrepeat until <not <(letter (1) of (costume [name v])) = (CurrentLevel)>>\n    next costume\n    change [costumenumb v] by (1)\nend\n\nClone at X [2000] Y [2160]\n\ndefine Create\nFind Costume Numbers\nset [ghost v] effect to (0)\nswitch costume to (join (CurrentLevel) [_11])\nrepeat (item (CurrentLevel) of [levelsize v])\n    Clone at X ((letter ((length of (CurrentLevel)) + (2)) of (costume [name v])) * (480)) Y ((letter ((length of (CurrentLevel)) + (3)) of (costume [name v])) * (360))\n    next costume\n    go to [front v] layer\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\nswitch costume to (join (CurrentLevel) [_11])\n\nchange [costumenumb v] by (1)\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\nset [level v] to (CurrentLevel)\n\n\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\nchange [clonesamde v] by (1)\n\nset [currentlevel v] to [4]\n\nadd [10] to [levelsize v]\nadd [10] to [levelsize v]\n\n@Level HitBox\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\n\nwhen I receive [setuphitbox1 v]\nCreate\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at X (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\ndefine Find Costume Numbers\nset [costumenumb v] to (join (CurrentLevel) [_11])\nswitch costume to (costumeNumb)\nnext costume\nchange [costumenumb v] by (1)\nrepeat until <not <(letter (1) of (costume [name v])) = (CurrentLevel)>>\n    next costume\n    change [costumenumb v] by (1)\nend\n\nchange [costumenumb v] by (1)\n\ndefine Create\nFind Costume Numbers\ngo to [front v] layer\nset [ghost v] effect to (100)\nswitch costume to (join (CurrentLevel) [_11])\nrepeat (item (CurrentLevel) of [levelsize v])\n    Clone at X ((letter ((length of (CurrentLevel)) + (2)) of (costume [name v])) * (480)) Y ((letter ((length of (CurrentLevel)) + (3)) of (costume [name v])) * (360))\n    next costume\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\nclear graphic effects\ngo to [front v] layer\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\nchange [clonesamde v] by (1)\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\n@Hazard\n\nwhen flag clicked\nhide\n\ndefine Clone at X (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [setuphazards v]\nswitch costume to (a v)\ngo to [front v] layer\nDel\nif <(CurrentLevel) = [3]> then\n    Clone at X [1025] Y [730]\n    Clone at X [1919] Y [600]\n    Clone at X [1988] Y [600]\n    Clone at X [2060] Y [600]\n    Clone at X [1842] Y [402]\n    Clone at X [1919] Y [382]\n    Clone at X [1988] Y [362]\n    Clone at X [2130] Y [600]\n    Clone at X [3248] Y [870]\n    Clone at X [3248] Y [953]\n    Clone at X [3248] Y [787]\n    Clone at X [3248] Y [704]\n    Clone at X [3248] Y [621]\n    Clone at X [2025] Y [638]\n    Clone at X [2071] Y [807]\n    Clone at X [2025] Y [878]\nelse\n    if <(CurrentLevel) = [4]> then\n        Clone at X [1074] Y [537]\n        Clone at X [1074] Y [457]\n        Clone at X [1074] Y [377]\n        Clone at X [1074] Y [297]\n        Clone at X [1074] Y [217]\n        Clone at X [2939] Y [339]\n        Clone at X [2241] Y [742]\n        Clone at X [2344] Y [722]\n        Clone at X [2441] Y [730]\n        Clone at X [2547] Y [716]\n        Clone at X [2652] Y [723]\n        Clone at X [2746] Y [759]\n        Clone at X [2847] Y [780]\n        Clone at X [2935] Y [768]\n        Clone at X [2931] Y [908]\n    else\n        if <(CurrentLevel) = [5]> then\n            Clone at X [2344] Y [489]\n            Clone at X [2379] Y [397]\n            Clone at X [2344] Y [317]\n            Clone at X [2394] Y [241]\n        else\n            if <(CurrentLevel) = [6]> then\n                Clone at X [733] Y [435]\n                Clone at X [717] Y [524]\n            else\n                if <(CurrentLevel) = [7]> then\n                    Clone at X [705] Y [1621]\n                    Clone at X [722] Y [1717]\n                    Clone at X [698] Y [1818]\n                    Clone at X [578] Y [1326]\n                    Clone at X [659] Y [1243]\n                    Clone at X [675] Y [1150]\n                    Clone at X [675] Y [1063]\n                    Clone at X [3916] Y [546]\n                    Clone at X [3938] Y [460]\n                    Clone at X [3928] Y [372]\n                    Clone at X [3936] Y [294]\n                    Clone at X [2907] Y [727]\n                    Clone at X [2928] Y [827]\n                    Clone at X [1293] Y [412]\n                    Clone at X [1302] Y [319]\n                    Clone at X [3940] Y [212]\n                    Clone at X [516] Y [1401]\n                else\n                    if <(CurrentLevel) = [8]> then\n                        Clone at X [1076] Y [1021]\n                        Clone at X [1106] Y [1118]\n                        Clone at X [1089] Y [1209]\n                        Clone at X [2173] Y [784]\n                        Clone at X [2142] Y [687]\n                        Clone at X [2124] Y [593]\n                        Clone at X [2124] Y [497]\n                        Clone at X [2157] Y [392]\n                        Clone at X [2207] Y [287]\n                        Clone at X [2419] Y [706]\n                        Clone at X [2275] Y [602]\n                        Clone at X [2439] Y [486]\n                        Clone at X [2357] Y [423]\n                        Clone at X [2510] Y [1025]\n                        Clone at X [2477] Y [1111]\n                        Clone at X [2499] Y [1200]\n                        Clone at X [2928] Y [446]\n                        Clone at X [2928] Y [541]\n                        Clone at X [2928] Y [631]\n                        Clone at X [3925] Y [699]\n                        Clone at X [3876] Y [780]\n                    else\n                        if <(CurrentLevel) = [9]> then\n                            Clone at X [1437] Y [360]\n                            Clone at X [1451] Y [458]\n                            Clone at X [1468] Y [545]\n                            Clone at X [1475] Y [631]\n                            Clone at X [1991] Y [663]\n                            Clone at X [2090] Y [663]\n                            Clone at X [2185] Y [663]\n                            Clone at X [2185] Y [663]\n                            Clone at X [2411] Y [369]\n                            Clone at X [2411] Y [464]\n                            Clone at X [2411] Y [559]\n                            Clone at X [2411] Y [654]\n                            Clone at X [2411] Y [749]\n                            Clone at X [2411] Y [844]\n                            Clone at X [2411] Y [939]\n                            Clone at X [2411] Y [1034]\n                            Clone at X [2411] Y [1131]\n                            Clone at X [2411] Y [1226]\n                            Clone at X [2411] Y [1321]\n                            Clone at X [438] Y [625]\n                            Clone at X [470] Y [788]\n                            Clone at X [3692] Y [452]\n                            Clone at X [3692] Y [365]\n                            Clone at X [3808] Y [649]\n                            Clone at X [3837] Y [586]\n                            Clone at X [3904] Y [580]\n                            Clone at X [3101] Y [776]\n                            Clone at X [3954] Y [940]\n                            Clone at X [3954] Y [1035]\n                        else\n                            if <(CurrentLevel) = [10]> then\n                                Clone at X [1743] Y [534]\n                                Clone at X [658] Y [1320]\n                                Clone at X [814] Y [1379]\n                                Clone at X [920] Y [1511]\n                                Clone at X [1187] Y [1464]\n                                Clone at X [1374] Y [1361]\n                                Clone at X [1472] Y [1318]\n                                Clone at X [1580] Y [1313]\n                                Clone at X [1680] Y [1318]\n                                Clone at X [2672] Y [1286]\n                                Clone at X [2565] Y [1268]\n                                Clone at X [2455] Y [1270]\n                                Clone at X [2181] Y [1293]\n                                Clone at X [2278] Y [1259]\n                                Clone at X [2368] Y [1239]\n                                Clone at X [2930] Y [1292]\n                                Clone at X [3024] Y [1282]\n                                Clone at X [3114] Y [1282]\n                                Clone at X [3204] Y [1282]\n                                Clone at X [3204] Y [1282]\n                                Clone at X [3294] Y [1282]\n                                Clone at X [3384] Y [1282]\n                                Clone at X [3474] Y [1282]\n                                Clone at X [3564] Y [1282]\n                                Clone at X [3654] Y [1282]\n                                Clone at X [3854] Y [1282]\n                                Clone at X [3944] Y [1282]\n                                Clone at X [4034] Y [1282]\n                                Clone at X [4133] Y [1352]\n                                Clone at X [4219] Y [1381]\n                                Clone at X [240] Y [1326]\n                            else\n                                if <(CurrentLevel) = [12]> then\n                                    Clone Vertical Wall 1 at [723] [206] length [3]\n                                    Clone Vertical Wall 1 at [906] [400] length [5]\n                                    Clone Vertical Wall 1 at [1292] [542] length [4]\n                                    Clone Vertical Wall 1 at [1370] [854] length [3]\n                                    Clone Vertical Wall 1 at [1292] [1059] length [2]\n                                    Clone Horizontal Wall 1 at [1306] [400] length [4]\n                                    Clone Vertical Wall 1 at [1781] [215] length [3]\n                                    Clone Horizontal Wall 1 at [2313] [359] length [2]\n                                    Clone at X [2611] Y [276]\n                                    Clone at X [2744] Y [350]\n                                    Clone at X [2671] Y [516]\n                                    Clone at X [3141] Y [611]\n                                    Clone at X [3297] Y [507]\n                                else\n                                    if <(CurrentLevel) = [13]> then\n                                        Clone Vertical Wall 1 at [581] [276] length [10]\n                                        Clone Vertical Wall 1 at [747] [1325] length [3]\n                                        Clone at X [834] Y [1458]\n                                        Clone Vertical Wall 1 at [935] [1200] length [2]\n                                        Clone Horizontal Wall 1 at [828] [978] length [4]\n                                        Clone Vertical Wall 1 at [1125] [1065] length [6]\n                                        Clone at X [891] Y [279]\n                                        Clone Horizontal Wall 1 at [648] [363] length [5]\n                                        Clone Horizontal Wall 1 at [1277] [578] length [4]\n                                        Clone Vertical Wall 1 at [1574] [654] length [3]\n                                        Clone Vertical Wall 1 at [1733] [473] length [7]\n                                        Clone at X [1447] Y [235]\n                                        Clone at X [1568] Y [332]\n                                        Clone Vertical Wall 1 at [1989] [212] length [8]\n                                        Clone at X [2754] Y [436]\n                                        Clone Horizontal Wall 1 at [2776] [734] length [2]\n                                        Clone at X [2669] Y [441]\n                                        Clone at X [2987] Y [723]\n                                        Clone Vertical Wall 1 at [3342] [235] length [8]\n                                    else\n                                        if <(CurrentLevel) = [14]> then\n                                            Clone Vertical Wall 1 at [831] [451] length [5]\n                                            Clone Horizontal Wall 1 at [499] [496] length [2]\n                                            Clone Horizontal Wall 1 at [677] [346] length [2]\n                                            Clone at X [699] Y [525]\n                                            Clone Vertical Wall 1 at [1078] [493] length [8]\n                                            Clone Vertical Wall 1 at [435] [778] length [3]\n                                            Clone Vertical Wall 1 at [3278] [219] length [8]\n                                            Clone Vertical Wall 1 at [2537] [213] length [4]\n                                            Clone Horizontal Wall 1 at [2718] [595] length [5]\n                                            Clone Horizontal Wall 1 at [2887] [408] length [4]\n                                            Clone at X [2173] Y [483]\n                                            Clone at X [2613] Y [576]\n                                            Clone at X [2558] Y [651]\n                                        else\n                                            if <(CurrentLevel) = [15]> then\n                                                Clone Vertical Wall 1 at [1318] [226] length [3]\n                                                Clone at X [1141] Y [380]\n                                                Clone at X [1327] Y [770]\n                                                Clone Vertical Wall 1 at [1555] [754] length [3]\n                                                Clone Horizontal Wall 1 at [1620] [696] length [2]\n                                                Clone Vertical Wall 1 at [1807] [287] length [5]\n                                                Clone Vertical Wall 1 at [1971] [223] length [2]\n                                                Clone at X [1432] Y [641]\n                                                Clone at X [1589] Y [529]\n                                                Clone at X [1687] Y [425]\n                                                Clone at X [1388] Y [492]\n                                                Clone at X [1530] Y [397]\n                                                Clone Vertical Wall 1 at [2125] [592] length [5]\n                                                Clone Vertical Wall 1 at [2284] [1001] length [3]\n                                                Clone Horizontal Wall 1 at [2208] [839] length [3]\n                                                Clone at X [2445] Y [912]\n                                                Clone Horizontal Wall 1 at [3181] [869] length [5]\n                                                Clone Horizontal Wall 1 at [3670] [1456] length [3]\n                                                Clone Vertical Wall 1 at [3777] [1616] length [2]\n                                                Clone Vertical Wall 1 at [3946] [1503] length [2]\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\ndefine Del\ndelete this clone\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\nset size to (60) %\nturn right (-8) degrees\n\ndelete this clone\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\nswitch costume to (a v)\n\nswitch costume to (a v)\n\ndefine Clone Vertical Wall 1 at (x) (y) length (l)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\nrepeat ((l) - (1))\n    change [y v] by (100)\n    change [clonesamde v] by (1)\n    create clone of (_myself_ v)\nend\n\ndefine Clone Horizontal Wall 1 at (x) (y) length (l)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\nrepeat ((l) - (1))\n    change [x v] by (100)\n    change [clonesamde v] by (1)\n    create clone of (_myself_ v)\nend\n\n@BreakPlats\n\ndefine Clone at X (x) Y (y)\nclear graphic effects\npoint in direction (90)\nset [x v] to (x)\nset [y v] to (y)\nset [originaly v] to (y)\nset [dir v] to (pick random (0) to (1))\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nset size to (60) %\nPosition ((x) - (CamSX)) ((y) - (CamSY))\nif <<<touching (the glidy boy v)?> and <([falling? v] of [the glidy boy v]) = [0]>> or <(breakframes) > [0]>> then\n    change [breakframes v] by (1)\n    if <(breakframes) = [15]> then\n        start sound [end v]\n    end\nend\nif <<(breakframes) > [15]> and <(breakframes) < [25]>> then\n    change [y v] by (-5)\n    change [ghost v] effect by (8)\n    if <(dir) = [1]> then\n        turn right (3) degrees\n    else\n        turn right (-3) degrees\n    end\nend\nif <(breakframes) > [25]> then\n    hide\nend\nif <(breakframes) > [60]> then\n    set [breakframes v] to [0]\n    set [y v] to (originaly)\n    clear graphic effects\n    point in direction (90)\nend\n\nwhen flag clicked\nset [breakframes v] to [0]\nclear graphic effects\nhide\n\ndefine Del\ndelete this clone\n\nwhen I receive [setupbreakplats v]\nswitch costume to (costume1 v)\ngo to [front v] layer\nDel\nif <(CurrentLevel) = [4]> then\n    Clone at X [522] Y [428]\n    Clone at X [361] Y [615]\n    Clone at X [793] Y [836]\n    Clone at X [953] Y [877]\n    Clone at X [1122] Y [900]\n    Clone at X [2403] Y [273]\n    Clone at X [2442] Y [375]\n    Clone at X [2453] Y [508]\n    Clone at X [2569] Y [535]\n    Clone at X [2541] Y [320]\n    Clone at X [2531] Y [444]\n    Clone at X [3938] Y [346]\nelse\n    if <<(CurrentLevel) = [2]> and <(Backwards?) = [true]>> then\n        Clone at X [2423] Y [312]\n        Clone at X [2411] Y [432]\n        Clone at X [2356] Y [556]\n    else\n        if <<(CurrentLevel) = [1]> and <(Backwards?) = [true]>> then\n            Clone at X [3570] Y [378]\n            Clone at X [3680] Y [479]\n            Clone at X [2052] Y [360]\n            Clone at X [2164] Y [462]\n        else\n            if <(CurrentLevel) = [5]> then\n                Clone at X [1387] Y [693]\n                Clone at X [1774] Y [720]\n                Clone at X [1935] Y [688]\n                Clone at X [2076] Y [649]\n            else\n                if <(CurrentLevel) = [6]> then\n                    Clone at X [1192] Y [597]\n                    Clone at X [3355] Y [404]\n                    Clone at X [3406] Y [344]\n                    Clone at X [3565] Y [285]\n                else\n                    if <(CurrentLevel) = [8]> then\n                        Clone at X [1884] Y [865]\n                        Clone at X [2085] Y [827]\n                        Clone at X [3245] Y [391]\n                        Clone at X [3420] Y [327]\n                        Clone at X [3562] Y [362]\n                        Clone at X [3644] Y [429]\n                        Clone at X [4113] Y [391]\n                    else\n                        if <(CurrentLevel) = [9]> then\n                            Clone at X [1678] Y [760]\n                            Clone at X [1851] Y [733]\n                            Clone at X [1953] Y [814]\n                            Clone at X [1953] Y [957]\n                            Clone at X [1953] Y [1098]\n                            Clone at X [1782] Y [643]\n                            Clone at X [1668] Y [553]\n                            Clone at X [1337] Y [399]\n                            Clone at X [1956] Y [523]\n                            Clone at X [2068] Y [447]\n                            Clone at X [2180] Y [355]\n                        else\n                            if <(CurrentLevel) = [10]> then\n                                Clone at X [3196] Y [1532]\n                                Clone at X [3401] Y [1454]\n                            else\n                                if <(CurrentLevel) = [11]> then\n                                    Clone at X [513] Y [375]\n                                    Clone at X [907] Y [375]\n                                    Clone at X [611] Y [464]\n                                    Clone at X [807] Y [464]\n                                else\n                                    if <(CurrentLevel) = [12]> then\n                                        Clone at X [620] Y [354]\n                                        Clone at X [811] Y [514]\n                                        Clone at X [1698] Y [361]\n                                        Clone at X [1979] Y [380]\n                                        Clone at X [2521] Y [316]\n                                        Clone at X [2814] Y [432]\n                                        Clone at X [3232] Y [557]\n                                        Clone at X [3764] Y [359]\n                                    else\n                                        if <(CurrentLevel) = [13]> then\n                                            Clone at X [267] Y [417]\n                                            Clone at X [487] Y [572]\n                                            Clone at X [267] Y [727]\n                                            Clone at X [487] Y [882]\n                                            Clone at X [267] Y [1037]\n                                            Clone at X [487] Y [1192]\n                                            Clone at X [933] Y [1356]\n                                            Clone at X [1043] Y [241]\n                                            Clone at X [1363] Y [727]\n                                            Clone at X [1646] Y [836]\n                                            Clone at X [1867] Y [429]\n                                            Clone at X [1811] Y [589]\n                                        else\n                                            if <(CurrentLevel) = [14]> then\n                                                Clone at X [2860] Y [729]\n                                            else\n                                                if <(CurrentLevel) = [15]> then\n                                                    Clone at X [1214] Y [325]\n                                                    Clone at X [1477] Y [791]\n                                                    Clone at X [1892] Y [239]\n                                                    Clone at X [1892] Y [337]\n                                                    Clone at X [3857] Y [1563]\n                                                    Clone at X [3251] Y [913]\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\n@Collectible\n\nwhen flag clicked\nhide\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\ndefine Clone at X (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\nturn right (pick random (0.5) to (2)) degrees\nif <touching (the glidy boy v)?> then\n    change [collected v] by (1)\n    if <(Collected) = [9]> then\n        start sound [whenyou get the ninth coin YES v]\n    else\n        start sound [coin v]\n    end\n    delete this clone\nend\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\nwhen I receive [setupcollectible v]\nswitch costume to (costume2 v)\ngo to [front v] layer\nif <(CurrentLevel) = [5]> then\n    Clone at X [681] Y [440]\n    Clone at X [1024] Y [249]\n    Clone at X [691] Y [949]\n    Clone at X [739] Y [949]\n    Clone at X [1587] Y [597]\n    Clone at X [2321] Y [1015]\n    Clone at X [3037] Y [919]\n    Clone at X [3763] Y [322]\n    Clone at X [4391] Y [253]\nelse\n    if <(CurrentLevel) = [6]> then\n        Clone at X [702] Y [870]\n        Clone at X [264] Y [1278]\n        Clone at X [320] Y [1278]\n        Clone at X [376] Y [1278]\n        Clone at X [1954] Y [753]\n        Clone at X [1758] Y [254]\n        Clone at X [3983] Y [262]\n        Clone at X [251] Y [578]\n        Clone at X [3020] Y [623]\n    else\n        if <(CurrentLevel) = [7]> then\n            Clone at X [617] Y [1610]\n            Clone at X [566] Y [1610]\n            Clone at X [566] Y [1657]\n            Clone at X [617] Y [1657]\n            Clone at X [1574] Y [636]\n            Clone at X [2450] Y [269]\n            Clone at X [2450] Y [324]\n            Clone at X [2450] Y [381]\n            Clone at X [1231] Y [294]\n        else\n            if <(CurrentLevel) = [8]> then\n                Clone at X [356] Y [710]\n                Clone at X [841] Y [463]\n                Clone at X [265] Y [854]\n                Clone at X [316] Y [854]\n                Clone at X [2404] Y [580]\n                Clone at X [4001] Y [531]\n                Clone at X [4001] Y [572]\n                Clone at X [799] Y [463]\n                Clone at X [1564] Y [1030]\n            else\n                if <(CurrentLevel) = [9]> then\n                    Clone at X [278] Y [654]\n                    Clone at X [1233] Y [522]\n                    Clone at X [1187] Y [522]\n                    Clone at X [1338] Y [432]\n                    Clone at X [1961] Y [1312]\n                    Clone at X [1665] Y [521]\n                    Clone at X [3890] Y [655]\n                    Clone at X [2342] Y [659]\n                    Clone at X [3577] Y [466]\n                else\n                    if <(CurrentLevel) = [10]> then\n                        Clone at X [4347] Y [289]\n                        Clone at X [4299] Y [289]\n                        Clone at X [4251] Y [289]\n                        Clone at X [4203] Y [289]\n                        Clone at X [4155] Y [289]\n                        Clone at X [4321] Y [323]\n                        Clone at X [4273] Y [323]\n                        Clone at X [4225] Y [323]\n                        Clone at X [4177] Y [323]\n                    end\n                end\n            end\n        end\n    end\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\nswitch costume to (costume2 v)\ngo to [front v] layer\n\n@End\n\nwhen flag clicked\nset size to (50) %\nhide\n\ndefine Clone at X (x) Y (y)\nswitch costume to (unnamed v)\nset size to (50) %\n\ncreate clone of (_myself_ v)\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\nif <<(CurrentLevel) > [4]> and <(CurrentLevel) < [11]>> then\n    if <not <(Collected) > [8]>> then\n        hide\n    end\nend\n\nwhen I receive [setupend v]\ngo to [front v] layer\nif <(Backwards?) = [false]> then\n    set [x v] to [4495]\n    set [y v] to [250]\n    point in direction (90)\nelse\n    set [x v] to [289]\n    set [y v] to [285]\n    point in direction (-90)\nend\n\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\nClone at X [4495] Y [250]\n\ndelete this clone\n\nwhen I receive [deleteallclones v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\nshow\n\n@Bouncer\n\ndefine Clone at X (x) Y (y)\nclear graphic effects\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\nset [cloneid v] to [0]\nset [clonecostume v] to [0]\ncreate clone of (_myself_ v)\nset [cloneid v] to [1]\nset [clonecostume v] to [1]\nset [y v] to ((y) - (10))\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\ndefine Del\ndelete this clone\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\nif <(cloneID) = [0]> then\n    switch costume to (hitbox v)\n    if <<(username) = [23ScratchMan]> and <key (z v) pressed?>> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost v] effect to (100)\n    end\nelse\n    if <<touching (the glidy boy v)?> or <(clonecostume) > [1]>> then\n        change [clonecostume v] by (1)\n    end\n    if <(clonecostume) = [30]> then\n        set [clonecostume v] to [1]\n    end\nend\nif <<(clonecostume) = [1]> or <(clonecostume) > [9]>> then\n    switch costume to (art v)\nelse\n    switch costume to (item (clonecostume) of [clonecostume v])\n    if <(clonecostume) = [3]> then\n        start sound [maybe bounce v]\n    end\nend\n\nwhen I receive [setupbounce v]\nswitch costume to (hitbox v)\ngo to [front v] layer\nif <(CurrentLevel) = [6]> then\n    Clone at X [522] Y [253]\n    Clone at X [769] Y [966]\n    Clone at X [1354] Y [643]\n    Clone at X [1437] Y [643]\n    Clone at X [1520] Y [643]\n    Clone at X [1603] Y [643]\n    Clone at X [3025] Y [283]\nelse\n    if <(CurrentLevel) = [7]> then\n        Clone at X [2976] Y [232]\n        Clone at X [3074] Y [454]\n        Clone at X [3840] Y [678]\n    else\n        if <(CurrentLevel) = [8]> then\n            Clone at X [1584] Y [711]\n            Clone at X [4038] Y [248]\n        else\n            if <(CurrentLevel) = [9]> then\n                Clone at X [619] Y [275]\n            else\n                if <(CurrentLevel) = [10]> then\n                    Clone at X [1922] Y [1384]\n                else\n                    if <(CurrentLevel) = [13]> then\n                        Clone at X [846] Y [1228]\n                        Clone at X [1574] Y [ 432]\n                        Clone at X [1433] Y [432]\n                    else\n                        if <(CurrentLevel) = [14]> then\n                            Clone at X [432] Y [519]\n                            Clone at X [1014] Y [837]\n                        else\n                            if <(CurrentLevel) = [15]> then\n                                Clone at X [2034] Y [590]\n                                Clone at X [1900] Y [897]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\n@Extra Arrows\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\nwhen I receive [game_tick v]\nPosition ((x) - (CamSX)) ((y) - (CamSY))\n\ndefine Clone at X (x) Y (y)\nclear graphic effects\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\nset [cloneid v] to [0]\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nclear graphic effects\nhide\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setupextraarrows v]\nswitch costume to (costume2 v)\ngo to [front v] layer\nif <(CurrentLevel) = [12]> then\n    switch costume to (costume2 v)\n    Clone at X [1821] Y [495]\n    Clone at X [2334] Y [450]\n    switch costume to (costume3 v)\n    Clone at X [3064] Y [470]\n    switch costume to (costume4 v)\n    Clone at X [3522] Y [460]\n    Clone at X [4006] Y [304]\nelse\n    if <(CurrentLevel) = [13]> then\n        switch costume to (costume5 v)\n        Clone at X [1029] Y [1094]\n        switch costume to (costume6 v)\n        Clone at X [1472] Y [831]\n    else\n        if <(CurrentLevel) = [14]> then\n            switch costume to (costume7 v)\n            Clone at X [760] Y [622]\n            switch costume to (costume8 v)\n            Clone at X [833] Y [1026]\n            switch costume to (costume9 v)\n            Clone at X [2304] Y [502]\n            switch costume to (costume7 v)\n            Clone at X [3191] Y [685]\n            switch costume to (costume4 v)\n            Clone at X [3919] Y [463]\n        else\n            if <(CurrentLevel) = [15]> then\n                switch costume to (costume3 v)\n                Clone at X [1054] Y [235]\n                switch costume to (costume2 v)\n                Clone at X [581] Y [208]\n                switch costume to (costume7 v)\n                Clone at X [2185] Y [1096]\n                switch costume to (costume9 v)\n                Clone at X [3370] Y [1069]\n                Clone at X [3370] Y [1269]\n                Clone at X [3370] Y [1469]\n            end\n        end\n    end\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\n@MessageImpossibleLevel\n\nwhen flag clicked\ngo to x: (0) y: (0)\nclear graphic effects\nhide\n\nwhen I receive [messageimpossiblelevel v]\nwait (3) seconds\ngo to [front v] layer\nswitch costume to (00 v)\nshow\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nforever\n    switch costume to (join (<<<(mouse x) > [-180]> and <(mouse x) < [-63]>> and <<(mouse y) > [-157]> and <(mouse y) < [-70]>>> * (1)) (<<<(mouse x) > [20]> and <(mouse x) < [128]>> and <<(mouse y) > [-147]> and <(mouse y) < [-82]>>> * (1)))\n    if <mouse down?> then\n        wait until <not <mouse down?>>\n        if <(mouse x) > [0]> then\n            repeat (50)\n                change [ghost v] effect by (2)\n            end\n            switch costume to (costume4 v)\n            repeat (50)\n                change [ghost v] effect by (-2)\n            end\n            wait until <mouse down?>\n            wait until <not <mouse down?>>\n            repeat (50)\n                change [ghost v] effect by (2)\n            end\n            switch costume to (00 v)\n            repeat (50)\n                change [ghost v] effect by (-2)\n            end\n        else\n            stop [other scripts in sprite v]\n            repeat (50)\n                change [ghost v] effect by (2)\n            end\n            hide\n            clear graphic effects\n            set [currentlevel v] to [12]\n            broadcast (StartGame v) and wait\n            broadcast (PLAY v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [messageyoudied v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nswitch costume to (costume5 v)\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-4)\nend\nrepeat (8)\n    switch costume to (costume2 v)\n    wait (0.3) seconds\n    switch costume to (costume5 v)\n    wait (0.3) seconds\nend\nrepeat (20)\n    change [ghost v] effect by (4)\nend\nhide\nclear graphic effects\nwait (4) seconds\n\nwhen I receive [messageimpossiblelevel v]\nforever\n    go to x: (5) y: (-5)\n    wait (1) seconds\n    go to x: (-5) y: (5)\n    wait (1) seconds\nend\n\n@CoinCounter\n\nwhen flag clicked\nset [cloneid v] to [99]\nswitch costume to (empty v)\nhide\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\nwhen I receive [setupcoincounter v]\ngo to [front v] layer\nset [cloneid v] to [0]\ncreate clone of (_myself_ v)\nset [cloneid v] to [1]\ncreate clone of (_myself_ v)\nset [cloneid v] to [2]\ncreate clone of (_myself_ v)\nset [cloneid v] to [3]\ncreate clone of (_myself_ v)\nset [cloneid v] to [99]\nswitch costume to (empty v)\nhide\n\nwhen I receive [game_tick v]\nif <(cloneID) = [0]> then\n    set size to (100) %\n    switch costume to (/2 v)\n    show\n    go to x: (195) y: (165)\nelse\n    if <(cloneID) = [1]> then\n        go to x: (185) y: (165)\n        switch costume to (Collected)\n        show\n        set size to (200) %\n    else\n        if <(cloneID) = [2]> then\n            go to x: (205) y: (165)\n            switch costume to (/ v)\n            show\n            set size to (150) %\n        else\n            if <(cloneID) = [3]> then\n                go to x: (225) y: (165)\n                switch costume to (9 v)\n                show\n                set size to (200) %\n            else\n                hide\n            end\n        end\n    end\nend\n\nplay sound [pop v] until done\n\nwhen I receive [cutscenebossintrosetup v]\nhide\ndelete this clone\n\n@Teleporter\n\nwhen I receive [game_tick v]\nif <(costume [name v]) = [enter]> then\n    Position ((x) - (CamSX)) ((y) - (CamSY))\n    if <touching (the glidy boy v)?> then\n        start sound [Exit v]\n        set [portal v] to (cloneID)\n    end\nelse\n    if <(costume [name v]) = [exit]> then\n        Position ((x2) - (CamSX)) ((y2) - (CamSY))\n    end\nend\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\ndefine Clone at X (x) Y (y) X2 (x2) Y2 (y2) cloneID (c)\nif <not <(costume [name v]) = [empty]>> then\n    switch costume to (enter v)\nend\nset [cloneid v] to (c)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\nif <not <(costume [name v]) = [empty]>> then\n    switch costume to (exit v)\nend\nset [x2 v] to (x2)\nset [y2 v] to (y2)\nset [level v] to (CurrentLevel)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\nadd (x) to [portal1x v]\nadd (y) to [portal1y v]\nadd (x2) to [portal2x v]\nadd (y2) to [portal2y v]\n\nwhen flag clicked\nset [portal v] to [0]\nhide\n\nwhen I receive [setupportals v]\ndelete all of [portal1x v]\ndelete all of [portal2x v]\ndelete all of [portal1y v]\ndelete all of [portal2y v]\ngo to [front v] layer\nswitch costume to (enter v)\nif <(CurrentLevel) = [8]> then\n    Clone at X [638] Y [349] X2 [291] Y2 [567] cloneID [1]\n    Clone at X [1023] Y [576] X2 [1147] Y2 [867] cloneID [2]\n    Clone at X [2850] Y [452] X2 [291] Y2 [713] cloneID [3]\n    Clone at X [445] Y [713] X2 [3006] Y2 [452] cloneID [4]\nelse\n    if <(CurrentLevel) = [10]> then\n        Clone at X [675] Y [295] X2 [353] Y2 [1453] cloneID [1]\n        Clone at X [4466] Y [1474] X2 [1801] Y2 [321] cloneID [2]\n    else\n        if <(CurrentLevel) = [12]> then\n            Clone at X [1279] Y [953] X2 [1313] Y2 [275] cloneID [1]\n        else\n            if <(CurrentLevel) = [13]> then\n                Clone at X [714] Y [965] X2 [650] Y2 [275] cloneID [1]\n                Clone at X [1867] Y [777] X2 [2707] Y2 [292] cloneID [2]\n                Clone at X [3268] Y [868] X2 [4436] Y2 [382] cloneID [3]\n            else\n                if <(CurrentLevel) = [14]> then\n                    Clone at X [381] Y [836] X2 [1911] Y2 [274] cloneID [1]\n                    Clone at X [3186] Y [255] X2 [3691] Y2 [544] cloneID [2]\n                else\n                    if <(CurrentLevel) = [15]> then\n                        Clone at X [1327] Y [691] X2 [983] Y2 [879] cloneID [1]\n                        Clone at X [2425] Y [992] X2 [3187] Y2 [958] cloneID [2]\n                        Clone at X [3945] Y [1681] X2 [4334] Y2 [255] cloneID [3]\n                    end\n                end\n            end\n        end\n    end\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160] X2 [2050] Y2 [2110] cloneID [50]\nhide\n\nset [portal v] to [0]\n\n@ScrollingBG\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Clone at Y (y)\nchange [y v] by (y)\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\ndefine Find Costume Numbers\nset [costumenumb v] to ((1) / (1))\nswitch costume to (costumeNumb)\nnext costume\nchange [costumenumb v] by (1)\nrepeat until <(costume [number v]) = [1]>\n    next costume\n    change [costumenumb v] by (1)\nend\nchange [costumenumb v] by (-1)\n\nwhen I receive [game_tick v]\nPosition [0] (((y) - (CamSY)) / (4))\n\ngo to [back v] layer\n\nwhen I receive [setupscrollingbg v]\ngo to [front v] layer\nFind Costume Numbers\nset [ghost v] effect to (0)\nset [y v] to [360]\nswitch costume to (hz v)\nClone at Y [0]\nrepeat (5)\n    Clone at Y [360]\nend\nswitch costume to (empty v)\nClone at Y [2160]\nhide\n\nrepeat (5)\n    Clone at Y [0]\nend\n\ngo [forward v] (1) layers\n\nchange [clonesamde v] by (1)\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\nwhen I receive [cutscenebossintrosetup v]\nhide\ndelete this clone\n\n@Transition\n\nwhen I receive [transition in v]\nswitch costume to (costume1 v)\nhide\nshow\ngo to [front v] layer\nrepeat (16)\n    next costume\nend\n\nwhen I receive [transition out v]\nswitch costume to (costume17 v)\ngo to [front v] layer\nrepeat (16)\n    switch costume to ((costume [number v]) - (1))\nend\nhide\n\nwhen flag clicked\nhide\n\n@Message\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [backwardsmessage v]\n\ndefine Out\nset [ghost v] effect to (0)\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\n    change y by (-5)\nend\nhide\nclear graphic effects\n\ndefine In\nset y to (50)\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\n    change y by (-2.5)\nend\n\nbroadcast (Transition In v)\n\ngo to [front v] layer\nIn\nwait until <key (any v) pressed?>\nOut\n\nwhen I receive [cutsceneintropaperstory v]\nswitch costume to (1_1 v)\ngo to [front v] layer\nIn\nwait until <<key (any v) pressed?> or <mouse down?>>\nstart sound [Text confirm v]\nOut\nnext costume\nIn\nwait until <<key (any v) pressed?> or <mouse down?>>\nstart sound [Text confirm v]\nOut\nwait (3) seconds\nswitch backdrop to (backdrop3 v)\nbroadcast (Transition Out v)\nbroadcast (MAINMENUBOYY v) and wait\n\nwhen I receive [levelstory v]\nswitch costume to (join ((CurrentLevel) + (1)) [_1])\ngo to [front v] layer\nif <not <((CurrentLevel) + (1)) = [11]>> then\n    In\n    if <(costume [number v]) < [14]> then\n        wait until <<key (any v) pressed?> or <mouse down?>>\n        start sound [Text confirm v]\n    end\n    Out\n    next costume\nend\nwait (3) seconds\n\nnext costume\nIn\nwait until <key (any v) pressed?>\nOut\nswitch backdrop to (backdrop3 v)\nbroadcast (Transition Out v)\nbroadcast (MAINMENUBOYY v) and wait\n\nset [currentlevel v] to [1]\n\nrepeat (3)\n\n@Title\n\ndefine In\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\n\ndefine Out\nset [ghost v] effect to (0)\nshow\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nclear graphic effects\n\nwhen flag clicked\n\nwhen I start as a clone\nif <(cloneID) = [0]> then\n    wait (2) seconds\n    switch costume to (the glidy boi v)\n    go to x: (-292) y: (87)\n    show\n    glide (0.8) secs to x: (297) y: (0)\n    delete this clone\nelse\n    if <(cloneID) = [1]> then\n        switch costume to (title v)\n        go to x: (0) y: (0)\n        In\n        forever\n            go to x: (-5) y: (5)\n            wait (1) seconds\n            go to x: (5) y: (-5)\n            wait (1) seconds\n        end\n    else\n        if <(cloneID) = [2]> then\n            switch costume to (playbuttons0 v)\n            go to x: (-120) y: (-80)\n            In\n            forever\n                if <touching (mouse-pointer v)?> then\n                    go to x: (-120) y: (-75)\n                    if <not <(costume [name v]) = [PlayButtonS4]>> then\n                        next costume\n                    end\n                    if <mouse down?> then\n                        set [vanish? v] to [1]\n                        Out\n                        delete this clone\n                    end\n                else\n                    go to x: (-120) y: (-80)\n                    switch costume to (playbuttons0 v)\n                end\n            end\n        else\n            if <(cloneID) = [3]> then\n                switch costume to (playbutton2 v)\n                go to x: (120) y: (-80)\n                In\n                forever\n                    if <touching (mouse-pointer v)?> then\n                        go to x: (120) y: (-75)\n                        if <not <(costume [name v]) = [PlayButton2]>> then\n                            next costume\n                        end\n                        if <mouse down?> then\n                            set [vanish? v] to [2]\n                            Out\n                            delete this clone\n                        end\n                    else\n                        go to x: (120) y: (-80)\n                        switch costume to (play1 v)\n                    end\n                end\n            else\n                if <(cloneID) = [6]> then\n                    switch costume to (level select menu v)\n                    go to x: (0) y: (0)\n                    In\n                    forever\n                        switch costume to (level select menu v)\n                        if <touching (mouse-pointer v)?> then\n                            if <mouse down?> then\n                                if <<<(mouse x) > [-222]> and <(mouse x) < [-155]>> and <<(mouse y) > [102]> and <(mouse y) < [159]>>> then\n                                    set [currentlevel v] to [1]\n                                    set [vanish? v] to [9]\n                                    Out\n                                    delete this clone\n                                else\n                                    if <<<(mouse x) > [-128]> and <(mouse x) < [-61]>> and <<(mouse y) > [102]> and <(mouse y) < [159]>>> then\n                                        set [currentlevel v] to [2]\n                                        set [vanish? v] to [9]\n                                        Out\n                                        delete this clone\n                                    else\n                                        if <<<(mouse x) > [-35]> and <(mouse x) < [28]>> and <<(mouse y) > [102]> and <(mouse y) < [159]>>> then\n                                            set [currentlevel v] to [3]\n                                            set [vanish? v] to [9]\n                                            Out\n                                            delete this clone\n                                        else\n                                            if <<<(mouse x) > [56]> and <(mouse x) < [125]>> and <<(mouse y) > [102]> and <(mouse y) < [159]>>> then\n                                                set [currentlevel v] to [4]\n                                                set [vanish? v] to [9]\n                                                Out\n                                                delete this clone\n                                            else\n                                                if <<<(mouse x) > [149]> and <(mouse x) < [222]>> and <<(mouse y) > [102]> and <(mouse y) < [159]>>> then\n                                                    set [currentlevel v] to [5]\n                                                    set [vanish? v] to [9]\n                                                    Out\n                                                    delete this clone\n                                                else\n                                                    if <<<(mouse x) > [-222]> and <(mouse x) < [-155]>> and <<(mouse y) > [-18]> and <(mouse y) < [66]>>> then\n                                                        set [currentlevel v] to [6]\n                                                        set [vanish? v] to [9]\n                                                        Out\n                                                        delete this clone\n                                                    else\n                                                        if <<<(mouse x) > [-128]> and <(mouse x) < [-61]>> and <<(mouse y) > [-18]> and <(mouse y) < [66]>>> then\n                                                            set [currentlevel v] to [7]\n                                                            set [vanish? v] to [9]\n                                                            Out\n                                                            delete this clone\n                                                        else\n                                                            if <<<(mouse x) > [-35]> and <(mouse x) < [28]>> and <<(mouse y) > [-18]> and <(mouse y) < [66]>>> then\n                                                                set [currentlevel v] to [8]\n                                                                set [vanish? v] to [9]\n                                                                Out\n                                                                delete this clone\n                                                            else\n                                                                if <<<(mouse x) > [56]> and <(mouse x) < [125]>> and <<(mouse y) > [-18]> and <(mouse y) < [66]>>> then\n                                                                    set [currentlevel v] to [9]\n                                                                    set [vanish? v] to [9]\n                                                                    Out\n                                                                    delete this clone\n                                                                else\n                                                                    if <<<(mouse x) > [149]> and <(mouse x) < [222]>> and <<(mouse y) > [-18]> and <(mouse y) < [66]>>> then\n                                                                        set [currentlevel v] to [10]\n                                                                        set [vanish? v] to [9]\n                                                                        Out\n                                                                        delete this clone\n                                                                    else\n                                                                        if <<<(mouse x) > [-221]> and <(mouse x) < [-37]>> and <<(mouse y) > [-103]> and <(mouse y) < [-41]>>> then\n                                                                            set [currentlevel v] to [12]\n                                                                            set [vanish? v] to [9]\n                                                                            Out\n                                                                            delete this clone\n                                                                        else\n                                                                            if <<<(mouse x) > [2]> and <(mouse x) < [185]>> and <<(mouse y) > [-103]> and <(mouse y) < [-41]>>> then\n                                                                                set [currentlevel v] to [13]\n                                                                                set [vanish? v] to [9]\n                                                                                Out\n                                                                                delete this clone\n                                                                            else\n                                                                                if <<<(mouse x) > [-221]> and <(mouse x) < [-47]>> and <<(mouse y) > [-174]> and <(mouse y) < [-118]>>> then\n                                                                                    set [currentlevel v] to [14]\n                                                                                    set [vanish? v] to [9]\n                                                                                    Out\n                                                                                    delete this clone\n                                                                                else\n                                                                                    if <<<(mouse x) > [-4]> and <(mouse x) < [184]>> and <<(mouse y) > [-174]> and <(mouse y) < [-120]>>> then\n                                                                                        set [currentlevel v] to [15]\n                                                                                        set [vanish? v] to [9]\n                                                                                        Out\n                                                                                        delete this clone\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                else\n                    if <(cloneID) = [5]> then\n                        switch costume to (00 v)\n                        go to x: (0) y: (0)\n                        In\n                        forever\n                            switch costume to (join (<<touching (mouse-pointer v)?> and <[0] > (mouse x)>> * (1)) (<<touching (mouse-pointer v)?> and <(mouse x) > [0]>> * (1)))\n                            if <touching (mouse-pointer v)?> then\n                                if <mouse down?> then\n                                    if <(mouse x) > [0]> then\n                                        set [@mobilemode? v] to [true]\n                                    else\n                                        set [@mobilemode? v] to [false]\n                                    end\n                                    set [vanish? v] to [10]\n                                    Out\n                                    delete this clone\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ngo to x: (-292) y: (87)\nshow\nglide (0.8) secs to x: (297) y: (0)\nswitch costume to (the glidy boi v)\n\nwhen I receive [mainmenuboyy v]\nset [selectedleveltrue? v] to [false]\nset [scribble? v] to [false]\ngo to [front v] layer\nset [@mobilemode? v] to [false]\nhide\nset [vanish? v] to [0]\nset [cloneid v] to [0]\ncreate clone of (_myself_ v)\nset [bgmusic v] to [FG]\nbroadcast (PlayBGMusic v)\nwait (2.5) seconds\nset [cloneid v] to [1]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [cloneid v] to [2]\ncreate clone of (_myself_ v)\nset [cloneid v] to [3]\ncreate clone of (_myself_ v)\nset [cloneid v] to [4]\ncreate clone of (_myself_ v)\nwait until <<(Vanish?) = [1]> or <(Vanish?) = [2]>>\nif <(Vanish?) = [2]> then\n    wait until <(Vanish?) = [2]>\n    wait (1) seconds\n    set [selectedleveltrue? v] to [true]\n    set [cloneid v] to [6]\n    create clone of (_myself_ v)\n    wait until <(Vanish?) = [9]>\n    wait (1) seconds\n    set [cloneid v] to [5]\n    create clone of (_myself_ v)\nelse\n    wait until <(Vanish?) = [1]>\n    wait (1) seconds\n    set [cloneid v] to [5]\n    create clone of (_myself_ v)\nend\nwait until <(Vanish?) = [10]>\nwait (1) seconds\nbroadcast (Transition In v) and wait\nbroadcast (StopBGMusic v) and wait\nbroadcast (StartGame v) and wait\nbroadcast (Transition Out v) and wait\nbroadcast (PLAY v)\nreset timer\n\nif <not <(costume [name v]) = [Play1]>> then\n\nwhen I start as a clone\nif <<(cloneID) = [1]> or <<(cloneID) = [2]> or <(cloneID) = [3]>>> then\n    wait until <<(Vanish?) = [1]> or <(Vanish?) = [2]>>\n    Out\n    delete this clone\nend\n\ngo to x: (-5) y: (-75)\nif <not <(costume [name v]) = [Play5]>> then\n    next costume\nend\n\nbroadcast (StopBGMusic v) and wait\n\n\n\nif <touching (mouse-pointer v)?> then\n    go to x: (120) y: (-75)\n    if <not <(costume [name v]) = [PlayButton2]>> then\n        next costume\n    end\n    if <mouse down?> then\n        set [vanish? v] to [1]\n        Out\n        delete this clone\n    end\nelse\n    go to x: (120) y: (-80)\n    switch costume to (play1 v)\nend\n\nwhen I receive [backtolevelselectmenu v]\nbroadcast (Transition Out v)\ngo to [front v] layer\nhide\nset [vanish? v] to [0]\nset [cloneid v] to [6]\ncreate clone of (_myself_ v)\nwait until <(Vanish?) = [9]>\nwait (1) seconds\nbroadcast (Transition In v) and wait\nreset timer\n\nbroadcast (PLAY v)\n\nbroadcast (StartGame v) and wait\n\nbroadcast (Transition Out v) and wait\n\n@Boss\n\ndefine Change List\nif <(BossAction) = [Follow]> then\n    replace item (1) of [framesinstat v] with ((item (1) of [framesinstat v]) + (1))\n    replace item (2) of [framesinstat v] with [0]\n    replace item (3) of [framesinstat v] with [0]\n    replace item (4) of [framesinstat v] with [0]\n    replace item (5) of [framesinstat v] with [0]\n    replace item (6) of [framesinstat v] with [0]\nelse\n    if <(BossAction) = [Move]> then\n        replace item (2) of [framesinstat v] with ((item (2) of [framesinstat v]) + (1))\n        replace item (1) of [framesinstat v] with [0]\n        replace item (3) of [framesinstat v] with [0]\n        replace item (4) of [framesinstat v] with [0]\n        replace item (5) of [framesinstat v] with [0]\n        replace item (6) of [framesinstat v] with [0]\n    else\n        if <(BossAction) = [Attack1]> then\n            replace item (3) of [framesinstat v] with ((item (3) of [framesinstat v]) + (1))\n            replace item (1) of [framesinstat v] with [0]\n            replace item (2) of [framesinstat v] with [0]\n            replace item (4) of [framesinstat v] with [0]\n            replace item (5) of [framesinstat v] with [0]\n            replace item (6) of [framesinstat v] with [0]\n        else\n            if <(BossAction) = [Attack2]> then\n                replace item (4) of [framesinstat v] with ((item (4) of [framesinstat v]) + (1))\n                replace item (3) of [framesinstat v] with [0]\n                replace item (1) of [framesinstat v] with [0]\n                replace item (2) of [framesinstat v] with [0]\n                replace item (5) of [framesinstat v] with [0]\n                replace item (6) of [framesinstat v] with [0]\n            else\n                if <(BossAction) = [Attack3]> then\n                    replace item (5) of [framesinstat v] with ((item (5) of [framesinstat v]) + (1))\n                    replace item (4) of [framesinstat v] with [0]\n                    replace item (3) of [framesinstat v] with [0]\n                    replace item (1) of [framesinstat v] with [0]\n                    replace item (2) of [framesinstat v] with [0]\n                    replace item (6) of [framesinstat v] with [0]\n                else\n                    if <(BossAction) = [Attack4]> then\n                        replace item (6) of [framesinstat v] with ((item (6) of [framesinstat v]) + (1))\n                        replace item (4) of [framesinstat v] with [0]\n                        replace item (3) of [framesinstat v] with [0]\n                        replace item (1) of [framesinstat v] with [0]\n                        replace item (2) of [framesinstat v] with [0]\n                        replace item (5) of [framesinstat v] with [0]\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [startboss v]\ndelete all of [framesinstat v]\nadd [0] to [framesinstat v]\nadd [0] to [framesinstat v]\nadd [0] to [framesinstat v]\nadd [0] to [framesinstat v]\nadd [0] to [framesinstat v]\nadd [0] to [framesinstat v]\nset [cloneid v] to [0]\nswitch costume to (bossdesign v)\ngo to [front v] layer\nclear graphic effects\nset [bossx v] to [593]\nset [bossy v] to [451]\nset [bossaction v] to [Follow]\nset [playerhp v] to [9]\nset [bossframes v] to [0]\nset [bosshp v] to [3]\nset [bossattacknumb v] to [0]\nset [animation v] to [false]\nset [animationnum v] to [0]\nset [bossphase v] to [1]\nset [bossvulnerable? v] to [false]\nset [playervulnerable? v] to [false]\nset [hurtsequence v] to [0]\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    Position ((BossX) - (CamSX)) ((BossY) - (CamSY))\n    change [bossframes v] by (1)\n    if <not <(HURTSEQUENCE) = [0]>> then\n        set [bossaction v] to [Follow]\n        set [animation v] to [false]\n        change [bossx v] by (((860) - (BossX)) / (10))\n        change [bossy v] by (((500) - (BossY)) / (10))\n    else\n        if <(BossAction) = [Follow]> then\n            set [playervulnerable? v] to [false]\n            clear graphic effects\n            Fly Effect\n            if <(item (1) of [framesinstat v]) < [200]> then\n                switch costume to (bossdesign v)\n                if <([abs v] of (((PlayerSX) + ([x position v] of [the glidy boy v])) - (BossX)) ) > [10]> then\n                    change [bossx v] by ((((PlayerSX) + ([x position v] of [the glidy boy v])) - (BossX)) / (10))\n                end\n            else\n                change [bossattacknumb v] by (1)\n                if <(BossPHASE) = [1]> then\n                    if <(bossattacknumb) = [2]> then\n                        set [bossattacknumb v] to [3]\n                    end\n                    if <(bossattacknumb) = [5]> then\n                        set [bossattacknumb v] to [1]\n                    end\n                else\n                    if <(BossPHASE) = [2]> then\n                        if <(bossattacknumb) = [2]> then\n                            set [bossattacknumb v] to [3]\n                        end\n                        if <(bossattacknumb) = [5]> then\n                            set [bossattacknumb v] to [1]\n                        end\n                    else\n                        if <(BossPHASE) = [3]> then\n                            if <(bossattacknumb) = [3]> then\n                                set [bossattacknumb v] to [1]\n                            end\n                            if <(bossattacknumb) = [2]> then\n                                set [bossattacknumb v] to [3]\n                            end\n                            if <(bossattacknumb) = [4]> then\n                                set [bossattacknumb v] to [2]\n                            end\n                            if <(bossattacknumb) = [5]> then\n                                set [bossattacknumb v] to [1]\n                            end\n                        end\n                    end\n                end\n                set [bossaction v] to (join [Attack] (bossattacknumb))\n            end\n        else\n            if <(Animation) = [false]> then\n                if <(BossAction) = [Attack1]> then\n                    Attack1\n                else\n                    if <(BossAction) = [Attack2]> then\n                        Attack2\n                    else\n                        if <(BossAction) = [Attack3]> then\n                            Attack3\n                        else\n                            if <(BossAction) = [Attack4]> then\n                                Attack4 (Counter)\n                            end\n                        end\n                    end\n                end\n            else\n                change [animationnum v] by (1)\n                if <(animationnum) < [75]> then\n                    if <(animationnum) = [5]> then\n                        start sound [Evil Laugh Sound Effect2 v]\n                    end\n                    set [bossvulnerable? v] to [true]\n                    if <((animationnum) mod (20)) < [10]> then\n                        switch costume to (bosslaugh1 v)\n                    else\n                        switch costume to (bosslaugh2 v)\n                    end\n                else\n                    set [bossvulnerable? v] to [false]\n                    set [animation v] to [false]\n                    set [animationnum v] to [0]\n                    set [bossaction v] to [Follow]\n                end\n            end\n        end\n        Change List\n    end\nend\n\ndefine Attack1\nset [playervulnerable? v] to [true]\nif <(item (3) of [framesinstat v]) < [100]> then\n    switch costume to (bossdesignattack v)\n    Fly Effect\nend\nif <(item (3) of [framesinstat v]) > [230]> then\n    set [animation v] to [true]\nend\n\ndefine Fly Effect\nset [bossy v] to (((([sin v] of ((bossframes) * (4)) ) * (20)) + (451)) + (((PlayerSY) + ([y position v] of [the glidy boy v])) - (300)))\n\ndefine Attack2\nif <(item (4) of [framesinstat v]) < [20]> then\n    change [bossy v] by (30)\nelse\n    if <(item (4) of [framesinstat v]) < [50]> then\n        set [bossy v] to [5000]\n    else\n        if <(item (4) of [framesinstat v]) < [80]> then\n            switch costume to (attack2 warn v)\n            set [bossx v] to ((PlayerSX) + ([x position v] of [the glidy boy v]))\n            set [bossy v] to ((PlayerSY) + (150))\n        else\n            if <(item (4) of [framesinstat v]) < [100]> then\n                set [bossy v] to ((PlayerSY) + (360))\n                hide\n                switch costume to (bossdesignattack2 v)\n            else\n                if <(item (4) of [framesinstat v]) < [150]> then\n                    if <(item (4) of [framesinstat v]) = [101]> then\n                        start sound [Swoosh v]\n                    else\n                    end\n                    set [playervulnerable? v] to [true]\n                    change [bossy v] by (-20)\n                else\n                    if <(item (4) of [framesinstat v]) < [180]> then\n                        switch costume to (bossdesign v)\n                        set [bossy v] to ((PlayerSY) + (360))\n                    else\n                        if <(item (4) of [framesinstat v]) < [200]> then\n                            change [bossy v] by (-10)\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <(item (4) of [framesinstat v]) > [200]> then\n    set [bossaction v] to [Follow]\nend\n\ndefine Attack3\nif <(item (5) of [framesinstat v]) < [30]> then\n    change [bossx v] by (25)\nelse\n    if <(item (5) of [framesinstat v]) < [60]> then\n        set [playervulnerable? v] to [true]\n        set [bossx v] to (((PlayerSX) + ([x position v] of [the glidy boy v])) + (500))\n    else\n        if <(item (5) of [framesinstat v]) < [90]> then\n            switch costume to (bossdesignattack3 v)\n            set [bossy v] to ((PlayerSY) + ([y position v] of [the glidy boy v]))\n            if <not <(x position) < [210]>> then\n                change [bossx v] by (-20)\n            end\n        else\n            if <(item (5) of [framesinstat v]) < [300]> then\n                switch costume to (bossdesignattack3 v)\n                set [bossy v] to ((PlayerSY) + ([y position v] of [the glidy boy v]))\n                set [bossx v] to (((PlayerSX) + ([x position v] of [the glidy boy v])) + ((210) - ([x position v] of [the glidy boy v])))\n            else\n                if <(item (5) of [framesinstat v]) < [330]> then\n                    switch costume to (bossdesignattack3 v)\n                    set [bossy v] to ((PlayerSY) + ([y position v] of [the glidy boy v]))\n                    change [bossx v] by (30)\n                end\n            end\n        end\n    end\nend\nif <(item (5) of [framesinstat v]) > [330]> then\n    set [bossaction v] to [Follow]\nend\n\ndefine Attack4 (Counter)\nif <(item (6) of [framesinstat v]) < [30]> then\n    set [bossvulnerable? v] to [false]\n    change [ghost v] effect by (5)\nelse\n    if <(item (6) of [framesinstat v]) < [45]> then\n        set [bossx v] to [705]\n        set [bossy v] to [307]\n    else\n        if <(item (6) of [framesinstat v]) < [80]> then\n            switch costume to (attack2 warn v)\n            set [ghost v] effect to (0)\n        else\n            if <(item (6) of [framesinstat v]) < [90]> then\n                set [ghost v] effect to (100)\n                switch costume to (bossdesigncounter v)\n            else\n                if <(item (6) of [framesinstat v]) < [200]> then\n                    change [ghost v] effect by (-5)\n                    set [playervulnerable? v] to [true]\n                    set [bossvulnerable? v] to [true]\n                else\n                    if <(item (6) of [framesinstat v]) < [260]> then\n                        change [ghost v] effect by (5)\n                    else\n                        if <(item (6) of [framesinstat v]) < [270]> then\n                            Fly Effect\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <(item (6) of [framesinstat v]) > [270]> then\n    set [bossaction v] to [Follow]\n    set [bossvulnerable? v] to [false]\nend\n\nswitch costume to (bossdesigncounter v)\n\nif <(Animation) = [pend]> then\nif <(() mod (20)) < [15]> then\n\nif <(Animation) = [false]> then\n\nforever\n\nswitch costume to (join [BossLaugh] ((animationnum) mod (3)))\n\nif <(bossattacknumb) = [1]> then\n    set [bossattacknumb v] to [1]\nend\n\nchange x by (10)\nchange y by ((((360) - (CamSY)) - (y position)) / (10))\n\nif <not <(CurrentLevel) = [11]>> then\n    hide\nend\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\nif <(item (3) of [framesinstat v]) > [230]> then\n\nset [animation v] to [true]\n\n@Attack1 Laser\n\nwhen flag clicked\nhide\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    if <(item (3) of [framesinstat v]) = [0]> then\n        hide\n        set [ghost v] effect to (100)\n    else\n        if <(item (3) of [framesinstat v]) < [100]> then\n            if <(item (3) of [framesinstat v]) = [5]> then\n                start sound [Blaster Appear v]\n            end\n            switch costume to (laserwarn v)\n            change [ghost v] effect by (-10)\n            Position ((([bossx v] of [boss v]) - (90)) - (CamSX)) ((([bossy v] of [boss v]) - (50)) - (CamSY))\n            point towards (the glidy boy v)\n        else\n            if <(item (3) of [framesinstat v]) < [130]> then\n                change [ghost v] effect by (10)\n                Position ((([bossx v] of [boss v]) - (90)) - (CamSX)) ((([bossy v] of [boss v]) - (50)) - (CamSY))\n            else\n                if <(item (3) of [framesinstat v]) < [140]> then\n                    hide\n                    set [ghost v] effect to (100)\n                    Position ((([bossx v] of [boss v]) - (90)) - (CamSX)) ((([bossy v] of [boss v]) - (50)) - (CamSY))\n                else\n                    if <(item (3) of [framesinstat v]) < [150]> then\n                        if <(item (3) of [framesinstat v]) = [141]> then\n                            start sound [Blaster Fire v]\n                        end\n                        switch costume to (laser v)\n                        show\n                        change [ghost v] effect by (-10)\n                        Position ((([bossx v] of [boss v]) - (90)) - (CamSX)) ((([bossy v] of [boss v]) - (50)) - (CamSY))\n                    else\n                        if <(item (3) of [framesinstat v]) < [210]> then\n                            switch costume to (laser v)\n                            show\n                            Position ((([bossx v] of [boss v]) - (90)) - (CamSX)) ((([bossy v] of [boss v]) - (50)) - (CamSY))\n                        else\n                            if <(item (3) of [framesinstat v]) < [260]> then\n                                set [playervulnerable? v] to [false]\n                                change [ghost v] effect by (10)\n                                Position ((([bossx v] of [boss v]) - (90)) - (CamSX)) ((([bossy v] of [boss v]) - (50)) - (CamSY))\n                            else\n                                hide\n                                set [ghost v] effect to (100)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nturn left (15) degrees\nturn right (15) degrees\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setupattacks v]\ngo to [front v] layer\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\n@Attack3\n\nwhen flag clicked\nhide\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    if <(item (5) of [framesinstat v]) = [0]> then\n        set [playsound v] to [0]\n        hide\n        set [ghost v] effect to (100)\n    else\n        if <(item (5) of [framesinstat v]) < [100]> then\n            go to x: (240) y: ([y position v] of [boss v])\n            clear graphic effects\n            set [attack3y v] to ([bossy v] of [boss v])\n            set [attack3x v] to ([bossx v] of [boss v])\n        else\n            if <(item (5) of [framesinstat v]) < [300]> then\n                next costume\n                change [attack3x v] by (-10)\n                Position ((attack3x) - (CamSX)) ((attack3y) - (CamSY))\n                if <(x position) < [-241]> then\n                    set [attack3y v] to ([bossy v] of [boss v])\n                    set [attack3x v] to ([bossx v] of [boss v])\n                    set [playsound v] to [0]\n                end\n                change [playsound v] by (1)\n                if <(playsound) = [5]> then\n                    start sound [Blaster Fire v]\n                end\n            else\n                next costume\n                change [attack3x v] by (-10)\n                Position ((attack3x) - (CamSX)) ((attack3y) - (CamSY))\n                if <(x position) < [-241]> then\n                    set [attack3y v] to ([bossy v] of [boss v])\n                    set [attack3x v] to ([bossx v] of [boss v])\n                end\n            end\n        end\n    end\nend\n\nchange x by (-10)\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [setupattacks v]\ngo to [front v] layer\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\nstart sound [Blaster Fire v]\n\n@Cutscene\n\nwhen I receive [cutscenebossintrosetup v]\ngo to x: (0) y: (0)\nswitch costume to (2_2 v)\nshow\nbroadcast (SetUpBossBG v) and wait\nbroadcast (SetUpPaperRIP v) and wait\ngo to [front v] layer\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [cutscenebossintro v]\nswitch backdrop to (black v)\nrepeat (90)\n    go to x: (pick random (-3) to (3)) y: (pick random (-3) to (3))\nend\nwait (2) seconds\n\nwhen I receive [setuphidecutscene v]\nhide\n\nwhen I receive [cutscenegameintro v]\ngo to x: (-5) y: (5)\nswitch costume to (1_1 v)\nshow\ngo to [front v] layer\nrepeat (7)\n    wait until <<key (any v) pressed?> or <mouse down?>>\n    wait until <<not <mouse down?>> and <not <key (any v) pressed?>>>\n    next costume\nend\nbroadcast (StopBGMusic v)\nwait (2) seconds\nbroadcast (SetUpBossBG v) and wait\nbroadcast (SetUpPaperRIP v) and wait\ngo to [front v] layer\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\nwait (1) seconds\nbroadcast (CutsceneIntroPaperRIP v) and wait\nwait (2) seconds\nbroadcast (Transition In v) and wait\nwait (1) seconds\nhide\nbroadcast (CutsceneIntroPaperStory v) and wait\n\nbroadcast (SetUpBossBG v) and wait\n\nwhen I receive [cutscenegameintro v]\nforever\n    go to x: (-5) y: (5)\n    wait (1) seconds\n    go to x: (5) y: (-5)\n    wait (1) seconds\nend\n\nswitch costume to (2_2 v)\n\nwhen I receive [cutscenegameintro v]\nforever\n    if <key (s v) pressed?> then\n        hide\n        broadcast (MAINMENUBOYY v)\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nbroadcast (StopBGMusic v)\n\n@BossFire Attack4\n\nforever\n    go to x: (2) y: (0)\n    next costume\n    wait (0.08) seconds\nend\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    set size to (350) %\n    if <<[90] < (item (6) of [framesinstat v])> and <(item (6) of [framesinstat v]) < [250]>> then\n        if <[91] = (item (6) of [framesinstat v])> then\n            start sound [FIRE SOUND EFFECT IN HIGH QUALITY3 v]\n        end\n        Position ((x) - (CamSX)) ((y) - (CamSY))\n        change [ghost v] effect by (-5)\n    else\n        hide\n        set [ghost v] effect to (100)\n    end\n    change [clonecost v] by ((1) / (2))\n    if <(clonecost) > [4]> then\n        set [clonecost v] to [1]\n    end\n    switch costume to (join [fire] ([floor v] of (clonecost) ))\n    if <(x) > [705]> then\n        point in direction (105)\n    else\n        point in direction (75)\n    end\nend\n\nwhen I start as a clone\nwait until <not <(level) = (CurrentLevel)>>\ndelete this clone\n\nwhen I receive [deleteallclones v]\ndelete this clone\n\ndefine Clone at X (x) Y (y)\nset [x v] to (x)\nset [y v] to (y)\nset [level v] to (CurrentLevel)\nset [clonecost v] to [1]\nchange [clonesamde v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I receive [startboss v]\nswitch costume to (fire1 v)\ngo to [front v] layer\nDel\nif <(CurrentLevel) = [11]> then\n    Clone at X [569] Y [278]\n    Clone at X [586] Y [313]\n    Clone at X [606] Y [348]\n    Clone at X [841] Y [278]\n    Clone at X [824] Y [313]\n    Clone at X [807] Y [348]\nend\nswitch costume to (empty v)\nClone at X [2000] Y [2160]\nhide\n\ndefine Del\ndelete this clone\n\nwhen I receive [setupattacks v]\ngo to [front v] layer\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\n@Player Lives\n\nwhen I receive [setuplives v]\nshow\ngo to [front v] layer\n\nwhen flag clicked\ngo to x: (-187) y: (-173)\nhide\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    switch costume to (PlayerHP)\n    show\nend\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\n@Boss Lives\n\nwhen flag clicked\ngo to x: (221) y: (-164)\nhide\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    switch costume to (BossHP)\n    show\nend\n\nwhen I receive [setuplives v]\nshow\ngo to [front v] layer\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\n@Boss Head Hitbox\n\nwhen flag clicked\nhide\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    switch costume to (hitbox v)\n    Position (([bossx v] of [boss v]) - (CamSX)) (([bossy v] of [boss v]) - (CamSY))\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [cutscenebossdiesetup v]\nclear graphic effects\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nclear graphic effects\nhide\n\n@Boss Body Hitbox\n\nwhen flag clicked\nhide\n\ndefine Position (posx) (posy)\ngo to x: (posx) y: (posy)\nif <<(posx) = (x position)> and <(posy) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [game_tick v]\nif <not <(CurrentLevel) = [11]>> then\n    hide\nelse\n    switch costume to (hitbox v)\n    Position (([bossx v] of [boss v]) - (CamSX)) (([bossy v] of [boss v]) - (CamSY))\n    set [ghost v] effect to (100)\nend\n\nwhen I receive [cutscenebossdiesetup v]\nclear graphic effects\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nclear graphic effects\nhide\n\n@PlayerGlowInBoss\n\nwhen flag clicked\nhide\n\nwhen I receive [game_tick v]\nif <(CurrentLevel) = [11]> then\n    set [ghost v] effect to (50)\n    go to (the glidy boy v)\n    show\nelse\n    hide\nend\n\nwhen I receive [setupplayerglow v]\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\n\nwhen I receive [cutscenebossdiesetup v]\nhide\n\nwhen I receive [cutscenebossintrosetup v]\nhide\n\n@BossBG\n\nwhen I receive [game_tick v]\nif <(CurrentLevel) = [11]> then\n    show\n    set y to (([sin v] of ((timer) * (120)) ) * (5))\n    turn right (pick random (0.1) to (1)) degrees\nelse\n    hide\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [setupbossbg v]\nshow\nset y to (([sin v] of ((timer) * (120)) ) * (5))\nturn right (pick random (0.1) to (1)) degrees\n\ngo to [front v] layer\n\nwhen I receive [cutscenebossintro v]\nshow\nset y to (([sin v] of ((timer) * (120)) ) * (5))\nturn right (pick random (0.1) to (1)) degrees\n\nwhen I receive [cutsceneintropaperstory v]\nhide\n\n@Paper Ripping Sprite\n\nforever\n    next costume\nend\n\nwhen I receive [setuppaperrip v]\nswitch costume to (costume2 v)\nshow\n\nwhen I receive [cutscenebossintro v]\nrepeat (45)\n    wait (0) seconds\nend\nwait (2) seconds\nswitch costume to (costume2 v)\nshow\nstart sound [apparent paper rip v]\nrepeat (10)\n    next costume\n    wait (0.05) seconds\nend\nwait (1.2) seconds\nstart sound [Woosh v]\nrepeat (8)\n    next costume\n    wait (0.025) seconds\nend\nwait (1) seconds\nrepeat (7)\n    next costume\n    wait (0.01) seconds\nend\nwait (1) seconds\n\ngo to [front v] layer\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [setuphidecutscene v]\nhide\n\nwhen I receive [cutscenegameintro v]\nswitch costume to (costume2 v)\nshow\n\nwhen I receive [cutsceneintropaperrip v]\nstart sound [apparent paper rip v]\nrepeat (2)\n    next costume\n    wait (0.05) seconds\nend\nrepeat (8)\n    next costume\n    wait (0.05) seconds\nend\nwait (1.2) seconds\nstart sound [Woosh v]\nrepeat (8)\n    next costume\n    wait (0.025) seconds\nend\nwait (1.8) seconds\nstart sound [Dun Dun Dunnn v]\nrepeat (7)\n    next costume\n    wait (0.01) seconds\nend\nwait (1) seconds\n\nwhen I receive [cutsceneintropaperstory v]\nhide\n\nswitch costume to (costume2 v)\nshow\n\nwhen I receive [cutscenepaperunrip v]\nswitch costume to (costume18 v)\nshow\nrepeat (18)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.05) seconds\nend\nwait (2) seconds\n\nwhen I receive [messageimpossiblelevel v]\nswitch backdrop to (backdrop3 v)\nhide\n\n@Boss Die Cutscene\n\nwhen flag clicked\nclear graphic effects\nhide\n\nwhen I receive [cutscenebossdiesetup v]\nswitch costume to (costume1 v)\nclear graphic effects\ngo to x: (0) y: (0)\npoint in direction (90)\nshow\n\nwhen I receive [cutscenebosdie v]\nbroadcast (StopBGMusic v) and wait\nset [bossdiecutscene: explode? v] to [0]\nwait (1) seconds\nhide\nstart sound [Mario Party 9 - Boss Battle - Chain Chomp Romp v]\nset [cloneid v] to [0]\ncreate clone of (_myself_ v)\nwait (2) seconds\nset [cloneid v] to [1]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nset [cloneid v] to [2]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nset [cloneid v] to [3]\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nset [bossdiecutscene: explode? v] to [1]\nwait (1) seconds\nbroadcast (CutscenePaperUnRip v) and wait\nset [bgmusic v] to [AC]\nbroadcast (PlayBGMusic v)\nwait (1) seconds\nset [cloneid v] to [4]\ncreate clone of (_myself_ v)\nwait until <(BossDieCutscene: Explode?) = [2]>\nbroadcast (Transition In v) and wait\nbroadcast (StopBGMusic v) and wait\nbroadcast (MessageImpossibleLevel v)\n\nwhen I start as a clone\nif <(cloneID) = [0]> then\n    show\n    switch costume to (costume1 v)\n    clear graphic effects\n    repeat (50)\n        go to x: (pick random (-3) to (3)) y: (pick random (-3) to (3))\n        change [brightness v] effect by (2)\n    end\n    wait until <(BossDieCutscene: Explode?) = [1]>\n    set [ghost v] effect to (0)\n    repeat (10)\n        change [ghost v] effect by (10)\n        turn right (4) degrees\n        change size by (3)\n    end\n    delete this clone\nelse\n    if <(cloneID) = [1]> then\n        switch costume to (costume2 v)\n        clear graphic effects\n        set [ghost v] effect to (100)\n        go to x: (0) y: (0)\n        point in direction (60)\n        show\n        set size to (10) %\n        repeat (10)\n            change [ghost v] effect by (-10)\n            change size by (9)\n        end\n        wait until <(BossDieCutscene: Explode?) = [1]>\n        set [ghost v] effect to (0)\n        repeat (10)\n            change [ghost v] effect by (10)\n            turn right (4) degrees\n            change size by (3)\n        end\n        delete this clone\n    else\n        if <(cloneID) = [2]> then\n            switch costume to (costume2 v)\n            clear graphic effects\n            set [ghost v] effect to (100)\n            go to x: (0) y: (0)\n            point in direction (-75)\n            show\n            set size to (10) %\n            repeat (10)\n                change [ghost v] effect by (-10)\n                change size by (9)\n            end\n            wait until <(BossDieCutscene: Explode?) = [1]>\n            set [ghost v] effect to (0)\n            repeat (10)\n                change [ghost v] effect by (10)\n                turn right (4) degrees\n                change size by (3)\n            end\n            delete this clone\n        else\n            if <(cloneID) = [3]> then\n                switch costume to (costume2 v)\n                clear graphic effects\n                set [ghost v] effect to (100)\n                go to x: (0) y: (0)\n                point in direction (150)\n                show\n                set size to (10) %\n                repeat (10)\n                    change [ghost v] effect by (-10)\n                    change size by (9)\n                end\n                wait until <(BossDieCutscene: Explode?) = [1]>\n                set [ghost v] effect to (0)\n                repeat (10)\n                    change [ghost v] effect by (10)\n                    turn right (4) degrees\n                    change size by (3)\n                end\n                delete this clone\n            else\n                if <(cloneID) = [4]> then\n                    switch costume to (costume3 v)\n                    go to [front v] layer\n                    clear graphic effects\n                    set [ghost v] effect to (100)\n                    go to x: (0) y: (0)\n                    point in direction (90)\n                    show\n                    set size to (100) %\n                    repeat (10)\n                        change [ghost v] effect by (-10)\n                    end\n                    wait until <<key (any v) pressed?> or <mouse down?>>\n                    wait until <<not <key (any v) pressed?>> and <not <mouse down?>>>\n                    set [bossdiecutscene: explode? v] to [2]\n                    wait (1) seconds\n                    delete this clone\n                end\n            end\n        end\n    end\nend\n\nclear graphic effects\n\nwait until <(BossDieCutscene: Explode?) = [1]>\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (10)\n    turn right (4) degrees\n    change size by (3)\nend\ndelete this clone\n\nset [bgmusic v] to [AC]\nbroadcast (PlayBGMusic v)\n\n@Ending Cutscene\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\ndefine In\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\n\ndefine Out\nset [ghost v] effect to (0)\nshow\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\nclear graphic effects\n\nwhen I receive [cutscene end v]\nset [bgmusic v] to [SWE]\nbroadcast (PlayBGMusic v)\nwait (2) seconds\ngo to [front v] layer\nswitch costume to (costume2 v)\nrepeat (4)\n    go to x: (-20) y: (0)\n    In\n    glide (5) secs to x: (20) y: (0)\n    Out\n    next costume\n    go to x: (20) y: (0)\n    In\n    glide (5) secs to x: (-20) y: (0)\n    Out\n    next costume\nend\ngo to x: (0) y: (0)\nIn\nwait (2) seconds\nOut\nswitch costume to (costume7 v)\nIn\nforever\n    wait (1.25) seconds\n    switch costume to (costume9 v)\n    wait (1.25) seconds\n    switch costume to (costume7 v)\nend\n\nwait until <key (any v) pressed?>\nwait until <not <key (any v) pressed?>>\n\n@Mobile Controls\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\ndelete all of [mobilekeyspressed? v]\nadd [0] to [mobilekeyspressed? v]\nadd [0] to [mobilekeyspressed? v]\nadd [0] to [mobilekeyspressed? v]\nadd [0] to [mobilekeyspressed? v]\n\nwhen I receive [game_tick v]\nreplace item (1) of [mobilekeyspressed? v] with (<<mouse down?> and <(mouse x) < [-128]>> * (1))\nreplace item (2) of [mobilekeyspressed? v] with (<<mouse down?> and <<(mouse x) > [-128]> and <(mouse x) < [-13]>>> * (1))\nreplace item (3) of [mobilekeyspressed? v] with (<<mouse down?> and <<(mouse x) > [0]> and <(mouse y) < [-82]>>> * (1))\nreplace item (4) of [mobilekeyspressed? v] with (<<mouse down?> and <<(mouse x) > [0]> and <(mouse y) > [-82]>>> * (1))\nif <(@MOBILEMODE?) = [true]> then\n    set [ghost v] effect to (60)\n    show\nelse\n    hide\n    clear graphic effects\nend\n\nwhen I receive [deleteallclones v]\nhide\n\nwhen I receive [setupmobilecontrols v]\ngo to [front v] layer\nset [ghost v] effect to (60)\nshow\n\nwhen I receive [cutscenebossintrosetup v]\nhide\nclear graphic effects\n\n@Music Sprite\n\nwhen I receive [playbgmusic v]\nstop all sounds\nset volume to (100) %\nforever\n    play sound (BGMusic) until done\nend\n\nwhen I receive [stopbgmusic v]\nrepeat (50)\n    change volume by (-2)\nend\nstop [other scripts in sprite v]\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen flag clicked\nset volume to (100) %\nset [bgmusic v] to [IN]\nstop all sounds\n\n@T\n\nwhen flag clicked\nhide\n\nwhen [t v] key pressed\nif <(username) = [23ScratchMan]> then\n    show\n    go to [front v] layer\n    stop [all v]\nend\n\n