Entirely Generic Platformer (A Platformer)

Instructions: https://scratch.mit.edu/projects/760433341/ \nTROLL PLATFORMER 2 IS FINALLY OUT!\nSorry for the super long delay.\nWalk-Through: \nhttps://www.youtube.com/watch?v=IPAaaSTcc7s \nArrow keys to move. \nTry to get to the end press hint if you need it.\nPlease star and like if you enjoyed!\nIf you want more games then follow me or comment a game idea you want me to make! Also if you want to collab on a project I'm always open!

@Stage\n\nwhen flag clicked\nforever\n    if <key (m v) pressed?> then\n        show variable [mouse v]\n    else\n        wait (1) seconds\n        hide variable [mouse v]\n    end\nend\n\nwhen [m v] key pressed\nset [mouse v] to (join ((mouse x) + (ScrollX)) (join [,] ((mouse y) + (ScrollY))))\n\nwhen flag clicked\nswitch backdrop to (backdrop4 v)\n\nwhen I receive [beginning v]\nswitch backdrop to (backdrop4 v)\n\nwhen I receive [about v]\nswitch backdrop to (backdrop5 v)\n\nwhen I receive [start v]\nswitch backdrop to (backdrop2 v)\n\n@Blank\n\n@Player\n\nwhen flag clicked\n\nhide\n\nwhen I receive [green flag v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nforever\n    broadcast (Reset v) and wait\n    broadcast (SetUp v) and wait\n    Game On\n    repeat until <(Exit) > []>\n        Tick\n        broadcast (Tick v)\n    end\n    if <(Exit) = [WIn]> then\n        Win\n        broadcast (Level Up v)\n        change [level v] by (1)\n    else\n        Die\n    end\nend\n\ndefine Game On\nset rotation style [left-right v]\nset size to (100) %\nset [ghost v] effect to (0)\nset [x v] to [0]\nset [y v] to [0]\nset [sx v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nshow\n\ndefine Tick\ncreate clone of (trail v)\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    switch costume to (right v)\n    change [sx v] by (3)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> then\n    switch costume to (left v)\n    change [sx v] by (-3)\nend\nset [sx v] to ((SX) * (0.75))\nif <([abs v] of (SX) ) > [0.9]> then\n    Change Player X By: (round (SX))\nend\nif <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n    switch costume to (up v)\n    if <(In Air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(SY) > [-15]> then\n    change [sy v] by (-1.5)\nend\nChange Player Y By: (SY)\nDeath_Test\nchange [scrollx v] by (round (((X) - (ScrollX)) / (8)))\nif <(ScrollX) < [0]> then\n    set [scrollx v] to [0]\nend\nchange [scrolly v] by (round (((Y) - (ScrollY)) / (10)))\nif <(ScrollY) < [0]> then\n    set [scrolly v] to [0]\nend\nPosition\nif <(Y) < [-150]> then\n    set [exit v] to [Die]\nend\n\ndefine Change Player Y By: (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: ((X) - (ScrollX)) y: ((Y) - (ScrollY))\n\ndefine Change Player X By: (sx)\ngo to [front v] layer\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(SX) > [0]> then\n            set [sx v] to [-16]\n        else\n            set [sx v] to [16]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Die\nset [collected v] to [0]\nset [exit v] to []\nswitch costume to (death v)\nrepeat (5)\n    change [ghost v] effect by (20)\n    change size by (10)\n    wait (0.05) seconds\nend\nset size to (100) %\nset [ghost v] effect to (0)\nhide\nswitch costume to (right v)\nwait (0.5) seconds\n\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\n\ndefine Death_Test\nif <touching (danger v)?> then\n    set [exit v] to [Die]\nend\n\ndefine Win\nrepeat (50)\n    point towards (portal v)\n    turn right (65) degrees\n    move ((distance to [portal v]) / (2)) steps\n    change size by (-1)\n    change [ghost v] effect by (2)\nend\nhide\nwait (1) seconds\npoint in direction (90)\nset [exit v] to []\n\nwhen I receive [ouch v]\nset [exit v] to [Die]\n\nwhen I receive [start v]\nshow\nbroadcast (Green Flag v) and wait\nbroadcast (Play Game v) and wait\n\nwhen [space v] key pressed\n\nwhen I receive [tick v]\n\nwhen I receive [tick v]\n\nwhen I receive [ouch v]\nset [exit v] to [Die]\n\nwhen flag clicked\nset [level v] to [1]\n\nif <(Exit) = [WIn]> then\n\nwhen I receive [game on v]\nbroadcast (Start v)\n\nwhen flag clicked\nhide\n\nwhen I receive [next_costume v]\nchange [color v] effect by (2.5)\n\nwhen I receive [previous_costume v]\nchange [color v] effect by (-2.5)\n\nwhen I receive [beginning v]\nset size to (100) %\npoint in direction (90)\nshow\ngo to x: (0) y: (-31)\nswitch costume to (up v)\n\nwhen I receive [bounce v]\nswitch costume to (up v)\nset [sy v] to [27.5]\n\nwhen I receive [about v]\nhide\n\nforever\n\nwhen I receive [start v]\nforever\n    if <touching (trampoline v)?> then\n        play sound [Boing v] until done\n    end\nend\n\nwhen I receive [end v]\nshow\ngo to x: (-110) y: (-130)\nset size to (180) %\nswitch costume to (right v)\nforever\n    go to [front v] layer\n    show\n    stop [all v]\nend\n\n@Platforms\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level 1 1 v)\n    Create Clone At X: [360] Y: [0]\n    switch costume to (level 1 2 v)\n    Create Clone At X: [360] Y: [0]\n    switch costume to (level 1 3 v)\n    Create Clone At X: [360] Y: [0]\n    switch costume to (level 1 4 v)\n    Create Clone At X: [360] Y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Create Clone At X: [360] Y: [0]\n        switch costume to (level 2 2 v)\n        Create Clone At X: [360] Y: [0]\n        switch costume to (level 2 3 v)\n    else\n        if <(Level) = [3]> then\n            switch costume to (level 3 1 v)\n            Create Clone At X: [360] Y: [0]\n            switch costume to (level 3 2 v)\n            Create Clone At X: [360] Y: [0]\n            switch costume to (level 3 3 v)\n            Create Clone At X: [360] Y: [0]\n            switch costume to (level 3 4 v)\n            Create Clone At X: [360] Y: [0]\n        else\n            if <(Level) = [4]> then\n                switch costume to (level 4 1 v)\n                Create Clone At X: [360] Y: [0]\n                switch costume to (level 4 2 v)\n                Create Clone At X: [360] Y: [0]\n                switch costume to (level 4 3 v)\n                Create Clone At X: [360] Y: [0]\n                switch costume to (level 4 4 v)\n                Create Clone At X: [360] Y: [0]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 5 2 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 5 3 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 5 4 v)\n                    Create Clone At X: [360] Y: [0]\n                else\n                    switch costume to (level 6 1 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 2 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 3 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 4 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 5 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 6 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 7 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 8 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 9 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 6 10 v)\n                    Create Clone At X: [360] Y: [0]\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\n@Collectables\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <<touching (player v)?> and <(Level) < [7]>> then\n    change [collected v] by (1)\n    if <(Collected) = (Collected_Max)> then\n        broadcast (Open Portal v)\n    end\n    delete this clone\nend\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (coin v)\n    set [collected v] to [0]\n    Create Clone At X: [178] Y: [63]\n    Create Clone At X: [303] Y: [143]\n    Create Clone At X: [725] Y: [-82.5]\n    Create Clone At X: [1131] Y: [150]\nelse\n    if <(Level) = [2]> then\n        set [collected v] to [0]\n        Create Clone At X: [269] Y: [188]\n        Create Clone At X: [639] Y: [5]\n        Create Clone At X: [775] Y: [78]\n        Create Clone At X: [906] Y: [148]\n    else\n        if <(Level) = [3]> then\n            set [collected v] to [0]\n            Create Clone At X: [298] Y: [-84]\n            Create Clone At X: [775] Y: [-84]\n            Create Clone At X: [1140] Y: [-84]\n            Create Clone At X: [1501] Y: [-84]\n        else\n            if <(Level) = [4]> then\n                set [collected v] to [0]\n                Create Clone At X: [298] Y: [-84]\n                Create Clone At X: [545] Y: [-84]\n                Create Clone At X: [798] Y: [32.5]\n                Create Clone At X: [1131] Y: [-84]\n                Create Clone At X: [1615] Y: [-84]\n            else\n                if <(Level) = [5]> then\n                    set [collected v] to [0]\n                    Create Clone At X: [219] Y: [-84]\n                    Create Clone At X: [349] Y: [-84]\n                    Create Clone At X: [477] Y: [-84]\n                    Create Clone At X: [612] Y: [-84]\n                    Create Clone At X: [840] Y: [-84]\n                    Create Clone At X: [1105] Y: [-84]\n                else\n                    set [collected v] to [0]\n                    Create Clone At X: [435] Y: [-84]\n                    Create Clone At X: [700] Y: [-84]\n                    Create Clone At X: [1045] Y: [-84]\n                    Create Clone At X: [1917] Y: [-84]\n                    Create Clone At X: [2168] Y: [-3]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\nwhen I start as a clone\nforever\n    next costume\n    wait (0.1) seconds\nend\n\ndefine Collected_Max (amount)\nset [collected_max v] to (amount)\n\nwhen I receive [tick v]\nif <(Level) = [1]> then\n    Collected_Max [4]\nend\nif <(Level) = [2]> then\n    Collected_Max [4]\nend\nif <(Level) = [3]> then\n    Collected_Max [4]\nend\nif <(Level) = [4]> then\n    Collected_Max [5]\nend\nif <(Level) = [5]> then\n    Collected_Max [6]\nend\nif <(Level) = [6]> then\n    Collected_Max [6]\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [boss v]\n\nrepeat (30)\n    wait (0.5) seconds\n    Create Clone At X: (pick random (2700) to (3173)) Y: (pick random (-84) to (210))\n    set [active_coin? v] to [1]\n    wait until <(Active_Coin?) = [0]>\n    delete this clone\nend\n\nwhen I receive [boss v]\ndelete this clone\n\n@Trampoline\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Bounce v)\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [993] Y: [-89]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [267] Y: [-89]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [100000000000] Y: [100000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [795] Y: [-89]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    Create Clone At X: [2893] Y: [-89]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\ndefine Player_Test\nif <touching (player v)?> then\n    switch costume to (trampoline_in v)\nelse\n    switch costume to (trampoline_dormant v)\nend\n\nwhen I start as a clone\nforever\n    Player_Test\nend\n\n@Water\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Ouch v)\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [724] Y: [41]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [85] Y: [41]\n        Create Clone At X: [450] Y: [41]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [1000000000000000000] Y: [1000000000000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [1128] Y: [41]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [1525] Y: [41]\n                else\n                    Create Clone At X: [1000000000000000000] Y: [1000000000000000000]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nbroadcast (Swish v)\n\nwhen I receive [green flag v]\nhide\n\nswitch costume to (dot v)\nCreate Clone At X: [148] Y: [45]\nswitch costume to (apple v)\nCreate Clone At X: [411] Y: [-87]\n\nwhen I receive [swish v]\nif <(Level) = [1]> then\n    forever\n        switch costume to (none v)\n        wait (pick random (5) to (9)) seconds\n        switch costume to (rush1 v)\n        wait (0.1) seconds\n        switch costume to (rush2 v)\n        wait (0.1) seconds\n        repeat (16)\n            Finalisation [0.1]\n        end\n        wait (0.1) seconds\n        switch costume to (rush2 v)\n        wait (0.1) seconds\n        switch costume to (rush1 v)\n        wait (0.1) seconds\n    end\nend\n\ndefine Finalisation (wait)\nswitch costume to (final 1 v)\nwait (wait) seconds\nswitch costume to (final 2 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [swish v]\nif <(Level) > [1]> then\n    forever\n        switch costume to (none v)\n        wait (pick random (2) to (5)) seconds\n        switch costume to (rush1 v)\n        wait (0.1) seconds\n        switch costume to (rush2 v)\n        wait (0.1) seconds\n        repeat (16)\n            Finalisation [0.1]\n        end\n        wait (0.1) seconds\n        switch costume to (rush2 v)\n        wait (0.1) seconds\n        switch costume to (rush1 v)\n        wait (0.1) seconds\n    end\nend\n\n@Danger\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    switch costume to (level 1 1 v)\n    Create Clone At X: [360] Y: [0]\n    switch costume to (level 1 2 v)\n    Create Clone At X: [360] Y: [0]\n    switch costume to (level 1 3 v)\n    Create Clone At X: [360] Y: [0]\n    switch costume to (level 1 4 v)\n    Create Clone At X: [360] Y: [0]\nelse\n    if <(Level) = [2]> then\n        switch costume to (level 2 1 v)\n        Create Clone At X: [360] Y: [0]\n        switch costume to (level 2 2 v)\n        Create Clone At X: [360] Y: [0]\n        switch costume to (level 2 3 v)\n        Create Clone At X: [360] Y: [0]\n    else\n        if <(Level) = [3]> then\n            switch costume to (level 1 1 v)\n            Create Clone At X: [1000000000000] Y: [1000000000000]\n        else\n            if <(Level) = [4]> then\n                switch costume to (level 1 1 v)\n                Create Clone At X: [1000000000000] Y: [1000000000000]\n            else\n                if <(Level) = [5]> then\n                    switch costume to (level 5 1 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 5 2 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 5 3 v)\n                    Create Clone At X: [360] Y: [0]\n                    switch costume to (level 5 4 v)\n                    Create Clone At X: [360] Y: [0]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\ncreate clone of (_myself_ v)\nchange [x v] by (x)\nchange [y v] by (y)\n\nwhen I receive [green flag v]\nhide\n\nCreate Clone At X: [360] Y: [0]\n\nwhen flag clicked\nhide\n\n@Trail\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I start as a clone\nset size to (90) %\nshow\ngo to (player v)\nset [x v] to ([x v] of [player v])\nset [y v] to ([y v] of [player v])\ngo to [front v] layer\ngo [backward v] (1) layers\nrepeat (7)\n    Position ((X) - (ScrollX)) ((Y) - (ScrollY))\n    change size by (-2)\n    change [ghost v] effect by (6)\nend\ndelete this clone\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [next_costume v]\nchange [color v] effect by (2.5)\n\nwhen I receive [previous_costume v]\nchange [color v] effect by (-2.5)\n\nwhen I start as a clone\nforever\n    show\nend\n\n@Portal\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <<(costume [number v]) = [2]> and <touching (player v)?>> then\n    set [exit v] to [Win]\nend\n\nwhen I receive [setup v]\nswitch costume to (closed portal v)\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [1590] Y: [-41]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [1175] Y: [275]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [1800] Y: [-41]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [1800] Y: [-41]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [1800] Y: [-41]\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [open portal v]\nswitch costume to (open portal v)\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\n\nwhen flag clicked\nforever\n    if <(Level) = [6]> then\n        switch costume to (nope v)\n        hide\n    end\nend\n\n@Start\n\ndefine Animate (direction)\npoint in direction ((([sin v] of ((timer) * (250)) ) * (5)) + (direction))\n\nwhen flag clicked\nhide\n\nwhen I receive [beginning v]\ngo to [front v] layer\nshow\ngo to x: (-110) y: (-120)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <mouse down?> then\n            broadcast (Game On v)\n            hide\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    Animate [90]\nend\n\nwhen I receive [about v]\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\n@About\n\nwhen I receive [about v]\nhide\n\ndefine Animate (direction)\npoint in direction ((([sin v] of ((timer) * (250)) ) * (5)) + (direction))\n\nwhen flag clicked\nhide\n\nwhen I receive [game on v]\nhide\n\nwhen I receive [beginning v]\ngo to [front v] layer\nshow\ngo to x: (110) y: (-120)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <mouse down?> then\n            broadcast (About v)\n            hide\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    Animate [90]\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\n@Level\n\ndefine Place (value) At X: (x) Y: (y)\nerase all\ngo to x: (x) y: (y)\nset [letter v] to [0]\nrepeat (length of (value))\n    change [letter v] by (1)\n    switch costume to (letter (Letter) of (value))\n    repeat (2)\n        stamp\n    end\n    change x by (10)\nend\n\nwhen I receive [level up v]\nerase all\n\nwhen flag clicked\nerase all\n\nwhen I receive [start v]\nforever\n    Place (Level) At X: [190] Y: [163]\n    hide\nend\n\n@Game Button\n\ndefine Animate (direction)\npoint in direction ((([sin v] of ((timer) * (250)) ) * (5)) + (direction))\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\ngo to x: (-142) y: (159)\ncreate clone of (_myself_ v)\ngo to x: (-182) y: (159)\ncreate clone of (_myself_ v)\ngo to x: (-220) y: (159)\n\nwhen I start as a clone\nshow\nforever\n    if <(x position) = [-142]> then\n        switch costume to (costume1 v)\n        if <touching (mouse-pointer v)?> then\n            set [ghost v] effect to (50)\n            if <mouse down?> then\n                set [exit v] to [Die]\n                wait until <not <mouse down?>>\n            end\n        else\n            set [ghost v] effect to (0)\n        end\n        Animate [90]\n    end\n    if <(x position) = [-182]> then\n        switch costume to (costume2 v)\n        if <touching (mouse-pointer v)?> then\n            set [ghost v] effect to (50)\n            if <mouse down?> then\n                set [exit v] to [Win]\n                wait until <not <mouse down?>>\n            end\n        else\n            set [ghost v] effect to (0)\n        end\n        Animate [90]\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nset volume to (100) %\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen I receive [beginning v]\nforever\n    Animate [90]\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [beginning v]\nforever\n    if <touching (mouse-pointer v)?> then\n        if <<mouse down?> and <(costume [number v]) = [3]>> then\n            switch costume to (costume4 v)\n            set volume to (0) %\n            wait until <not <mouse down?>>\n        end\n        if <<mouse down?> and <(costume [number v]) = [4]>> then\n            switch costume to (costume3 v)\n            set volume to (100) %\n            wait until <not <mouse down?>>\n        end\n    end\nend\n\nwhen I receive [beginning v]\nshow\ngo to x: (-220) y: (159)\nswitch costume to (costume3 v)\nforever\n    play sound [Patakas World v] until done\nend\n\nwhen I receive [end v]\nhide\n\nwhen [b v] key pressed\nbroadcast (Win!!! v)\n\n@Right\n\nwhen I receive [about v]\nhide\n\ndefine Animate (direction)\npoint in direction ((([cos v] of ((timer) * (250)) ) * (5)) + (direction))\n\nwhen flag clicked\nhide\n\nwhen I receive [game on v]\nhide\n\nwhen I receive [beginning v]\ngo to [front v] layer\nshow\ngo to x: (46) y: (-25)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        set size to (125) %\n        if <mouse down?> then\n            broadcast (Next_Costume v)\n        end\n    else\n        set [ghost v] effect to (0)\n        set size to (100) %\n    end\n    Animate [90]\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\nset [ghost v] effect to (50)\n\n@Left\n\nwhen I receive [about v]\nhide\n\ndefine Animate (direction)\npoint in direction ((([cos v] of ((timer) * (250)) ) * (5)) + (direction))\n\nwhen flag clicked\nhide\n\nwhen I receive [game on v]\nhide\n\nwhen I receive [beginning v]\ngo to [front v] layer\nshow\ngo to x: (-74) y: (-25)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        set size to (125) %\n        if <mouse down?> then\n            broadcast (Previous_Costume v)\n        end\n    else\n        set [ghost v] effect to (0)\n        set size to (100) %\n    end\n    Animate [90]\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\n@Heading\n\ndefine Direct (place)\nif <not <(direction) = (place)>> then\n    point in direction (place)\nend\n\nwhen I receive [about v]\nhide\n\ndefine Animate\nDirect ((90) + (([sin v] of ((timer) * (200)) ) * (2)))\nset size to ((80) + (([sin v] of ((timer) * (100)) ) * (5))) %\n\nwhen flag clicked\nhide\n\nwhen I receive [game on v]\nhide\n\nwhen I receive [beginning v]\nset size to (90) %\ngo to [front v] layer\nshow\ngo to x: (0) y: (80)\nforever\n    Animate\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\n@Crushers\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Ouch v)\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [300] Y: [3]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [300] Y: [3]\n                Create Clone At X: [800] Y: [3]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [1100] Y: [3]\n                else\n                    Create Clone At X: [1048] Y: [3]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nbroadcast (Crush v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [crush v]\nforever\n    point in direction (90)\n    if <(Level) = [3]> then\n        switch costume to (crusher_dormant v)\n        wait (pick random (5) to (9)) seconds\n        switch costume to (crusher_1 v)\n        wait (0.1) seconds\n        repeat (4)\n            next costume\n            wait (0.1) seconds\n        end\n        switch costume to (crusher_final v)\n        wait (0.5) seconds\n        switch costume to (crusher_5 v)\n        wait (0.1) seconds\n        switch costume to (crusher_4 v)\n        wait (0.1) seconds\n        switch costume to (crusher_5 v)\n        wait (0.1) seconds\n        switch costume to (crusher_final v)\n        wait (0.5) seconds\n        switch costume to (crusher_5 v)\n        wait (0.1) seconds\n        switch costume to (crusher_4 v)\n        wait (0.1) seconds\n        switch costume to (crusher_3 v)\n        wait (0.1) seconds\n        switch costume to (crusher_2 v)\n        wait (0.1) seconds\n        switch costume to (crusher_1 v)\n        wait (0.1) seconds\n    end\n    if <(Level) > [3]> then\n        wait (pick random (4) to (7)) seconds\n        switch costume to (crusher_1 v)\n        wait (0.1) seconds\n        repeat (4)\n            next costume\n            wait (0.1) seconds\n        end\n        switch costume to (crusher_final v)\n        wait (0.1) seconds\n        switch costume to (crusher_5 v)\n        wait (0.1) seconds\n        switch costume to (crusher_4 v)\n        wait (0.1) seconds\n        switch costume to (crusher_5 v)\n        wait (0.1) seconds\n        switch costume to (crusher_final v)\n        wait (0.1) seconds\n        switch costume to (crusher_5 v)\n        wait (0.1) seconds\n        switch costume to (crusher_4 v)\n        wait (0.1) seconds\n        switch costume to (crusher_3 v)\n        wait (0.1) seconds\n        switch costume to (crusher_2 v)\n        wait (0.1) seconds\n        switch costume to (crusher_1 v)\n        wait (0.1) seconds\n    end\nend\n\n@Enemy\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Ouch v)\nend\n\nwhen I receive [setup v]\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [625] Y: [-81]\n            Create Clone At X: [993] Y: [-81]\n            Create Clone At X: [1351] Y: [-81]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [1488] Y: [-81]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nbroadcast (Enemy_Movement v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [enemy_movement v]\nforever\n    if <(Level) < [4]> then\n        switch costume to (right2 v)\n        repeat (pick random (9) to (10))\n            change [x v] by (pick random (9) to (10))\n        end\n        wait (pick random (0.5) to (2)) seconds\n        switch costume to (left v)\n        repeat (pick random (9) to (10))\n            change [x v] by (pick random (-9) to (-10))\n        end\n        wait (pick random (0.5) to (2)) seconds\n    end\n    if <(Level) = [4]> then\n        switch costume to (right2 v)\n        repeat (pick random (9) to (10))\n            change [x v] by (pick random (9) to (10))\n        end\n        wait (pick random (0.5) to (1.5)) seconds\n        switch costume to (left v)\n        repeat (pick random (9) to (10))\n            change [x v] by (pick random (-9) to (-10))\n        end\n        wait (pick random (0.5) to (2)) seconds\n    end\nend\n\n@Back\n\nwhen I receive [about v]\nshow\n\ndefine Animate (direction)\npoint in direction ((([sin v] of ((timer) * (250)) ) * (5)) + (direction))\n\nwhen I receive [game on v]\nhide\n\nwhen I receive [beginning v]\ngo to [front v] layer\ngo to x: (-172) y: (-140)\nhide\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <mouse down?> then\n            wait (1) seconds\n            broadcast (Beginning v)\n            switch backdrop to (backdrop4 v)\n            hide\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    Animate [90]\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\n\nwhen I receive [about v]\nshow\n\nwhen flag clicked\nhide\n\nwhen I receive [tick v]\nswitch backdrop to (backdrop4 v)\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nbroadcast (Scene v)\ngo to [back v] layer\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@Love and Fav Detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Enemy_Cutscene\n\ndefine Say (input)\nset [talk v] to []\nset [count v] to [1]\nrepeat (length of (input))\n    set [talk v] to (join (talk) (letter (count) of (input)))\n    say (talk)\n    wait (0.01) seconds\n    change [count v] by (1)\nend\nwait (2) seconds\nsay []\n\nwhen flag clicked\ngo to x: (125) y: (-94)\nhide\n\nwhen I receive [scene v]\ngo to [front v] layer\ngo [backward v] (2) layers\nshow\n\nwhen I receive [enemy_talk-01 v]\nSay [You Will Never Escape!!!]\nset [click_for_next v] to [1]\nwait until <mouse down?>\nset [click_for_next v] to [0]\nbroadcast (Escape v)\nhide\n\nwhen I receive [beginning v]\ngo to [back v] layer\n\nwhen I receive [beginning v]\nhide\n\nwhen I receive [beginning v]\nhide\nstop [other scripts in sprite v]\n\n@Cutscene\n\nwhen flag clicked\nhide\nforever\n    go to x: (-5) y: (2)\nend\n\nwhen I receive [scene v]\nAnimate\n\nwhen I receive [beginning v]\nhide\nforever\n    set [click_for_next v] to [0]\nend\n\nwhen I receive [beginning v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [escape v]\nswitch costume to (costume21 v)\nrepeat (1)\n    next costume\nend\nset [click_for_next v] to [1]\nwait until <mouse down?>\nset [click_for_next v] to [0]\nwait (0.5) seconds\nset [click_for_next v] to [1]\nwait until <mouse down?>\nset [click_for_next v] to [0]\nwait (0.5) seconds\nswitch costume to (costume2 v)\nset [click_for_next v] to [1]\nwait until <mouse down?>\nset [click_for_next v] to [0]\nwait (0.5) seconds\nbroadcast (Beginning v)\n\ndefine Animate\nswitch costume to (fade v)\ncreate clone of (_myself_ v)\nset [click_for_next v] to [0]\nset size to (150) %\nswitch costume to (costume14 v)\nshow\ngo to x: (-5) y: (2)\nrepeat (15)\n    change size by (-1.5)\nend\nwait (0.5) seconds\nbroadcast (Text_01 v)\nset [click_for_next v] to [1]\nwait until <mouse down?>\nset [click_for_next v] to [0]\nswitch costume to (costume20 v)\nwait (0.5) seconds\nset [click_for_next v] to [1]\nwait until <mouse down?>\nset [click_for_next v] to [0]\nwait (0.1) seconds\nbroadcast (Enemy_Talk-01 v)\n\ngo [backward v] (1) layers\n\n@Click_For_Next\n\nwhen flag clicked\nset [click_for_next v] to [0]\npoint in direction (90)\ngo to [front v] layer\n\nwhen I receive [beginning v]\nset [click_for_next v] to [0]\ngo to [back v] layer\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    if <(Click_For_Next) > [0]> then\n        show\n    else\n        hide\n    end\n    go to x: (123) y: (-165)\nend\n\nwhen I receive [beginning v]\nhide\nstop [other scripts in sprite v]\n\n@Click_Here_To_Skip\n\nwhen flag clicked\nhide\nforever\n    go to x: (-150) y: (-161)\n    go to [front v] layer\nend\n\nwhen I receive [scene v]\ngo to [front v] layer\nshow\n\nwhen this sprite clicked\nwait (0.5) seconds\nbroadcast (Beginning v)\nhide\n\nwhen I receive [beginning v]\nhide\nstop [other scripts in sprite v]\n\n@Spinner\n\nwhen I receive [tick v]\nturn right (15) degrees\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Ouch v)\nend\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [100000000000] Y: [100000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [100000000000] Y: [100000000000]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    Create Clone At X: [300] Y: [-115]\n                    Create Clone At X: [575] Y: [-115]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nbroadcast (Spin v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nforever\nend\n\ngo [forward v] (1) layers\n\nwhen I receive [tick v]\ngo to [back v] layer\n\n@Faded_Edges\n\nwhen flag clicked\nhide\nforever\n    go to x: (-5) y: (2)\nend\n\nwhen I receive [beginning v]\nhide\nforever\n    set [click_for_next v] to [0]\nend\n\nwhen I receive [beginning v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [scene v]\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nforever\n    if <([costume # v] of [cutscene v]) = [6]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nhide\n\n@Text\n\nwhen flag clicked\nhide\nforever\n    go to x: (-5) y: (2)\nend\n\nwhen I receive [scene v]\ngo to [front v] layer\nshow\n\nwhen I receive [beginning v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [scene v]\ngo to [front v] layer\nforever\n    if <([costume # v] of [cutscene v]) = [2]> then\n        switch costume to (costume1 v)\n        show\n    else\n        if <([costume # v] of [cutscene v]) = [3]> then\n            switch costume to (costume2 v)\n            show\n        else\n            if <([costume # v] of [cutscene v]) = [5]> then\n                switch costume to (costume3 v)\n                show\n            else\n                switch costume to (costume4 v)\n                hide\n            end\n        end\n    end\nend\n\n@Spinner_Moving\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Ouch v)\nend\n\nturn right (15) degrees\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [100000000000] Y: [100000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [100000000000] Y: [100000000000]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    Create Clone At X: [1500] Y: [-115]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\nbroadcast (Spin & Move v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\ngo [forward v] (1) layers\n\nwhen I receive [tick v]\ngo to [back v] layer\n\nwhen I receive [spin & move v]\nforever\n    turn right (15) degrees\nend\n\nwhen I receive [spin & move v]\nforever\n    repeat (30)\n        change [x v] by (10)\n    end\n    wait (1) seconds\n    repeat (30)\n        change [x v] by (-10)\n    end\n    wait (1) seconds\nend\n\n@Start_Boss_Fight\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\n\nwhen I receive [setup v]\npoint in direction (90)\nhide\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [100000000000] Y: [100000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [100000000000] Y: [100000000000]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    Create Clone At X: [2501] Y: [-90]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nset [atomic bombs! v] to [0]\nforever\n    if <touching (player v)?> then\n        broadcast (Boss v)\n        set [boss v] to [1]\n        change [collected v] by (1)\n        delete this clone\n    end\nend\n\n@Boss\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <<touching (player v)?> and <(costume [number v]) < [2]>> then\n    broadcast (Ouch v)\nend\n\nwhen I receive [setup v]\nswitch costume to (angry v)\nhide\nset [boss_health v] to [30]\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [100000000000] Y: [100000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [100000000000] Y: [100000000000]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    set [boss_health v] to [30]\n                    Create Clone At X: [3278] Y: [-37]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset size to (100) %\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nswitch costume to (angry v)\nforever\n    if <(Boss_Health) = [0]> then\n        broadcast (Win!!! v)\n    end\nend\n\nwhen I receive [win!!! v]\nset [stop v] to [1]\nswitch costume to (epic_death v)\nrepeat (15)\n    change [ghost v] effect by (5)\n    change size by (10)\n    wait (0.5) seconds\nend\nbroadcast (End v)\n\nwhen flag clicked\nset [stop v] to [0]\n\n@Stop\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    if <(Level) > [6]> then\n        go to [front v] layer\n        show\n    else\n        hide\n    end\nend\n\n@End\n\nwhen flag clicked\nhide\nforever\n    go to x: (0) y: (0)\nend\n\nwhen I receive [end v]\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\n\n@Falling_Stars\n\nwhen I receive [tick v]\nPosition ((X) - (ScrollX)) ((Y) - (ScrollY))\nif <touching (player v)?> then\n    broadcast (Ouch v)\nend\n\nwhen I receive [setup v]\nswitch costume to (spikes v)\nhide\nset [boss_health v] to [30]\nset [collected v] to [0]\nset [collected_max v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nif <(Level) = [1]> then\n    Create Clone At X: [100000000000] Y: [100000000000]\nelse\n    if <(Level) = [2]> then\n        Create Clone At X: [100000000000] Y: [100000000000]\n    else\n        if <(Level) = [3]> then\n            Create Clone At X: [100000000000] Y: [100000000000]\n        else\n            if <(Level) = [4]> then\n                Create Clone At X: [100000000000] Y: [100000000000]\n            else\n                if <(Level) = [5]> then\n                    Create Clone At X: [100000000000] Y: [100000000000]\n                else\n                    Create Clone At X: [3278] Y: [-37]\n                end\n            end\n        end\n    end\nend\nset [x v] to [-99999]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Create Clone At X: (x) Y: (y)\nset size to (100) %\nset [x v] to (x)\nset [y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nhide\n\nwhen I receive [win!!! v]\nstop [other scripts in sprite v]\n\nwhen I receive [boss v]\n\nwhen I receive [win!!! v]\nstop [other scripts in sprite v]\n\nwhen I receive [falling spikes v]\nforever\n    set size to (90) %\n    set [ghost v] effect to (0)\n    show\n    set [x v] to (pick random (2700) to (3173))\n    set [y v] to [537]\n    repeat until <<touching (platforms v)?> or <touching (player v)?>>\n        turn right (15) degrees\n        change [y v] by (-15)\n        if <touching (platforms v)?> then\n            repeat until <not <touching (platforms v)?>>\n                change [y v] by (1)\n            end\n        end\n        if <touching (platforms v)?> then\n            change [boss_health v] by (-1)\n            wait (0.1) seconds\n            repeat (4)\n                change [ghost v] effect by (25)\n            end\n            broadcast (Falling Spikes v)\n        end\n        if <touching (player v)?> then\n            broadcast (Ouch v)\n        end\n    end\nend\n\nwhen I receive [falling spikes v]\nforever\n    show\nend\n\nwhen I start as a clone\nforever\n    show\nend\n\nwhen I receive [boss v]\nbroadcast (Falling Spikes v)\n\n@Corner\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\ngo to x: (196) y: (-134)\nwait (3) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\ngo to [back v] layer\nstop [other scripts in sprite v]\n\n