Never Stop Dreaming II: a platformer (sequel)
@Stage\n\nwhen flag clicked\nstart sound [HYPERDRIVE - Epic Powerful Futuristic Music Mix Epic Sci-Fi Hybrid Music v]\n\nwhen flag clicked\nset [level v] to [0]\n\nwhen I receive [start dream ii v]\nwait (3) seconds\nforever\n    play sound [Destroid - Annihilate v] until done\nend\n\nwhen I receive [start dream ii for real v]\nforever\n    if <(Level) = [21]> then\n        stop [other scripts in sprite v]\n        stop all sounds\n        stop [other scripts in sprite v]\n        broadcast (start dream III v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [start dream iii v]\nwait (3) seconds\nforever\n    play sound [DJ Striden - Level Three \[Melodic Electro\] \(1\) v] until done\nend\n\nwhen I receive [start dream iii for real v]\nforever\n    if <(Level) = [31]> then\n        stop [other scripts in sprite v]\n        stop all sounds\n        stop [other scripts in sprite v]\n        broadcast (start endgame v)\n        stop [this script v]\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nset [activate binary effect v] to [0]\nhide\nforever\n    create clone of (_myself_ v)\n    if <(activate binary effect) = [1]> then\n        stop [this script v]\n    end\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo [forward v] (1) layers\nset rotation style [don't rotate v]\ngo to x: (pick random (-300) to (200)) y: (200)\nset size to (pick random (40) to (200)) %\nshow\npoint in direction (165)\nset [ghost v] effect to ((size) / (3))\nswitch costume to (pick random (1) to (10))\nrepeat (7)\n    move ((size) / (8)) steps\n    switch costume to (pick random (1) to (10))\nend\nrepeat until <touching (_edge_ v)?>\n    move ((size) / (8)) steps\n    switch costume to (pick random (1) to (10))\nend\ndelete this clone\n\nrepeat (5)\n    move ((size) / (8)) steps\n    switch costume to (pick random (1) to (10))\nend\n\nwhen I receive [start dream i v]\nwait (2) seconds\nset [activate binary effect v] to [1]\n\nbroadcast (start dream III v)\n\n@Sprite2\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo [backward v] (1) layers\nset [ghost v] effect to (0)\nshow\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\nwhen I receive [start dream i v]\nswitch costume to (costume2 v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (5.2) seconds\nbroadcast (start dream I for real v)\nhide\n\nwhen I receive [start dream ii v]\nset [brightness v] effect to (0)\nswitch costume to (costume2 v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (3.5) seconds\nbroadcast (start dream II for real v)\nhide\n\nwhen I receive [start dream iii v]\nset [brightness v] effect to (0)\nswitch costume to (costume2 v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (3.5) seconds\nbroadcast (start dream III for real v)\nhide\n\nwhen I receive [start endgame v]\nset [brightness v] effect to (0)\nswitch costume to (costume2 v)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nwait (1) seconds\nrepeat (50)\n    change [ghost v] effect by (-2)\nend\nwait (1) seconds\nrepeat (5)\n    next costume\n    wait (0.03) seconds\nend\nwait (1) seconds\nbroadcast (chancellor of dreams v)\nhide\n\n@Sprite4\n\nwhen flag clicked\nshow\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (0) y: (0)\nset size to (10) %\nrepeat (5)\n    change size by (18)\n    go to [front v] layer\nend\nrepeat (25)\n    change size by (0.6)\nend\nrepeat (4)\n    change size by (0.6)\n    next costume\nend\nrepeat (10)\n    change size by (0.6)\nend\nrepeat (4)\n    change size by (0.6)\n    next costume\nend\nrepeat (15)\n    change size by (0.6)\nend\nrepeat (25)\n    change [ghost v] effect by (4)\n    change size by (0.6)\nend\nhide\n\n@Sprite5\n\nwhen flag clicked\nset [color v] effect to (125)\ngo to x: (0) y: (100)\nhide\nset size to (100) %\n\nwhen I receive [start dream i v]\nwait (2) seconds\nhide\nstop [other scripts in sprite v]\n\nwhen flag clicked\nwait (3) seconds\nshow\nforever\n    point in direction ((([sin v] of (rfvdcsx) ) * (3)) + (90))\n    change y by (([sin v] of (rfvdcsx) ) * (2))\n    change size by ([sin v] of (rfvdcsx) )\n    change [rfvdcsx v] by (10)\nend\n\n@Sprite6\n\nwhen flag clicked\nset size to (100) %\nhide\nwait (5) seconds\nshow\nswitch costume to (costume1 v)\nwait (0.05) seconds\nrepeat (2)\n    next costume\n    wait (0.05) seconds\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        if <mouse down?> then\n            stop all sounds\n            start sound [Crank v]\n            stop [other scripts in sprite v]\n            set size to (100) %\n            wait (1) seconds\n            broadcast (Start Dream I v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nwait (5.15) seconds\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (3)\n            change size by (4)\n        end\n        repeat (4)\n            change size by (3)\n        end\n        repeat (2)\n            change size by (2)\n        end\n        repeat (1)\n            change size by (1)\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n        repeat (3)\n            change size by (-4)\n        end\n        repeat (4)\n            change size by (-3)\n        end\n        repeat (2)\n            change size by (-2)\n        end\n        repeat (1)\n            change size by (-1)\n        end\n    end\nend\n\nwhen I receive [start dream i v]\nwait (2) seconds\nhide\nstop [other scripts in sprite v]\n\n@Sprite3\n\nwhen I receive [start dream i v]\nwait (2) seconds\nforever\n    play sound [734702_Calm-Craggy-Area-1f1n1ty-R v] until done\nend\n\nwhen I receive [start dream i for real v]\nwait (1) seconds\nforever\n    if <(Level) = [11]> then\n        stop [other scripts in sprite v]\n        stop all sounds\n        broadcast (start dream II v)\n        stop [this script v]\n    end\nend\n\n@Sprite7\n\nwhen I receive [start dream i v]\nset [ghost v] effect to (0)\nswitch costume to (costume5 v)\ngo to [front v] layer\nwait (3.5) seconds\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nset size to (10) %\nshow\nrepeat (5)\n    change size by (18)\nend\nrepeat (40)\n    change size by (0.6)\nend\nrepeat (25)\n    change [ghost v] effect by (4)\n    change size by (0.6)\nend\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [start dream ii v]\nset [ghost v] effect to (0)\nswitch costume to (costume2 v)\ngo to [front v] layer\nwait (3) seconds\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nset size to (10) %\nshow\nrepeat (5)\n    change size by (18)\nend\nrepeat (40)\n    change size by (0.6)\nend\nrepeat (25)\n    change [ghost v] effect by (4)\n    change size by (0.6)\nend\nhide\n\nwhen I receive [start dream iii v]\nset [ghost v] effect to (0)\nswitch costume to (costume3 v)\ngo to [front v] layer\nwait (3) seconds\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nset size to (10) %\nshow\nrepeat (5)\n    change size by (18)\nend\nrepeat (40)\n    change size by (0.6)\nend\nrepeat (25)\n    change [ghost v] effect by (4)\n    change size by (0.6)\nend\nhide\n\n@BG1\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [start dream i for real v]\ngo to [back v] layer\nset [brightness v] effect to (-10)\ngo to x: (10) y: (0)\nshow\n\nwhen I receive [start dream ii v]\nwait (3) seconds\nhide\n\ngo [backward v] (1) layers\n\nwhen I receive [next level v]\nchange x by (-1.5)\n\n@GROUND1\n\nwhen I receive [start dream i for real v]\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start dream ii v]\nwait (3) seconds\nhide\n\n@Sprite8\n\nwhen flag clicked\nforever\n    if <touching color (#00ffff)?> then\n        play sound [bubbles v] until done\n    end\nend\n\nwhen I receive [start dream i for real v]\nwait (0.2) seconds\nforever\n    if <touching color (#dd5db0)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [7]\n            start sound [quick dash v]\n            wait until <not <touching color (#dd5db0)?>>\n        end\n    end\nend\n\nwhen I receive [start dream i for real v]\nwait (0.2) seconds\nforever\n    if <touching color (#26ff00)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <<(x vel) > [0]> or <(x vel) = [0]>> then\n                set [x vel v] to [19]\n                start sound [quick dash v]\n            end\n            if <(x vel) < [0]> then\n                set [x vel v] to [-19]\n                start sound [quick dash v]\n            end\n            wait until <not <touching color (#26ff00)?>>\n        end\n    end\nend\n\nbroadcast (start dream II v)\n\nwhen I receive [start dream i for real v]\nwait (0.3) seconds\nforever\n    if <touching color (#ff0000)?> then\n        broadcast (oof v)\n        start sound [med-rifle v]\n        go to x: (-210) y: (-80)\n        set [y vel v] to [0]\n    end\n    if <(x position) > [235]> then\n        broadcast (next level v)\n        start sound [Laser Sound Effect-2 v]\n        go to x: (-202) y: (-80)\n        change [level v] by (1)\n        set [y vel v] to [0]\n        set [x vel v] to [0]\n    end\nend\n\nwhen I receive [start dream i for real v]\nset volume to (100) %\nset size to (100) %\nswitch costume to (costume1 v)\nset [x vel v] to [0]\nset [y vel v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (costume2 v)\n        change [x vel v] by (0.43)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (costume3 v)\n        change [x vel v] by (-0.43)\n    end\n    set [x vel v] to ((x vel) * (0.93))\n    change x by (x vel)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((x vel) * (-1))\n                            change y by (-5)\n                            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                                if <(x vel) = [0]> then\n                                    set [x vel v] to [-5]\n                                else\n                                    set [x vel v] to [5]\n                                end\n                                set [y vel v] to [10]\n                            else\n                                set [x vel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y vel v] by (-0.4)\n    change y by (y vel)\n    if <touching color (#000000)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [7]\n            start sound [Whoosh sound effects \(from the tutorial\) v]\n        end\n    end\n    if <touching color (#ff8200)?> then\n        start sound [quick dash v]\n        set [y vel v] to [10]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start dream i for real v]\nrepeat (5)\n    go to x: (-202) y: (-80)\nend\nshow\n\nwhen I receive [start dream i for real v]\nforever\n    if <(Level) = [11]> then\n        hide\n        start sound [Laser Sound Effect-2 v]\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [start dream i for real v]\nforever\n    if <key (r v) pressed?> then\n        go to x: (-202) y: (-80)\n        set [y vel v] to [0]\n        set [x vel v] to [0]\n    end\nend\n\n@Sprite9\n\nwhen I receive [start dream i v]\nwait (2.5) seconds\nset rotation style [left-right v]\nrepeat until <(Level) = [11]>\n    create clone of (_myself_ v)\n    set [fish variatoion v] to [0]\n    wait (0.6) seconds\n    create clone of (_myself_ v)\n    set [fish variatoion v] to [1]\n    wait (0.6) seconds\nend\n\nwhen I start as a clone\nset rotation style [left-right v]\nswitch costume to (pick random (1) to (4))\ngo to [back v] layer\ngo [forward v] (5) layers\nset [brightness v] effect to (-10)\nshow\nset size to (pick random (30) to (90)) %\nif <(fish variatoion) = [0]> then\n    point in direction (90)\n    go to x: (-250) y: (pick random (-100) to (170))\n    repeat (30)\n        move ((size) / (30)) steps\n    end\n    repeat until <(x position) > [230]>\n        move ((size) / (30)) steps\n        if <(Level) = [11]> then\n            delete this clone\n        end\n    end\n    repeat (12)\n        move ((size) / (30)) steps\n    end\n    delete this clone\nend\nif <(fish variatoion) = [1]> then\n    point in direction (-90)\n    go to x: (250) y: (pick random (-100) to (170))\n    repeat (30)\n        move ((size) / (30)) steps\n    end\n    repeat until <(x position) < [-230]>\n        move ((size) / (30)) steps\n        if <(Level) = [11]> then\n            delete this clone\n        end\n    end\n    repeat (12)\n        move ((size) / (30)) steps\n    end\n    delete this clone\nend\n\nwhen flag clicked\nhide\n\n@Sprite10\n\nwhen I receive [start dream ii v]\nforever\n    if <touching color (#dd5db0)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [11.5]\n            start sound [quick dash v]\n            wait until <not <touching color (#dd5db0)?>>\n        end\n    end\nend\n\nwhen I receive [start dream ii for real v]\nwait (0.2) seconds\nforever\n    if <touching color (#26ff00)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <<(x vel) > [0]> or <(x vel) = [0]>> then\n                set [x vel v] to [18]\n                start sound [quick dash v]\n            end\n            if <(x vel) < [0]> then\n                set [x vel v] to [-18]\n                start sound [quick dash v]\n            end\n            wait until <not <touching color (#26ff00)?>>\n        end\n    end\nend\n\nwhen I receive [start dream ii for real v]\nforever\n    if <<<<touching color (#ff0000)?> or <touching (sprite12 v)?>> or <touching (sprite15 v)?>> or <touching (sprite13 v)?>> then\n        broadcast (oof v)\n    end\n    if <(x position) > [235]> then\n        broadcast (next level v)\n        start sound [Laser Sound Effect-2 v]\n        go to x: (-202) y: (-80)\n        change [level v] by (1)\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n    end\nend\n\nwhen I receive [start dream ii for real v]\ngo to [front v] layer\nset volume to (100) %\nset size to (100) %\nswitch costume to (costume1 v)\nset [x vel v] to [0]\nset [y vel v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (costume2 v)\n        change [x vel v] by (0.9)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (costume3 v)\n        change [x vel v] by (-0.9)\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((x vel) * (-1))\n                            change y by (-5)\n                            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                                if <(x vel) = [0]> then\n                                    set [x vel v] to [-5]\n                                else\n                                    set [x vel v] to [5]\n                                end\n                                set [y vel v] to [10]\n                            else\n                                set [x vel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y vel v] by (-1)\n    change y by (y vel)\n    if <touching color (#000000)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [11.5]\n            start sound [Whoosh sound effects \(from the tutorial\) v]\n        end\n    end\n    if <touching color (#00ffff)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [8]\n        else\n            set [y vel v] to [-1.5]\n        end\n    end\n    if <touching color (#ff9400)?> then\n        start sound [quick dash v]\n        set [y vel v] to [20]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start dream ii for real v]\nrepeat (5)\n    go to x: (-202) y: (-80)\nend\nshow\n\nwhen I receive [start dream ii for real v]\nforever\n    if <(Level) = [21]> then\n        hide\n        start sound [Laser Sound Effect-2 v]\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [start dream ii for real v]\nforever\n    if <key (r v) pressed?> then\n        go to x: (-202) y: (-80)\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n    end\nend\n\nwhen I receive [oof v]\nstart sound [med-rifle v]\ngo to x: (-210) y: (-80)\nset [y vel v] to [0]\n\n@BG2\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nhide\n\nwhen I receive [start dream ii for real v]\nset [brightness v] effect to (-7)\nshow\n\nwhen I receive [start dream iii v]\nwait (3) seconds\nhide\n\n@GROUND2\n\nwhen I receive [start dream ii for real v]\nset [level v] to [11]\nswitch costume to (costume1 v)\nshow\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start dream ii v]\nforever\n    if <(Level) = [20]> then\n        broadcast (begin boss battle 1 v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [start dream iii v]\nwait (3) seconds\nhide\n\n@Sprite11\n\nwhen I receive [start dream ii v]\nwait (2.5) seconds\nrepeat until <(Level) = [21]>\n    create clone of (_myself_ v)\n    wait (0.001) seconds\nend\n\nwhen I start as a clone\nset rotation style [all around v]\nset [brightness v] effect to (pick random (-20) to (5))\nset [color v] effect to (pick random (-10) to (0))\nset size to (pick random (25) to (120)) %\nset [ghost v] effect to (-15)\nshow\npoint in direction (pick random (-30) to (30))\ngo to x: (pick random (-200) to (200)) y: (-150)\nrepeat (2)\n    move ((size) / (5)) steps\nend\nrepeat until <<(y position) > [180]> or <touching (_edge_ v)?>>\n    move ((size) / (5)) steps\n    if <(Level) = [21]> then\n        delete this clone\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\ngo [backward v] (3) layers\n\n@Sprite12\n\ndefine first attack\nstart sound [Sound Effects Laser Samples3 v]\nswitch costume to (costume1 v)\nrepeat (5)\n    next costume\n    wait (0.05) seconds\nend\nnext costume\nwait (0.05) seconds\nturn right (12) degrees\nrepeat (6)\n    turn left (2) degrees\n    next costume\n    wait (0.05) seconds\nend\nswitch costume to (costume1 v)\n\ndefine second attack\nswitch costume to (costume14 v)\nwait (0.05) seconds\nrepeat (4)\n    next costume\n    wait (0.05) seconds\nend\nwait (0.1) seconds\nnext costume\nbroadcast (launch nuclear orbs v)\nstart sound [Sound Effects Laser Samples2 v]\nwait (0.1) seconds\nrepeat (3)\n    next costume\n    wait (0.05) seconds\nend\nswitch costume to (costume19 v)\nrepeat (5)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.05) seconds\nend\nswitch costume to (costume1 v)\n\nwhen I receive [begin boss battle 1 v]\nforever\n    set [head_direction v] to (direction)\nend\n\nwhen I receive [begin boss battle 1 v]\ngo to x: (150) y: (-20)\nshow\nwait (0.05) seconds\ngo to [front v] layer\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen I receive [begin boss battle 1 v]\nset [boss life v] to [1]\nset [prev_direction v] to [90]\nswitch costume to (costume1 v)\ngo to [front v] layer\npoint in direction (prev_direction)\nset [brightness v] effect to (0)\nset [attack_factor v] to [1]\nshow\nforever\n    wait (pick random (0.1) to (0.3)) seconds\n    point towards (sprite10 v)\n    turn left (180) degrees\n    set [attack_factor v] to (direction)\n    point in direction (prev_direction)\n    start sound [Minecraft - ALL Mob Sounds \(3 v]\n    repeat until <([abs v] of ((attack_factor) - (direction)) ) < [2]>\n        turn right (((attack_factor) - (direction)) / (8)) degrees\n    end\n    set [prev_direction v] to (direction)\n    wait (pick random (0.3) to (0.5)) seconds\n    if <(pick random (1) to (2)) = [1]> then\n        first attack\n    else\n        if <(pick random (1) to (2)) = [1]> then\n            second attack\n        else\n            third attack\n        end\n    end\nend\n\nwhen I receive [boss death i v]\nset [boss life v] to [0]\nstart sound [Minecraft - ALL Mob Sounds \(1 v]\nswitch costume to (costume23 v)\nstop [other scripts in sprite v]\nrepeat (25)\n    change [brightness v] effect by (4)\nend\nwait (0.5) seconds\nhide\nstop [other scripts in sprite v]\n\ndefine third attack\nbroadcast (third attack v)\nwait (0.02) seconds\nrepeat (10)\n    change y by (-2)\nend\nrepeat (5)\n    change y by (-1)\nend\nrepeat (3)\n    change y by (-0.5)\nend\nwait (2) seconds\nrepeat (10)\n    change y by (2)\nend\nrepeat (5)\n    change y by (1)\nend\nrepeat (3)\n    change y by (0.5)\nend\n\nwhen I receive [boss hit i v]\nset [brightness v] effect to (40)\nrepeat (20)\n    change [brightness v] effect by (-2)\nend\n\nwhen I receive [start dream iii v]\nif <(boss life) = [1]> then\n    broadcast (boss death I v)\nend\n\n@Sprite13\n\nwhen flag clicked\ngo to x: (170) y: (-20)\nset [brightness v] effect to (0)\nhide\n\nwhen I receive [begin boss battle 1 v]\ngo to [front v] layer\nshow\n\nwhen I receive [boss death i v]\nrepeat (25)\n    change [brightness v] effect by (4)\nend\nwait (0.5) seconds\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [third attack v]\nrepeat (10)\n    change y by (-2)\nend\nrepeat (5)\n    change y by (-1)\nend\nrepeat (3)\n    change y by (-0.5)\nend\nwait (2) seconds\nrepeat (10)\n    change y by (2)\nend\nrepeat (5)\n    change y by (1)\nend\nrepeat (3)\n    change y by (0.5)\nend\n\nwhen I receive [boss hit i v]\nset [brightness v] effect to (40)\nrepeat (20)\n    change [brightness v] effect by (-2)\nend\n\n@Sprite14\n\nwhen I receive [launch nuclear orbs v]\nrepeat (3)\n    create clone of (_myself_ v)\n    wait (0.15) seconds\nend\n\nwhen I start as a clone\ngo to [front v] layer\ngo to (sprite12 v)\nchange x by (50)\nchange y by (-50)\nshow\npoint in direction ((pick random ((head_direction) + (5)) to ((head_direction) - (-5))) - (180))\nset size to (20) %\nrepeat (8)\n    move (15) steps\n    change size by (10)\nend\nrepeat until <touching (_edge_ v)?>\n    move (15) steps\n    if <(distance to [sprite10 v]) < [50]> then\n        broadcast (oof v)\n    end\nend\nrepeat (12)\n    move (15) steps\nend\ndelete this clone\n\n@Sprite15\n\nwhen flag clicked\nhide\n\nwhen I receive [third attack v]\ngo to [front v] layer\nswitch costume to (costume1 v)\ngo to x: (-180) y: (-80)\nwait (0.5) seconds\nshow\nif <(pick random (1) to (2)) = [1]> then\n    set x to (-180)\nelse\n    set x to (-65)\nend\nrepeat (10)\n    change y by (4)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (3)\n    change y by (2)\nend\nrepeat (2)\n    change y by (1)\nend\nwait (0.3) seconds\nstart sound [Sound Effects Laser Samples4 v]\nrepeat (5)\n    next costume\n    wait (0.05) seconds\nend\nwait (0.3) seconds\nrepeat (10)\n    change y by (-4)\nend\nrepeat (5)\n    change y by (-3)\nend\nrepeat (3)\n    change y by (-2)\nend\nrepeat (2)\n    change y by (-1)\nend\nhide\n\n@weak points\n\nwhen flag clicked\nhide\n\nwhen I receive [begin boss battle 1 v]\nshow\nset [first boss hp v] to [5]\ngo to x: (-85) y: (90)\nforever\n    repeat until <touching (sprite10 v)?>\n        turn right (3) degrees\n    end\n    if <(first boss HP) = [1]> then\n        start sound [Laser Sound Effect-2 v]\n        hide\n        set [first boss hp v] to [0]\n        broadcast (boss death I v)\n        stop [this script v]\n    end\n    if <(first boss HP) = [2]> then\n        start sound [Laser Sound Effect-2 v]\n        broadcast (boss hit I v)\n        change [first boss hp v] by (-1)\n        go to x: (-186) y: (23)\n    end\n    if <(first boss HP) = [3]> then\n        start sound [Laser Sound Effect-2 v]\n        broadcast (boss hit I v)\n        change [first boss hp v] by (-1)\n        go to x: (-82) y: (-39)\n    end\n    if <(first boss HP) = [4]> then\n        start sound [Laser Sound Effect-2 v]\n        broadcast (boss hit I v)\n        change [first boss hp v] by (-1)\n        go to x: (-188) y: (147)\n    end\n    if <(first boss HP) = [5]> then\n        start sound [Laser Sound Effect-2 v]\n        broadcast (boss hit I v)\n        change [first boss hp v] by (-1)\n        go to x: (-189) y: (-93)\n    end\nend\n\nwhen I receive [oof v]\nrepeat (2)\n    set [first boss hp v] to [5]\n    go to x: (-85) y: (90)\nend\n\nwhen I receive [start dream iii v]\nstop [other scripts in sprite v]\nhide\n\n@Sprite16\n\nwhen flag clicked\nhide\n\nwhen I receive [begin boss battle 1 v]\nshow\nforever\n    switch costume to ((first boss HP) + (1))\nend\n\nwhen I receive [boss death i v]\nwait (1.5) seconds\nhide\nstop [other scripts in sprite v]\n\n@BG3\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nhide\n\nwhen I receive [start dream iii for real v]\nset [brightness v] effect to (-15)\nshow\n\nwhen I receive [start dream iii v]\nwait (3) seconds\nhide\n\ngo to [front v] layer\n\nbroadcast (start dream III v)\n\nwhen I receive [start dream iii for real v]\nforever\n    change [brightness v] effect by (20)\n    repeat (10)\n        change [brightness v] effect by (-2)\n    end\n    wait (0.096) seconds\nend\n\nwhen I receive [start endgame v]\nwait (3) seconds\nhide\n\n@GROUND3\n\nwhen I receive [start dream iii for real v]\nset [level v] to [21]\nswitch costume to (costume1 v)\nshow\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [next level v]\nnext costume\n\nwhen I receive [start dream iii v]\nwait (3) seconds\nhide\n\nwhen I receive [start endgame v]\nwait (3) seconds\nhide\n\n@Sprite17\n\nwhen I receive [start dream iii for real v]\nforever\n    if <touching color (#dd5db0)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [10]\n            start sound [quick dash v]\n            wait until <not <touching color (#dd5db0)?>>\n        end\n    end\nend\n\nwhen I receive [start dream iii for real v]\nwait (0.2) seconds\nforever\n    if <touching color (#26ff00)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            if <<(x vel) > [0]> or <(x vel) = [0]>> then\n                set [x vel v] to [18]\n                start sound [quick dash v]\n            end\n            if <(x vel) < [0]> then\n                set [x vel v] to [-18]\n                start sound [quick dash v]\n            end\n            wait until <not <touching color (#26ff00)?>>\n        end\n    end\nend\n\nwhen I receive [start dream iii for real v]\nforever\n    if <<<touching color (#ff0000)?> or <touching (sprite19 v)?>> or <touching (sprite20 v)?>> then\n        broadcast (oof v)\n    end\n    if <(x position) > [235]> then\n        broadcast (next level v)\n        start sound [Laser Sound Effect-2 v]\n        go to x: (-202) y: (-80)\n        change [level v] by (1)\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n    end\nend\n\nwhen I receive [start dream iii for real v]\ngo to [front v] layer\nset volume to (100) %\nset size to (100) %\nswitch costume to (costume1 v)\nset [x vel v] to [0]\nset [y vel v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (costume2 v)\n        change [x vel v] by (0.8)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (costume3 v)\n        change [x vel v] by (-0.8)\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((x vel) * (-1))\n                            change y by (-5)\n                            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                                if <(x vel) = [0]> then\n                                    set [x vel v] to [-5]\n                                else\n                                    set [x vel v] to [5]\n                                end\n                                set [y vel v] to [10]\n                            else\n                                set [x vel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y vel v] by (-1)\n    change y by (y vel)\n    if <touching color (#000000)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [10]\n            start sound [Whoosh sound effects \(from the tutorial\) v]\n        end\n    end\n    if <touching color (#00ffff)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [8]\n        else\n            set [y vel v] to [-1.5]\n        end\n    end\n    if <touching color (#ff9400)?> then\n        start sound [quick dash v]\n        set [y vel v] to [15]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start dream iii for real v]\nrepeat (5)\n    go to x: (-202) y: (-80)\nend\nshow\n\nwhen I receive [start dream ii for real v]\nforever\n    if <(Level) = [31]> then\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [start dream iii for real v]\nforever\n    if <key (r v) pressed?> then\n        go to x: (-202) y: (-80)\n        set [x vel v] to [0]\n        set [y vel v] to [0]\n    end\nend\n\nwhen I receive [oof v]\nstart sound [med-rifle v]\ngo to x: (-210) y: (-80)\nset [y vel v] to [0]\n\n@Sprite18\n\nwhen I receive [start dream iii v]\nwait (2.5) seconds\nset rotation style [left-right v]\nrepeat until <(Level) = [31]>\n    create clone of (_myself_ v)\n    wait (0.03) seconds\nend\n\nwhen I start as a clone\nset rotation style [left-right v]\nswitch costume to (pick random (1) to (2))\ngo to [back v] layer\ngo [forward v] (5) layers\nset [brightness v] effect to (-10)\nset size to (pick random (50) to (100)) %\nif <(pick random (1) to (2)) = [1]> then\n    point in direction (90)\n    set x to (-240)\nelse\n    point in direction (-90)\n    set x to (240)\nend\nif <(pick random (1) to (2)) = [1]> then\n    set y to (pick random (-100) to (-80))\nelse\n    if <(pick random (1) to (2)) = [1]> then\n        set y to (pick random (120) to (140))\n    else\n        set y to (pick random (60) to (80))\n    end\nend\nshow\nrepeat (30)\n    move ((size) / (10)) steps\nend\nrepeat until <touching (_edge_ v)?>\n    move ((size) / (10)) steps\nend\nrepeat (2)\n    move ((size) / (10)) steps\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Sprite19\n\nwhen I receive [start dream iii for real v]\nwait (1) seconds\nset [gear_spacing v] to [0]\nwait until <(Level) = [23]>\nchange [gear_spacing v] by (1)\ncreate clone of (_myself_ v)\nwait (0.03) seconds\nchange [gear_spacing v] by (1)\ncreate clone of (_myself_ v)\nwait until <(Level) = [28]>\nchange [gear_spacing v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(gear_spacing) = [1]> then\n    go to x: (0) y: (-125)\nelse\n    go to x: (-120) y: (-110)\nend\nshow\nset size to (70) %\ngo to [front v] layer\ngo [backward v] (20) layers\nrepeat until <not <(Level) = [23]>>\n    turn left (15) degrees\nend\ndelete this clone\n\ncreate clone of (_myself_ v)\n\n@Sprite20\n\nwhen I receive [start dream iii for real v]\nwait (1) seconds\nwait until <(Level) = [28]>\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: (-65) y: (-137)\nshow\nset size to (90) %\ngo to [front v] layer\ngo [backward v] (20) layers\nrepeat until <not <(Level) = [28]>>\n    turn left (15) degrees\nend\ndelete this clone\n\n@Sprite22\n\nwhen I receive [chancellor of dreams v]\ngo to x: (0) y: (55)\nforever\n    repeat (10)\n        change y by (1)\n    end\n    repeat (5)\n        change y by (0.7)\n    end\n    repeat (3)\n        change y by (0.3)\n    end\n    repeat (3)\n        change y by (-0.3)\n    end\n    repeat (5)\n        change y by (-0.7)\n    end\n    repeat (10)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (-1)\n    end\n    repeat (5)\n        change y by (-0.7)\n    end\n    repeat (3)\n        change y by (-0.3)\n    end\n    repeat (3)\n        change y by (0.3)\n    end\n    repeat (5)\n        change y by (0.7)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen I receive [chancellor of dreams v]\nshow\nswitch costume to (costume2 v)\nwait (1) seconds\nforever\n    wait (pick random (0.5) to (3)) seconds\n    repeat (pick random (1) to (5))\n        switch costume to (pick random (1) to (6))\n        wait (0.02) seconds\n    end\n    switch costume to (costume2 v)\nend\n\nwhen I receive [chancellor of dreams v]\nwait (58) seconds\nhide\n\n@Sprite23\n\nwait (0.5) seconds\nset [key sound v] to [0]\nrepeat (15)\n    set [key sound v] to (pick random (1) to (7))\n    start sound (key sound)\n    wait (0.05) seconds\nend\n\nwait (1) seconds\nNext line\nerase all\nType [woke the land up with it.]\nhide\nwait (1) seconds\nerase all\n\nwait (5) seconds\n\ndefine Type (x)\nset x to (-200)\nset [letter v] to (letter (1) of (x))\nswitch costume to (letter (1) of (x))\nset [# v] to [1]\nrepeat (length of (x))\n    start sound [C2 Elec Piano v]\n    stamp\n    change x by (15)\n    change [# v] by (1)\n    switch costume to (letter (#) of (x))\nend\n\ndefine Next line\nchange y by (-40)\n\nwhen flag clicked\nerase all\n\nwait (1) seconds\n\ndefine next line small\nchange y by (-20)\n\ndefine type (x) small\nset x to (-230)\nset [letter v] to (letter (1) of (x))\nswitch costume to (letter (1) of (x))\nset [# v] to [1]\nrepeat (length of (x))\n    stamp\n    change x by (10)\n    change [# v] by (1)\n    switch costume to (letter (#) of (x))\nend\n\nerase all\n\nwait (1) seconds\n\nwhen flag clicked\nhide\n\nType [yo whats up]\n\nset [key sound v] to [0]\nrepeat (15)\n    set [key sound v] to (pick random (1) to (7))\n    start sound (key sound)\n    wait (0.05) seconds\nend\nwait (0.5) seconds\nwait (0.5) seconds\nset [key sound v] to [0]\nrepeat (15)\n    set [key sound v] to (pick random (1) to (7))\n    start sound (key sound)\n    wait (0.05) seconds\nend\n\nset [key sound v] to [0]\nrepeat (15)\n    set [key sound v] to (pick random (1) to (7))\n    start sound (key sound)\n    wait (0.05) seconds\nend\nwait (0.5) seconds\nwait (0.5) seconds\nset [key sound v] to [0]\nrepeat (15)\n    set [key sound v] to (pick random (1) to (7))\n    start sound (key sound)\n    wait (0.05) seconds\nend\n\nset [key sound v] to [0]\nrepeat (15)\n    set [key sound v] to (pick random (1) to (7))\n    start sound (key sound)\n    wait (0.05) seconds\nend\n\nhide\nwait (5) seconds\nset [key sound v] to [0]\ngo to x: (145) y: (140)\nset [# v] to [0]\nset [letter v] to [0]\nshow\nerase all\nset size to (150) %\nType [go find that gem.]\nhide\n\nhide\nset [key sound v] to [0]\ngo to x: (145) y: (0)\nset [# v] to [0]\nset [letter v] to [0]\nshow\nerase all\nset size to (150) %\nType [you found the gem...]\nNext line\nwait (1) seconds\nType [now bring it back.]\nhide\nbroadcast (end screen v)\n\nwhen I receive [chancellor of dreams v]\nset y to (-80)\nset [brightness v] effect to (-30)\nset [color v] effect to (30)\nwait (1) seconds\nType [so you finally made it.]\nwait (1.5) seconds\nerase all\nType [you've managed to pass every]\nNext line\nType [single dream i've created]\nNext line\nType [for you.]\nwait (1) seconds\nerase all\nset y to (-80)\nType [most impressive. very few ]\nNext line\nType [have gotten this far.]\nwait (1) seconds\nerase all\nwait (1) seconds\nset y to (-80)\nType [forgive me, i have not]\nNext line\nType [yet introduced myself.]\nwait (0.5) seconds\nerase all\nwait (1) seconds\nset y to (-80)\nType [i am the chancellor of]\nNext line\nType [dreams]\nwait (1) seconds\nerase all\nset y to (-80)\nType [and i am the god of this]\nNext line\nType [virtual world]\nwait (0.5) seconds\nerase all\nwait (1) seconds\nset y to (-80)\nType [i'll just get right to the ]\nNext line\nType [point]\nwait (1) seconds\nerase all\nset y to (-80)\nType [you have completed your]\nNext line\nType [cycle through the dream world]\nwait (1) seconds\nerase all\nset y to (-80)\nType [thus, it would be time for]\nNext line\nType [you to enter the real ]\nNext line\nType [world again.]\nwait (1) seconds\nerase all\nwait (1) seconds\nset y to (-80)\nType [unfortunately, i cannot do]\nNext line\nType [that for you]\nwait (1) seconds\nerase all\nset y to (-80)\nType [i have run several]\nNext line\nType [calculations and predictions]\nwait (1) seconds\nerase all\nset y to (-80)\nType [and i know for a fact]\nNext line\nType [that you will resist.]\nwait (1) seconds\nerase all\nset y to (-80)\nType [i understand. this is]\nNext line\nType [your home.]\nwait (1) seconds\nerase all\nset y to (-80)\nType [you are the champion of]\nNext line\nType [this world]\nwait (1) seconds\nerase all\nset y to (-80)\nType [you can overrule everything]\nNext line\nType [else in this world]\nwait (1) seconds\nerase all\nset y to (-80)\nType [including me.]\nwait (1) seconds\nerase all\nset y to (-80)\nType [thus, i will be terminating]\nNext line\nType [your life force, never to be]\nNext line\nType [seen again]\nwait (1) seconds\nerase all\nset y to (-80)\nType [i'm sorry it had to be this]\nNext line\nType [way]\nwait (1) seconds\nerase all\nset y to (-80)\nType [but do not try to resist.]\nNext line\nType [it will only make it more]\nNext line\nType [difficult for both of us.]\nwait (1) seconds\nerase all\nset y to (-80)\nType [after all, what is a champion]\nNext line\nType [to a god?]\nwait (1) seconds\nerase all\nwait (2) seconds\nset y to (-80)\nType [goodbye, player.]\nwait (1) seconds\nerase all\nhide\nwait (2) seconds\nbroadcast (begin final boss battle v)\n\n@sprite24\n\nwhen I receive [begin final boss battle v]\nwait (1) seconds\nset [brightness v] effect to (100)\nshow\nrepeat (35)\n    change [brightness v] effect by (-3)\nend\nwait (0.6) seconds\nrepeat (15)\n    change [brightness v] effect by (40)\n    repeat (20)\n        change [brightness v] effect by (-2)\n    end\n    wait (0.7) seconds\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nset [brightness v] effect to (0)\n\nwhen I receive [begin final boss battle v]\nplay sound [631160_Domyeah---Final-Boss v] until done\nforever\n    play sound [631160_Domyeah---Final-Boss2 v] until done\nend\n\nwhen I receive [final boss death v]\nstop all sounds\nstop [other scripts in sprite v]\n\nwhen I receive [end the game v]\nrepeat (50)\n    change [brightness v] effect by (2)\nend\nwait (1) seconds\nnext costume\nset [brightness v] effect to (0)\nplay sound [781445_Ugly-Fuel-OFF-VOCAL v] until done\n\n@Sprite25\n\nwhen flag clicked\ngo to [front v] layer\nhide\n\nwhen I receive [begin final boss battle v]\nwait (7) seconds\nshow\nset [brightness v] effect to (100)\nrepeat (20)\n    change [brightness v] effect by (-5)\nend\n\nwhen I receive [end the game v]\nhide\n\n@Sprite26\n\nwhen I receive [begin final boss battle v]\nwait (15) seconds\nset [x vel v] to [0]\nset [y vel v] to [0]\nrepeat until <(final boss HP) = [0]>\n    if <<<<touching color (#ff0000)?> or <touching (_edge_ v)?>> or <touching (sprite30 v)?>> or <touching (sprite31 v)?>> then\n        broadcast (oof v)\n    end\nend\n\nwhen I receive [begin final boss battle v]\ngo to [front v] layer\nset volume to (100) %\nset size to (100) %\nswitch costume to (costume1 v)\nset [x vel v] to [0]\nset [y vel v] to [0]\nforever\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (costume2 v)\n        change [x vel v] by (0.9)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (costume3 v)\n        change [x vel v] by (-0.9)\n    end\n    set [x vel v] to ((x vel) * (0.9))\n    change x by (x vel)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((x vel) * (-1))\n                            change y by (-5)\n                            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                                if <(x vel) = [0]> then\n                                    set [x vel v] to [-5]\n                                else\n                                    set [x vel v] to [5]\n                                end\n                                set [y vel v] to [10]\n                            else\n                                set [x vel v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y vel v] by (-1)\n    change y by (y vel)\n    if <touching color (#000000)?> then\n        change y by ((y vel) * (-1))\n        set [y vel v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [11.5]\n            start sound [Whoosh sound effects \(from the tutorial\) v]\n        end\n    end\n    if <touching color (#00ffff)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y vel v] to [8]\n        else\n            set [y vel v] to [-1.5]\n        end\n    end\n    if <touching color (#ff9400)?> then\n        start sound [quick dash v]\n        set [y vel v] to [20]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [oof v]\nstart sound [med-rifle v]\ngo to x: (0) y: (-29)\nset [y vel v] to [0]\n\nwhen I receive [begin final boss battle v]\nwait (12) seconds\nset [x vel v] to [0]\nset [y vel v] to [0]\ngo to x: (0) y: (-29)\nshow\n\nwhen I receive [end the game v]\nhide\nstop [other scripts in sprite v]\n\n@Sprite27\n\nwhen flag clicked\nset [brightness v] effect to (-5)\nhide\n\nwhen I receive [begin final boss battle v]\nwait (22.1) seconds\ngo [forward v] (1) layers\ngo to x: (0) y: (-180)\nshow\nrepeat (13)\n    change y by (10)\nend\nrepeat (9)\n    change y by (5)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (6)\n    change y by (1)\nend\nwait (0.1) seconds\nrepeat (5)\n    change y by (-2)\nend\nrepeat (3)\n    change y by (-1)\nend\nrepeat (2)\n    change y by (-0.5)\nend\nbroadcast (battle begins! v)\n\nwhen I receive [battle begins! v]\nforever\n    if <(pick random (1) to (2)) = [1]> then\n        Final boss first attack\n    else\n        if <(pick random (1) to (2)) = [1]> then\n            final boss second attack\n        else\n            final boss third attack\n        end\n    end\n    wait (pick random (0.2) to (0.6)) seconds\nend\n\ndefine Final boss first attack\nbroadcast (final boss first attack v)\nset [final boss attack v] to [1]\nwait (1.2) seconds\nrepeat (4)\n    change y by (-10)\nend\nrepeat (8)\n    change y by (3)\nend\nrepeat (5)\n    change y by (2)\nend\nrepeat (6)\n    change y by (1)\nend\nwait (2) seconds\n\ndefine final boss second attack\nbroadcast (down v)\nrepeat (10)\n    change y by (-2)\nend\nrepeat (5)\n    change y by (-1)\nend\nrepeat (6)\n    change y by (-0.5)\nend\nwait (0.5) seconds\nset [final boss attack v] to [2]\nbroadcast (final boss second attack v)\nwait (4) seconds\nrepeat (10)\n    change y by (2)\nend\nrepeat (5)\n    change y by (1)\nend\nrepeat (6)\n    change y by (0.5)\nend\n\ndefine final boss third attack\nrepeat (2)\n    repeat (2)\n        change y by (-10)\n    end\n    repeat (8)\n        change y by (1.5)\n    end\n    repeat (6)\n        change y by (1)\n    end\n    repeat (4)\n        change y by (0.5)\n    end\nend\nset [final boss attack v] to [3]\nwait (0.5) seconds\nbroadcast (pulse v)\nwait (2.5) seconds\n\nwhen I receive [final boss hit! v]\nchange [brightness v] effect by (30)\nrepeat (15)\n    change [brightness v] effect by (-2)\nend\n\nwhen I receive [final boss death v]\nstop [other scripts in sprite v]\nrepeat (60)\n    change [brightness v] effect by (2)\nend\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\nwait (4) seconds\nbroadcast (end the game v)\n\n@Sprite28\n\nwhen I receive [begin final boss battle v]\nwait (22) seconds\ngo to x: (0) y: (-110)\nshow\nrepeat (12)\n    change y by (6)\nend\nrepeat (7)\n    change y by (4)\nend\nrepeat (4)\n    change y by (2)\nend\nrepeat (5)\n    change y by (1)\nend\n\nwhen flag clicked\nset [brightness v] effect to (-5)\nhide\n\nwhen I receive [final boss first attack v]\nwait (1.2) seconds\nrepeat (4)\n    change y by (-5)\nend\nrepeat (8)\n    change y by (1.5)\nend\nrepeat (5)\n    change y by (1)\nend\nrepeat (6)\n    change y by (0.5)\nend\n\nwhen I receive [down v]\nrepeat (10)\n    change y by (-1)\nend\nrepeat (5)\n    change y by (-0.5)\nend\nrepeat (6)\n    change y by (-0.3)\nend\nwait (0.5) seconds\nwait (4) seconds\nrepeat (10)\n    change y by (1)\nend\nrepeat (5)\n    change y by (0.5)\nend\nrepeat (6)\n    change y by (0.3)\nend\n\nwhen I receive [final boss hit! v]\nchange [brightness v] effect by (30)\nrepeat (15)\n    change [brightness v] effect by (-2)\nend\n\nwhen I receive [final boss death v]\nstop [other scripts in sprite v]\nrepeat (60)\n    change [brightness v] effect by (2)\nend\nwait (3) seconds\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@Sprite29\n\nwhen flag clicked\nhide\n\nwhen I receive [begin final boss battle v]\nset [final boss hp v] to [10]\nwait (15) seconds\nshow\nswitch costume to (costume2 v)\ngo to x: (0) y: (180)\nshow\nrepeat (10)\n    change y by (-2)\nend\nrepeat (5)\n    change y by (-1)\nend\nrepeat (3)\n    change y by (-0.5)\nend\nrepeat (10)\n    next costume\n    wait (0.03) seconds\nend\nforever\n    switch costume to ((final boss HP) + (1))\nend\n\nwhen I receive [begin final boss battle v]\nwait (1) seconds\nforever\n    if <(final boss HP) = [0]> then\n        stop all sounds\n        broadcast (final boss death v)\n        wait (0.03) seconds\n        play sound [Minecraft - ALL Mob Sounds \(1 v] until done\n        stop [this script v]\n    end\nend\n\nwhen I receive [end the game v]\nhide\n\n@Sprite30\n\nwhen I receive [final boss first attack v]\nshow\nswitch costume to (costume2 v)\nset size to (110) %\nif <(pick random (1) to (2)) = [1]> then\n    point in direction (90)\n    set x to (-425)\n    if <(pick random (1) to (2)) = [1]> then\n        set y to (-91)\n    else\n        set y to (-16)\n    end\nelse\n    point in direction (-90)\n    set x to (425)\n    if <(pick random (1) to (2)) = [1]> then\n        set y to (-91)\n    else\n        set y to (-16)\n    end\nend\nrepeat (8)\n    move (4) steps\nend\nrepeat (5)\n    move (3) steps\nend\nrepeat (4)\n    move (2) steps\nend\nrepeat (3)\n    move (1) steps\nend\nwait (0.5) seconds\nrepeat (4)\n    next costume\n    wait (0.04) seconds\nend\nswitch costume to (costume2 v)\nwait (0.4) seconds\nrepeat (3)\n    move (-1) steps\nend\nrepeat (4)\n    move (-2) steps\nend\nrepeat (5)\n    move (-3) steps\nend\nrepeat (8)\n    move (-4) steps\nend\nhide\n\nwhen flag clicked\nset rotation style [left-right v]\nhide\n\nwhen I receive [final boss second attack v]\nshow\nswitch costume to (costume1 v)\nset y to (-100)\nif <(pick random (1) to (2)) = [2]> then\n    point in direction (90)\n    set x to (-100)\nelse\n    point in direction (-90)\n    set x to (100)\nend\nrepeat (10)\n    change y by (6)\nend\nrepeat (7)\n    change y by (5)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (6)\n    change y by (1)\nend\nwait (1) seconds\nrepeat (4)\n    next costume\n    change y by (-3)\n    wait (0.04) seconds\nend\nbroadcast (pulse v)\nwait (0.6) seconds\nrepeat (6)\n    change y by (-1)\nend\nrepeat (5)\n    change y by (-3)\nend\nrepeat (8)\n    change y by (-5)\nend\nrepeat (15)\n    change y by (-6)\nend\nhide\n\nwhen I receive [battle begins! v]\n\n@Sprite31\n\nwhen I receive [pulse v]\nif <(final boss attack) = [2]> then\n    switch costume to (costume1 v)\n    show\n    set [ghost v] effect to (0)\n    go to (sprite30 v)\n    change y by (-80)\n    set size to (100) %\n    repeat (45)\n        change [ghost v] effect by (2)\n        change size by (4)\n    end\n    hide\nelse\n    repeat (4)\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [ghost v] effect to (0)\nswitch costume to (costume2 v)\ngo to x: (pick random (-240) to (150)) y: (190)\nset size to (pick random (45) to (65)) %\npoint in direction (pick random (-175) to (180))\nshow\nrepeat (10)\n    change x by (2)\n    change y by (-10)\n    turn right (3) degrees\nend\nrepeat until <<(y position) < [-175]> or <(x position) > [235]>>\n    change x by (2)\n    change y by (-10)\n    turn right (3) degrees\nend\ndelete this clone\n\n@sprite32\n\ndefine position target\nset [target placement factor v] to (pick random (1) to (7))\nif <(target placement factor) = [1]> then\n    go to x: (-71) y: (-82)\nend\nif <(target placement factor) = [2]> then\n    go to x: (69) y: (-83)\nend\nif <(target placement factor) = [3]> then\n    go to x: (-140) y: (-28)\nend\nif <(target placement factor) = [4]> then\n    go to x: (1) y: (-29)\nend\nif <(target placement factor) = [5]> then\n    go to x: (133) y: (-31)\nend\nif <(target placement factor) = [6]> then\n    go to x: (-67) y: (32)\nend\nif <(target placement factor) = [7]> then\n    go to x: (73) y: (31)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [oof v]\nset [final boss hp v] to [10]\n\nwhen I receive [battle begins! v]\nshow\nset [final boss hp v] to [10]\ngo to x: (-85) y: (90)\nrepeat until <(final boss HP) = [0]>\n    set size to (100) %\n    set [ghost v] effect to (0)\n    position target\n    show\n    repeat until <touching (sprite26 v)?>\n        turn right (3) degrees\n    end\n    change [final boss hp v] by (-1)\n    start sound [Laser Sound Effect-2 v]\n    broadcast (final boss hit! v)\n    repeat (25)\n        change size by (2)\n        change [ghost v] effect by (4)\n    end\n    hide\n    wait (1.5) seconds\nend\n\n@Sprite21\n\nwhen flag clicked\nhide\n\n