Scratch platformer beta 0.3b

Instructions: ★★★Mello 2 - A Platformer★★★\n\nHow I made this game: youtu.be/Gcd0RhOoWug\n\n★★★ Instructions ★★★\n========================================\n• Click {NEW GAME} or select a level to begin.\n========================================\n• [Arrow Keys] [WASD] or joystick (on mobile) to move.\n• Avoid Spikes, Blades, and other obstacles.\n• Bounce on trampolines\n• Collect all of the keys in a level to open locked doors!\n• Chickens can be bounced on like trampolines, but also deadly like spikes.\n• Touch the Flag to advance to the next level.\n\n★★★ Gameplay tips ★★★\n• You must collect every key in the level before the doors are unlocked.\n• Chickens can be used as a jump boost.\n• For more challenging levels, evaluate the scene and plan a course of action before moving.\n• Take it slow, and remember to stop and think.  Look before you leap, as they say.\n\n★★★ Credits ★★★\n• Beta testers: @barbie57, @purple-sparkle, @groovy-girl and @Butterfly-1.  This game would not be what it is without them (go follow them please)\n• Concept and all coding created by me, Chip.\n• Scratch asset library and freesound.com for sound effects.\n• Fontmeme.com for the text fonts used in the main menu and thumbnail.\n• @AlexanderH5 for suggesting the implementation of left-handed mobile controls.\n\n• Music credits in order of appearance:\n• 'Rollanddrop' - by Jingle Punks\n• 'Synthwave 80s' - by Alexi Action\n• 'Evolution' and 'Nemophore' - by Creo\n• 'Night Terror' - by Omni Slim\n• 'Wild Boar's Inn' - by Brandon Fiechter's Music\n\n★★★ Updates and News ★★★\nv1.0 - Initially shared with 50 levels on September 9th 2023 at 4:00 PM.  Top loved within a few hours!\n\n• Subscribe to me on YouTube\nyoutube.com/@chipm0nk

@Stage\n\nwhen flag clicked\nforever\n    if <<([costume # v] of [level v]) > [40]> and <not <([costume # v] of [level v]) = [65]>>> then\n        if <([costume # v] of [level v]) = [64]> then\n            switch backdrop to (paper3 v)\n        else\n            switch backdrop to (paper2 v)\n        end\n    else\n        switch backdrop to (paper v)\n    end\nend\n\n@player\n\ndefine start (start) end (end)\nadd (start) to [start v]\nadd (end) to [end v]\n\nwhen [r v] key pressed\nset size to (100) %\nclear graphic effects\nshow\nstart sound [restart v]\ngo to x: (-215) y: (item ([costume # v] of [level v]) of [start v])\nbroadcast (level start v)\nerase all\n\ndefine gravity\nswitch costume to (hitbox v)\nif <<([costume # v] of [level v]) > [43]> and <(inkless) = [false]>> then\n    if <(move right?) = [true]> then\n        change [x v] by (0.6)\n        turn right (4) degrees\n    end\nelse\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [x v] by (1)\n        turn right (6) degrees\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [x v] by (-1)\n        turn left (6) degrees\n    end\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <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) * (-1))\n                        change y by (-5)\n                        if <key (up arrow v) pressed?> then\n                            set [x v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nchange [y v] by (-1)\nchange y by (y)\nif <touching color (#000000)?> then\n    change y by ((y) * (-1))\n    set [y v] to [0]\nend\nchange y by (-1)\nif <touching color (#000000)?> then\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        set [y v] to [12]\n        start sound [jump v]\n    end\nend\nchange y by (1)\nif <<([costume # v] of [level v]) > [43]> and <(inkless) = [false]>> then\n    switch costume to (join (costume) [a])\nelse\n    switch costume to (costume)\nend\n\nwhen I receive [level start v]\nif <<([costume # v] of [level v]) = [48]> or <([costume # v] of [level v]) = [49]>> then\n    set [move right? v] to [true]\n    wait (0.4) seconds\n    set [move right? v] to [false]\n    wait until <mouse down?>\n    wait until <not <mouse down?>>\n    set [move right? v] to [true]\nend\nif <([costume # v] of [level v]) = [50]> then\n    set [move right? v] to [true]\n    wait (0.4) seconds\n    set [move right? v] to [false]\n    wait until <([enemies v] of [pen v]) = [3]>\n    set [move right? v] to [true]\nend\nif <([costume # v] of [level v]) = [51]> then\n    set [move right? v] to [true]\n    wait (0.4) seconds\n    set [move right? v] to [false]\n    wait until <([scribble v] of [pen v]) > [220]>\n    repeat (10)\n        change size by (10)\n        change [ghost v] effect by (10)\n        change [brightness v] effect by (10)\n    end\n    go to x: (0) y: (-15)\n    broadcast (drain v)\n    repeat (10)\n        change size by (-10)\n        change [ghost v] effect by (-10)\n        change [brightness v] effect by (-10)\n    end\n    set size to (100) %\n    clear graphic effects\nend\nif <([costume # v] of [level v]) > [63]> then\n    go to x: (-215) y: (-50)\n    set [y v] to [0]\n    stop [other scripts in sprite v]\n    reset\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen I receive [game start v]\nreset timer\nset [inkless v] to [false]\nset [continue v] to [false]\nset [y v] to [-25]\ngo to x: (-215) y: (180)\nreset\n\nwhen I receive ["the platformer" v]\ngo to x: (-240) y: (-50)\nshow\nglide (0.1) secs to x: (-130) y: (-50)\nglide (0.5) secs to x: (110) y: (-50)\nglide (0.35) secs to x: (160) y: (-50)\nglide (0.35) secs to x: (165) y: (-50)\nwait (1) seconds\nstart sound [fall v]\nglide (0.1) secs to x: (165) y: (-115)\nglide (0.05) secs to x: (165) y: (-190)\nbroadcast (game start v)\n\ndefine make lists\ndelete (all) of [start v]\ndelete (all) of [end v]\nstart (0) end (10)\nstart (10) end (90)\nstart (90) end (-50)\nstart (-50) end (-50)\nstart (-130) end (25)\nstart (-130) end (-130)\nstart (-100) end (-100)\nstart (-100) end (80)\nstart (-130) end (-130)\nstart (75) end (75)\nstart (0) end (0)\nstart (0) end (120)\nstart (-76) end (-76)\nrepeat (3)\n    start (0) end (0)\nend\nstart (-120) end (-120)\nstart (-50) end (-50)\nstart (0) end (-50)\nstart (-40) end (-40)\nstart (-40) end (25)\nstart (-120) end (-120)\nstart (-50) end (-50)\nstart (-50) end (-50)\nstart (-50) end (-50)\nstart (-45) end (35)\nstart (-50) end (-50)\nstart (80) end (80)\nstart (-100) end (40)\nstart (-50) end (-50)\nstart (-140) end (50)\nstart (0) end (0)\nstart (0) end (50)\nstart (-50) end (-50)\nstart (-50) end (-50)\nstart (0) end (100)\nstart (-80) end (-80)\nstart (125) end (-115)\nstart (55) end (80)\nstart (-90) end (0)\nstart (90) end (0)\nstart (0) end (10)\nstart (10) end (90)\nstart (-20) end (-20)\nstart (-60) end (-60)\nstart (-60) end (100)\nstart (-10) end (-10)\nrepeat (7)\n    start (-60) end (-60)\nend\nstart (-60) end (100)\nrepeat (3)\n    start (-60) end (-60)\nend\nstart (-20) end (-20)\nstart (100) end (-60)\nstart (-90) end (-90)\nrepeat (2)\n    start (-80) end (-80)\nend\nstart (-50) end (-50)\nstart (-50) end (-50)\n\nwhen [p v] key pressed\nif <([mode v] of [paused v]) = []> then\n    if <(paused?) = [false]> then\n        set [paused? v] to [true]\n    else\n        set [paused? v] to [false]\n    end\n    wait until <not <key (p v) pressed?>>\nend\n\nwhen I receive [red v]\nrepeat (6)\n    show\n    wait (0.05) seconds\n    hide\n    wait (0.05) seconds\nend\nshow\nset [invincible? v] to [false]\n\nwhen I receive [eraser gone v]\nset [continue v] to [true]\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\n\ndefine reset\nset [x v] to [0]\nset [invincible? v] to [false]\nset [move right? v] to [true]\nforever\n    if <(paused?) = [false]> then\n        gravity\n        if <(x position) > [240]> then\n            if <not <<([costume # v] of [level v]) = [40]> or <<<([costume # v] of [level v]) = [64]> and <(continue) = [false]>> or <([costume # v] of [level v]) = [65]>>>> then\n                start sound [page v]\n                if <<([costume # v] of [level v]) = [57]> and <(y position) > [40]>> then\n                    broadcast (next level v) and wait\n                end\n                broadcast (next level v) and wait\n                set [y v] to [0]\n                go to x: (-215) y: (item ([costume # v] of [level v]) of [start v])\n            end\n        end\n        if <(y position) < [-175]> then\n            if <([costume # v] of [level v]) = [40]> then\n                start sound [page v]\n                broadcast (next level v) and wait\n                set [y v] to [0]\n                go to x: (0) y: (item ([costume # v] of [level v]) of [start v])\n            else\n                broadcast (level start v)\n                broadcast (red v)\n                start sound [hurt v]\n                set [y v] to [0]\n                go to x: (-215) y: (item ([costume # v] of [level v]) of [start v])\n            end\n        end\n        if <<<<touching color (#ff0000)?> or <<touching color (#e50000)?> or <touching color (#ff4b00)?>>> and <not <([costume # v] of [level v]) = [50]>>> and <(invincible?) = [false]>> then\n            wait (0.1) seconds\n            broadcast (red v)\n            start sound [hurt v]\n            set [invincible? v] to [true]\n            set [y v] to [0]\n            if <([costume # v] of [level v]) = [64]> then\n                go to x: (on ground x) y: (on ground y)\n            else\n                go to x: (-215) y: (item ([costume # v] of [level v]) of [start v])\n            end\n        end\n        if <<key (x v) pressed?> and <<([mode v] of [paused v]) = []> and <not <<<([costume # v] of [level v]) = [1]> or <([costume # v] of [level v]) = [41]>> or <<<[43] < ([costume # v] of [level v])> and <([costume # v] of [level v]) < [53]>> or <<([costume # v] of [level v]) = [59]> or <([costume # v] of [level v]) > [63]>>>>>>> then\n            start sound [page v]\n            broadcast (previous level v) and wait\n            set [y v] to [0]\n            go to x: (215) y: (item ([costume # v] of [level v]) of [end v])\n            wait until <not <key (x v) pressed?>>\n        end\n        if <<key (z v) pressed?> and <<<([mode v] of [paused v]) = []> and <[85] > ([ink v] of [percentage v])>> and <not <<([costume # v] of [level v]) = [40]> or <<([costume # v] of [level v]) = [51]> or <<([costume # v] of [level v]) = [58]> or <([costume # v] of [level v]) = [64]>>>>>>> then\n            start sound [page v]\n            broadcast (next level v) and wait\n            set [y v] to [0]\n            go to x: (-215) y: (item ([costume # v] of [level v]) of [start v])\n            broadcast (skip v)\n            set [skipped? v] to [true]\n            wait until <not <key (z v) pressed?>>\n        end\n        if <touching color (#000000)?> then\n            set [on ground x v] to (x position)\n            set [on ground y v] to (y position)\n        end\n    end\nend\n\nif <(x position) < [-240]> then\n    if <not <<<([costume # v] of [level v]) = [1]> or <([costume # v] of [level v]) = [41]>> or <<([costume # v] of [level v]) = [51]> or <<([costume # v] of [level v]) = [59]> or <([costume # v] of [level v]) = [64]>>>>> then\n        start sound [page v]\n        broadcast (previous level v) and wait\n        set [y v] to [0]\n        go to x: (215) y: (item ([costume # v] of [level v]) of [end v])\n    end\nend\n\nwhen I receive [game start v]\nmake lists\nset [costume v] to [1]\nforever\n    change [costume v] by (1)\n    if <(costume) = [5]> then\n        set [costume v] to [1]\n    end\n    wait (0.1) seconds\nend\n\nwhen [c v] key pressed\nif <([mode v] of [paused v]) = []> then\n    if <(paused?) = [help]> then\n        set [paused? v] to [false]\n    else\n        set [paused? v] to [help]\n    end\n    wait until <not <key (c v) pressed?>>\nend\n\nwhen I receive [drain v]\nrepeat until <key (r v) pressed?>\n    go to x: (0) y: (-15)\nend\nset [inkless v] to [true]\n\nwhen flag clicked\nhide\nswitch costume to (1 v)\nset [paused? v] to [false]\nset [skipped? v] to [false]\npoint in direction (90)\n\n@level\n\nwhen I receive [previous level v]\nvisited\nswitch costume to ((costume [number v]) - (1))\nstamp\n\nwhen I receive [next level v]\nquickly, to the next level\n\ndefine stamp\nclear graphic effects\nerase all\nstamp\nset [ghost v] effect to (99)\n\nwhen [r v] key pressed\nif <(opening) = [false]> then\n    stamp\nend\n\nwhen I receive [draw enemy v]\nstamp\n\nwhen I receive [stamp v]\nstamp\n\nwhen I receive [dust v]\nclear graphic effects\nshow\nerase all\nrepeat (3)\n    go to x: (pick random (-5) to (5)) y: (pick random (-5) to (5))\nend\nrepeat (2)\n    go to x: (pick random (-2) to (2)) y: (pick random (-2) to (2))\nend\ngo to x: (0) y: (0)\nstamp\nset [ghost v] effect to (99)\n\nwhen I receive [game start v]\nset [opening v] to [false]\ngo to x: (0) y: (0)\nswitch costume to (1 v)\ngo to [back v] layer\nshow\nstamp\nforever\n    play sound (music) until done\nend\n\nwhen flag clicked\nset [opening v] to [true]\nset [mute? v] to [false]\nset volume to (75) %\nswitch costume to (1 v)\nset [ghost v] effect to (99)\nhide\nforever\n    play [1] from [1] to [10]\n    play [2] from [11] to [14]\n    play [3] from [15] to [20]\n    play [4] from [21] to [24]\n    play [5] from [25] to [31]\n    play [6] from [32] to [37]\n    play [7] from [38] to [41]\n    play [8] from [42] to [51]\n    play [9] from [52] to [58]\n    play [10] from [59] to [63]\n    play [11] from [64] to [65]\n    play [12] from [65] to [66]\nend\n\ndefine play (#) from (level 1) to (level 2)\nif <<((level 1) - (1)) < (costume [number v])> and <(costume [number v]) < (level 2)>> then\n    stop all sounds\n    set [music v] to (#)\n    set [pitch v] effect to (0)\n    if <(mute?) = [true]> then\n        set volume to (0) %\n    else\n        set volume to (75) %\n    end\n    wait until <not <<((level 1) - (1)) < (costume [number v])> and <(costume [number v]) < (level 2)>>>\nend\n\nwhen I receive [red v]\nif <not <(costume [name v]) = [58]>> then\n    switch costume to ((item (length of [levels visited v]) of [levels visited v]) + (1))\n    stamp\nend\n\ndefine visited\nif <not <[levels visited v] contains (costume [number v])?>> then\n    add (costume [number v]) to [levels visited v]\nend\nbroadcast (level start v)\n\ndefine quickly, to the next level\nvisited\nnext costume\nstamp\nbroadcast (make ink appear v)\n\nwhen I receive [erase v]\nshow\nrepeat (50)\n    clear graphic effects\nend\nset [ghost v] effect to (99)\n\nwhen I receive [eraser gone v]\nrepeat (75)\n    change volume by (-1)\nend\n\nwhen I receive [level start v]\nif <(costume [number v]) = [63]> then\n    repeat (38)\n        change volume by (-2)\n    end\nend\nif <(costume [number v]) = [41]> then\n    repeat (38)\n        change volume by (-2)\n        change [pitch v] effect by (-1.5)\n    end\nend\n\nwhen [m v] key pressed\nif <(mute?) = [true]> then\n    set [mute? v] to [false]\n    set volume to (75) %\nelse\n    set [mute? v] to [true]\n    set volume to (0) %\nend\n\n@ink bar\n\nwhen flag clicked\nhide\n\nwhen I receive [game start v]\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nforever\n    switch costume to ([color v] of [pen v])\nend\n\n@ink bar black\n\nwhen flag clicked\nhide\n\nwhen I receive [game start v]\ngo to x: (-463) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-0.5)\nend\nforever\n    set x to (((-311) + ((3.11) * (([costume # v] of [percentage v]) + (4)))) * (1.6))\n    if <(x position) > [10]> then\n        set x to (10)\n    end\nend\n\n@red\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [game start v]\nforever\n    if <<([costume # v] of [percentage v]) > [80]> and <([costume # v] of [percentage v]) < [100]>> then\n        set [ghost v] effect to (100)\n        show\n        repeat (8)\n            change [ghost v] effect by (-2)\n        end\n        repeat (8)\n            change [ghost v] effect by (2)\n        end\n    end\nend\n\n@percentage\n\nwhen flag clicked\nset [drawing? v] to [false]\nset [ink v] to [0]\ngo to x: (-15) y: (0)\nswitch costume to (0 v)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [ink bubble v]\nset [replenishing v] to [true]\nrepeat (15)\n    if <not <(costume [number v]) = [1]>> then\n        change [ink v] by (-1)\n    end\nend\nset [replenishing v] to [false]\n\nwhen I receive [big bubble v]\nset [replenishing v] to [true]\nrepeat until <(costume [number v]) = [1]>\n    change [ink v] by (-1)\nend\nset [replenishing v] to [false]\n\nwhen [r v] key pressed\nwait (0.1) seconds\nset [replenishing v] to [true]\nif <<<(costume [number v]) = [101]> and <<([inkless v] of [player v]) = [false]> or <([costume # v] of [level v]) > [59]>>> and <not <([costume # v] of [level v]) = [64]>>> then\n    repeat (25)\n        change [ink v] by (-1)\n    end\nend\nset [replenishing v] to [false]\n\nwhen I receive [red v]\nrepeat (4)\n    if <<(costume [number v]) < [101]> and <([mode v] of [paused v]) = []>> then\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [skip v]\nwait until <(replenishing) = [false]>\nrepeat (15)\n    if <<(costume [number v]) < [101]> and <([mode v] of [paused v]) = []>> then\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [drain v]\nif <([mode v] of [paused v]) = []> then\n    repeat until <(costume [number v]) = [101]>\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [game start v]\nshow\nforever\n    if <<<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<<(mouse x) < [240]> and <(costume [number v]) < [101]>> and <([paused? v] of [player v]) = [false]>>> and <(replenishing) = [false]>> then\n        set [drawing? v] to [true]\n    else\n        set [drawing? v] to [false]\n    end\n    if <([mode v] of [paused v]) = []> then\n        switch costume to ((round (ink)) + (1))\n        go to [front v] layer\n        if <(drawing?) = [true]> then\n            set [x v] to (mouse x)\n            set [y v] to (mouse y)\n            set [difference v] to [0]\n            wait (0.05) seconds\n            calculate difference\n            if <[100] > (ink)> then\n                if <([color v] of [pen v]) = [1]> then\n                    change [ink v] by ((difference) / (110))\n                else\n                    change [ink v] by ((difference) / (60))\n                end\n            else\n                set [ink v] to [100]\n            end\n        end\n    else\n        if <(drawing?) = [true]> then\n            wait (0.05) seconds\n            calculate difference\n        end\n    end\n    if <([color v] of [pen v]) = [2]> then\n        set [brightness v] effect to (40)\n    else\n        if <([color v] of [pen v]) = [3]> then\n            set [brightness v] effect to (-10)\n        else\n            clear graphic effects\n        end\n    end\nend\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\n\ndefine calculate difference\nif <[0] > ((x) - (mouse x))> then\n    set [difference v] to (((x) - (mouse x)) * (-1))\nelse\n    set [difference v] to ((x) - (mouse x))\nend\nif <[0] > ((y) - (mouse y))> then\n    set [difference v] to ((difference) + (((y) - (mouse y)) * (-1)))\nelse\n    set [difference v] to ((difference) + ((y) - (mouse y)))\nend\nif <<<([color v] of [pen v]) = [2]> and <(difference) > [5]>> and <(drawing?) = [true]>> then\n    create clone of (red pen detection v)\nend\n\nwhen I receive [game start v]\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nforever\n    if <<([mode v] of [paused v]) = []> and <(drawing?) = [true]>> then\n        change [ink v] by (0.5)\n        if <([color v] of [pen v]) = [2]> then\n            create clone of (red pen detection v)\n        end\n        wait until <not <(drawing?) = [true]>>\n    end\nend\n\n@pen\n\nwhen flag clicked\nerase all\nhide\nerase all\n\nwhen [space v] key pressed\nchange [color v] by (1)\nif <<([costume # v] of [level v]) > [24]> or <([mode v] of [paused v]) = [speedrun]>> then\n    if <(color) > [3]> then\n        set [color v] to [1]\n    end\nelse\n    if <([costume # v] of [level v]) > [20]> then\n        if <(color) > [2]> then\n            set [color v] to [1]\n        end\n    else\n        if <(color) > [1]> then\n            set [color v] to [1]\n        end\n    end\nend\nif <(color) = [1]> then\n    set pen color to (#000000)\n    set pen size to (5)\nend\nif <(color) = [2]> then\n    set pen color to (#ff0000)\n    set pen size to (5)\nend\nif <(color) = [3]> then\n    set pen color to (#e6e6e6)\n    set pen size to (12)\nend\n\nwhen I receive [level start v]\nset [scribble v] to [0]\nif <([costume # v] of [level v]) = [50]> then\n    set [draw enemies v] to [0]\n    set [enemies v] to [0]\n    repeat until <not <([costume # v] of [level v]) = [50]>>\n        if <<mouse down?> and <(color) = [2]>> then\n            change [draw enemies v] by ([difference v] of [percentage v])\n            if <<(draw enemies) > [100]> and <(enemies) < [3]>> then\n                change [enemies v] by (1)\n                set [draw enemies v] to [0]\n                erase all\n                broadcast (draw enemy v)\n            end\n        end\n    end\nend\n\nwhen I receive [game start v]\nshow\nset [color v] to [1]\nset pen color to (#000000)\nset pen size to (4)\nforever\n    go to (mouse-pointer v)\n    if <<<<mouse down?> and <<(mouse y) < [180]> and <(mouse y) > [-180]>>> and <<(mouse x) < [240]> and <([costume # v] of [percentage v]) < [100]>>> and <([paused? v] of [player v]) = [false]>> then\n        if <(color) = [1]> then\n            if <<([costume # v] of [level v]) = [51]> and <<(x position) > [-46]> and <<[46] > (x position)> and <<(y position) > [-55]> and <[25] > (y position)>>>>> then\n                set pen size to (12)\n                change [scribble v] by ([difference v] of [percentage v])\n            else\n                set pen size to (4)\n            end\n        end\n        pen down\n        start sound (pick random (1) to (2))\n    else\n        pen up\n    end\nend\n\n@ink\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to x: (x) y: (y)\npoint in direction (pick random (0) to (359))\nwait (pick random (0.1) to (0.9)) seconds\nswitch costume to (6 v)\nshow\nrepeat (5)\n    switch costume to ((costume [number v]) - (1))\n    wait (0.01) seconds\nend\nforever\n    repeat (5)\n        change y by (0.25)\n    end\n    repeat (10)\n        change y by (0.5)\n    end\n    repeat (5)\n        change y by (0.25)\n    end\n    repeat (5)\n        change y by (-0.25)\n    end\n    repeat (10)\n        change y by (-0.5)\n    end\n    repeat (5)\n        change y by (-0.25)\n    end\nend\n\ndefine level (level) x: (x) y: (y) size: (size)\nif <<([costume # v] of [level v]) = (level)> and <not <[levels visited v] contains (level)?>>> then\n    set [x v] to (x)\n    set [y v] to (y)\n    if <(size) = [1]> then\n        set size to (75) %\n        set [size v] to [75]\n    else\n        if <(size) = [2]> then\n            set size to (175) %\n            set [size v] to [175]\n        else\n            set size to (500) %\n            set [size v] to [500]\n        end\n    end\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        start sound [get v]\n        if <(size) = [75]> then\n            start sound [1 v]\n            broadcast (ink bubble v)\n        else\n            start sound [2 v]\n            broadcast (big bubble v)\n        end\n        repeat (5)\n            next costume\n            change size by (5)\n            change [ghost v] effect by (10)\n        end\n        if <([costume # v] of [level v]) = [64]> then\n            hide\n            set size to (size) %\n            clear graphic effects\n            wait (pick random (40) to (60)) seconds\n            switch costume to (6 v)\n            show\n            repeat (5)\n                switch costume to ((costume [number v]) - (1))\n                wait (0.01) seconds\n            end\n        else\n            if <([costume # v] of [level v]) = [65]> then\n                broadcast (epilogue v)\n            end\n            delete this clone\n        end\n    end\nend\n\nwhen I receive [previous level v]\ndelete this clone\n\nwhen I receive [next level v]\ndelete this clone\n\nwhen I start as a clone\nwait (pick random (0.1) to (0.9)) seconds\nforever\n    repeat (5)\n        change [brightness v] effect by (0.25)\n    end\n    repeat (10)\n        change [brightness v] effect by (1)\n    end\n    repeat (5)\n        change [brightness v] effect by (0.25)\n    end\n    repeat (5)\n        change [brightness v] effect by (-0.25)\n    end\n    repeat (10)\n        change [brightness v] effect by (-1)\n    end\n    repeat (5)\n        change [brightness v] effect by (-0.25)\n    end\n    clear graphic effects\nend\n\nwhen I receive [game start v]\ndelete (all) of [levels visited v]\ndelete this clone\n\nwhen I receive [make ink appear v]\nwait (0.1) seconds\nlevel (5) x: (-130) y: (0) size: (1)\nlevel (5) x: (-210) y: (100) size: (1)\nlevel (5) x: (-50) y: (-50) size: (1)\nlevel (5) x: (150) y: (-90) size: (1)\nlevel (5) x: (200) y: (100) size: (1)\nlevel (6) x: (180) y: (115) size: (2)\nlevel (8) x: (180) y: (-140) size: (1)\nlevel (11) x: (180) y: (0) size: (2)\nlevel (17) x: (-130) y: (-55) size: (1)\nlevel (19) x: (195) y: (100) size: (2)\nlevel (21) x: (195) y: (50) size: (1)\nlevel (21) x: (145) y: (50) size: (1)\nlevel (21) x: (95) y: (50) size: (1)\nlevel (23) x: (200) y: (-40) size: (2)\nlevel (26) x: (-60) y: (-40) size: (1)\nlevel (26) x: (60) y: (-40) size: (1)\nlevel (26) x: (60) y: (35) size: (1)\nlevel (26) x: (190) y: (35) size: (1)\nlevel (28) x: (-200) y: (-125) size: (1)\nlevel (28) x: (95) y: (-125) size: (2)\nlevel (28) x: (0) y: (80) size: (1)\nlevel (30) x: (0) y: (-150) size: (2)\nlevel (33) x: (-105) y: (40) size: (1)\nlevel (33) x: (85) y: (20) size: (1)\nlevel (33) x: (220) y: (40) size: (1)\nlevel (36) x: (0) y: (0) size: (2)\nlevel (39) x: (-40) y: (90) size: (2)\nlevel (39) x: (-170) y: (-20) size: (1)\nlevel (39) x: (-40) y: (-60) size: (1)\nlevel (39) x: (100) y: (-25) size: (1)\nlevel (39) x: (180) y: (0) size: (1)\nlevel (39) x: (200) y: (100) size: (1)\nlevel (46) x: (155) y: (-90) size: (1)\nlevel (46) x: (155) y: (110) size: (2)\nlevel (59) x: (-60) y: (25) size: (1)\nlevel (59) x: (0) y: (25) size: (1)\nlevel (59) x: (60) y: (25) size: (1)\nlevel (59) x: (-60) y: (-25) size: (1)\nlevel (59) x: (0) y: (-25) size: (2)\nlevel (59) x: (60) y: (-25) size: (1)\nlevel (59) x: (-60) y: (-80) size: (1)\nlevel (59) x: (0) y: (-80) size: (1)\nlevel (59) x: (60) y: (-80) size: (1)\nlevel (63) x: (160) y: (-50) size: (2)\nlevel (64) x: (75) y: (10) size: (1)\nlevel (64) x: (75) y: (-65) size: (1)\nlevel (64) x: (-200) y: (85) size: (1)\nlevel (64) x: (190) y: (85) size: (1)\nlevel (64) x: (-70) y: (-35) size: (1)\nlevel (64) x: (190) y: (20) size: (2)\nlevel (64) x: (190) y: (-70) size: (2)\nlevel (65) x: (0) y: (20) size: (3)\n\n@enemy\n\nwhen I receive [draw enemy v]\nif <([enemies v] of [pen v]) = [1]> then\n    go to (mouse-pointer v)\nend\n\nwhen I receive [enemy beam v]\nif <(item (1) of [enemies v]) = [!]> then\n    go to x: ([x position v] of [the eraser v]) y: (-80)\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen [r v] key pressed\ngo to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n\nwhen flag clicked\nset [costume v] to [1]\nswitch costume to (1 v)\nforever\n    change [costume v] by (1)\n    if <(costume) = [5]> then\n        set [costume v] to [1]\n    end\n    wait (0.1) seconds\n    if <(y position) < [-160]> then\n        go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n    end\n    if <<<touching (red pen detection v)?> and <not <([costume # v] of [level v]) = [50]>>> and <(costume [number v]) < [6]>> then\n        start sound [hurt v]\n        switch costume to (pop v)\n        wait (0.05) seconds\n        switch costume to (pop2 v)\n        wait (0.05) seconds\n        hide\n        set [current level v] to [0]\n        replace item (1) of [enemies v] with []\n    end\nend\n\nwhen I receive [level start v]\nswitch costume to (1 v)\n\nwhen flag clicked\nforever\n    if <<([paused? v] of [player v]) = [false]> and <[6] > (costume [number v])>> then\n        if <<<([costume # v] of [level v]) = (current level)> and <<not <<(current level) = [50]> or <(current level) = [64]>>> or <<(current level) = [50]> and <([enemies v] of [pen v]) > [0]>>>> or <<([costume # v] of [level v]) = [64]> and <(item (1) of [enemies v]) = [!]>>> then\n            show\n            switch costume to (hitbox v)\n            if <touching (_edge_ v)?> then\n                set [movement v] to (pick random (1) to (2))\n            end\n            if <(movement) = [1]> then\n                change [x v] by (0.5)\n                turn right (4) degrees\n            end\n            if <(movement) = [2]> then\n                change [x v] by (-0.5)\n                turn left (4) degrees\n            end\n            set [x v] to ((x) * (0.9))\n            change x by (x)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                change y by (1)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                            change y by (1)\n                            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                change y by (1)\n                                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                    change x by ((x) * (-1))\n                                    change y by (-5)\n                                    if <(jump) = [1]> then\n                                        set [x v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [y v] by (-1)\n            change y by (y)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                change y by ((y) * (-1))\n                set [y v] to [0]\n            end\n            change y by (-1)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                if <(jump) = [1]> then\n                    set [y v] to [10]\n                end\n            end\n            change y by (1)\n            switch costume to (costume)\n        else\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        set [movement v] to (pick random (1) to (3))\n        if <(pick random (1) to (2)) = [1]> then\n            set [jump v] to [1]\n        end\n        wait (pick random (1) to (3)) seconds\n        set [jump v] to [0]\n    end\nend\n\ndefine level (#) x: (x) y: (y)\nreplace item (#) of [level x v] with (x)\nreplace item (#) of [level y v] with (y)\nif <([costume # v] of [level v]) = (#)> then\n    go to x: (x) y: (y)\n    show\nend\nset [current level v] to (#)\nwait until <not <([costume # v] of [level v]) = (#)>>\nhide\n\nwhen I receive [red v]\ngo to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [level x v]\ndelete all of [level y v]\nrepeat (75)\n    add [] to [level x v]\n    add [] to [level y v]\nend\nforever\n    level [15] x: [0] y: [30]\n    level [16] x: [0] y: [0]\n    level [17] x: [-200] y: [0]\n    level [18] x: [0] y: [0]\n    level [19] x: [60] y: [0]\n    level [20] x: [0] y: [0]\n    level [21] x: [60] y: [50]\n    level [22] x: [-75] y: [-60]\n    level [23] x: [50] y: [0]\n    level [23] x: [50] y: [0]\n    level [24] x: [100] y: [0]\n    level [28] x: [0] y: [15]\n    level [30] x: [0] y: [0]\n    level [31] x: [0] y: [30]\n    level [33] x: [0] y: [0]\n    level [50] x: [0] y: [0]\n    level [53] x: [0] y: [0]\n    level [61] x: [0] y: [0]\n    level [64] x: [0] y: [0]\nend\n\n@enemy2\n\nwhen I receive [draw enemy v]\nif <([enemies v] of [pen v]) = [2]> then\n    go to (mouse-pointer v)\nend\n\nwhen I receive [enemy beam v]\nif <(item (2) of [enemies v]) = [!]> then\n    go to x: ([x position v] of [the eraser v]) y: (-80)\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen [r v] key pressed\ngo to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n\nwhen flag clicked\nset [costume v] to [1]\nswitch costume to (1 v)\nforever\n    change [costume v] by (1)\n    if <(costume) = [5]> then\n        set [costume v] to [1]\n    end\n    wait (0.1) seconds\n    if <(y position) < [-160]> then\n        go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n    end\n    if <<<touching (red pen detection v)?> and <not <([costume # v] of [level v]) = [50]>>> and <(costume [number v]) < [6]>> then\n        start sound [hurt v]\n        switch costume to (pop v)\n        wait (0.05) seconds\n        switch costume to (pop2 v)\n        wait (0.05) seconds\n        hide\n        set [current level v] to [0]\n        replace item (2) of [enemies v] with []\n    end\nend\n\nwhen I receive [level start v]\nswitch costume to (1 v)\n\nwhen flag clicked\nforever\n    if <<([paused? v] of [player v]) = [false]> and <[6] > (costume [number v])>> then\n        if <<<([costume # v] of [level v]) = (current level)> and <<not <<(current level) = [50]> or <(current level) = [64]>>> or <<(current level) = [50]> and <([enemies v] of [pen v]) > [1]>>>> or <<([costume # v] of [level v]) = [64]> and <(item (2) of [enemies v]) = [!]>>> then\n            show\n            switch costume to (costume1 v)\n            if <touching (_edge_ v)?> then\n                set [movement v] to (pick random (1) to (2))\n            end\n            if <(movement) = [1]> then\n                change [x v] by (0.5)\n                turn right (4) degrees\n            end\n            if <(movement) = [2]> then\n                change [x v] by (-0.5)\n                turn left (4) degrees\n            end\n            set [x v] to ((x) * (0.9))\n            change x by (x)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                change y by (1)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                            change y by (1)\n                            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                change y by (1)\n                                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                    change x by ((x) * (-1))\n                                    change y by (-5)\n                                    if <(jump) = [1]> then\n                                        set [x v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [y v] by (-1)\n            change y by (y)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                change y by ((y) * (-1))\n                set [y v] to [0]\n            end\n            change y by (-1)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                if <(jump) = [1]> then\n                    set [y v] to [10]\n                end\n            end\n            change y by (1)\n            switch costume to (costume)\n        else\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        set [movement v] to (pick random (1) to (3))\n        if <(pick random (1) to (2)) = [1]> then\n            set [jump v] to [1]\n        end\n        wait (pick random (1) to (3)) seconds\n        set [jump v] to [0]\n    end\nend\n\ndefine level (#) x: (x) y: (y)\nreplace item (#) of [level x v] with (x)\nreplace item (#) of [level y v] with (y)\nif <([costume # v] of [level v]) = (#)> then\n    go to x: (x) y: (y)\n    show\nend\nset [current level v] to (#)\nwait until <not <([costume # v] of [level v]) = (#)>>\nhide\n\nwhen I receive [red v]\nif <not <([costume # v] of [level v]) = [64]>> then\n    go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\nend\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [level x v]\ndelete all of [level y v]\nrepeat (40)\n    add [] to [level x v]\n    add [] to [level y v]\nend\nforever\n    level [16] x: [-45] y: [0]\n    level [17] x: [-200] y: [30]\n    level [18] x: [-50] y: [30]\n    level [19] x: [-130] y: [-10]\n    level [21] x: [-130] y: [-10]\n    level [22] x: [75] y: [-100]\n    level [23] x: [0] y: [0]\n    level [24] x: [-100] y: [0]\n    level [31] x: [0] y: [-30]\n    level [50] x: [0] y: [-30]\n    level [53] x: [0] y: [30]\n    level [61] x: [0] y: [30]\n    level [64] x: [0] y: [30]\nend\n\n@enemy3\n\nwhen I receive [draw enemy v]\nif <([enemies v] of [pen v]) = [3]> then\n    go to x: (mouse x) y: (mouse y)\nend\n\nwhen I receive [enemy beam v]\nif <(item (3) of [enemies v]) = [!]> then\n    go to x: ([x position v] of [the eraser v]) y: (-80)\nend\n\nwhen I receive [dust v]\nchange [y v] by (8)\n\nwhen [r v] key pressed\ngo to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n\nwhen flag clicked\nset [costume v] to [1]\nswitch costume to (1 v)\nforever\n    change [costume v] by (1)\n    if <(costume) = [5]> then\n        set [costume v] to [1]\n    end\n    wait (0.1) seconds\n    if <(y position) < [-160]> then\n        go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\n    end\n    if <<<touching (red pen detection v)?> and <not <([costume # v] of [level v]) = [50]>>> and <(costume [number v]) < [6]>> then\n        start sound [hurt v]\n        switch costume to (pop v)\n        wait (0.05) seconds\n        switch costume to (pop2 v)\n        wait (0.05) seconds\n        hide\n        set [current level v] to [0]\n        replace item (3) of [enemies v] with []\n    end\nend\n\nwhen I receive [level start v]\nswitch costume to (1 v)\n\nwhen flag clicked\nforever\n    if <<([paused? v] of [player v]) = [false]> and <[6] > (costume [number v])>> then\n        if <<<([costume # v] of [level v]) = (current level)> and <<not <<(current level) = [50]> or <(current level) = [64]>>> or <<(current level) = [50]> and <([enemies v] of [pen v]) > [2]>>>> or <<([costume # v] of [level v]) = [64]> and <(item (3) of [enemies v]) = [!]>>> then\n            show\n            switch costume to (costume1 v)\n            if <touching (_edge_ v)?> then\n                set [movement v] to (pick random (1) to (2))\n            end\n            if <(movement) = [1]> then\n                change [x v] by (0.5)\n                turn right (4) degrees\n            end\n            if <(movement) = [2]> then\n                change [x v] by (-0.5)\n                turn left (4) degrees\n            end\n            set [x v] to ((x) * (0.9))\n            change x by (x)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                change y by (1)\n                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                    change y by (1)\n                    if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                        change y by (1)\n                        if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                            change y by (1)\n                            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                change y by (1)\n                                if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                                    change x by ((x) * (-1))\n                                    change y by (-5)\n                                    if <(jump) = [1]> then\n                                        set [x v] to [0]\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n            change [y v] by (-1)\n            change y by (y)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                change y by ((y) * (-1))\n                set [y v] to [0]\n            end\n            change y by (-1)\n            if <<touching color (#000000)?> or <touching color (#ff0404)?>> then\n                if <(jump) = [1]> then\n                    set [y v] to [10]\n                end\n            end\n            change y by (1)\n            switch costume to (costume)\n        else\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        set [movement v] to (pick random (1) to (3))\n        if <(pick random (1) to (2)) = [1]> then\n            set [jump v] to [1]\n        end\n        wait (pick random (1) to (3)) seconds\n        set [jump v] to [0]\n    end\nend\n\ndefine level (#) x: (x) y: (y)\nreplace item (#) of [level x v] with (x)\nreplace item (#) of [level y v] with (y)\nif <([costume # v] of [level v]) = (#)> then\n    go to x: (x) y: (y)\n    show\nend\nset [current level v] to (#)\nwait until <not <([costume # v] of [level v]) = (#)>>\nhide\n\nwhen I receive [red v]\nif <not <([costume # v] of [level v]) = [64]>> then\n    go to x: (item ([costume # v] of [level v]) of [level x v]) y: (item ([costume # v] of [level v]) of [level y v])\nend\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ndelete all of [level x v]\ndelete all of [level y v]\nrepeat (40)\n    add [] to [level x v]\n    add [] to [level y v]\nend\nforever\n    level [16] x: [45] y: [0]\n    level [18] x: [50] y: [0]\n    level [23] x: [-50] y: [0]\n    level [31] x: [190] y: [0]\n    level [50] x: [0] y: [0]\n    level [61] x: [15] y: [15]\n    level [64] x: [15] y: [15]\nend\n\n@text\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [drain v]\ncreate clone of (_myself_ v)\nnext []\nwait (5) seconds\nnext []\nwait (5) seconds\nnext []\n\ndefine next (#)\nwait until <([paused? v] of [player v]) = [false]>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nif <(#) = []> then\n    next costume\nelse\n    switch costume to (#)\nend\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nclear graphic effects\n\nwhen I receive [drain v]\nwait until <key (r v) pressed?>\nstop [other scripts in sprite v]\nnext [5]\n\nwhen I receive [next level v]\nwait (0.1) seconds\nclear graphic effects\nif <([costume # v] of [level v]) = [51]> then\n    switch costume to (1 v)\n    go to [front v] layer\n    show\nelse\n    if <([costume # v] of [level v]) = [64]> then\n        switch costume to (eraser v)\n        go to [front v] layer\n        show\n        wait (1.5) seconds\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n    else\n        hide\n    end\nend\n\nwhen I start as a clone\nswitch costume to (glow v)\nset [ghost v] effect to (25)\nstart sound [zap v]\nrepeat until <<([costume # v] of [percentage v]) = [101]> or <([mode v] of [paused v]) = [speedrun]>>\n    repeat (10)\n        change [ghost v] effect by (5)\n        change [ghost v] effect by (pick random (-20) to (20))\n    end\n    repeat (10)\n        change [ghost v] effect by (-5)\n        change [ghost v] effect by (pick random (-20) to (20))\n    end\nend\nhide\ndelete this clone\n\nwhen I receive [eraser gone v]\nclear graphic effects\nswitch costume to (eraser gone v)\nnext [eraser gone]\n\n@the eraser\n\nwhen flag clicked\nhide\nswitch costume to (still v)\n\nwhen I receive [start boss pattern v]\ngo to [front v] layer\nshow\nrepeat (pick random (1) to (3))\n    if <(health) = [105]> then\n        move [15]\n    else\n        move [8]\n    end\nend\nswitch costume to (fly right v)\nset [player x v] to ([on ground x v] of [player v])\nset [player y v] to ([on ground y v] of [player v])\nrepeat until <(x position) > (player x)>\n    change x by (10)\nend\nswitch costume to (still v)\nif <(pick random (1) to (3)) = [1]> then\n    stomp\nelse\n    laser\nend\nbroadcast (start boss pattern v)\n\ndefine shake\nset [shake x v] to (x position)\nset [shake y v] to (y position)\nrepeat (8)\n    go to x: ((shake x) + (pick random (-15) to (15))) y: ((shake y) + (pick random (-15) to (15)))\nend\nrepeat (10)\n    go to x: ((shake x) + (pick random (-5) to (5))) y: ((shake y) + (pick random (-5) to (5)))\nend\nrepeat (10)\n    go to x: ((shake x) + (pick random (-2) to (2))) y: ((shake y) + (pick random (-2) to (2)))\nend\n\ndefine stomp\nswitch costume to (still field going v)\nwait (0.05) seconds\nswitch costume to (still no field v)\nshake\nswitch costume to (stomp v)\nstart sound [whoosh v]\nrepeat until <(player y) > (y position)>\n    change y by (-10)\nend\nstart sound [stomp v]\nbroadcast (dust v)\nquick shake\nswitch costume to (still no field v)\nglide (1) secs to x: (x position) y: (85)\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <([costume # v] of [level v]) = [64]> then\n    repeat (3)\n        add [] to [enemies v]\n    end\n    set [health v] to [0]\n    go to x: (0) y: (85)\n    set size to (75) %\n    clear graphic effects\n    show\n    broadcast (start boss pattern v)\nend\n\nwhen I receive [game start v]\ndelete all of [enemies v]\nhide\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\n\nwhen I receive [start boss pattern v]\nforever\n    if <not <([paused? v] of [player v]) = [false]>> then\n        stop [other scripts in sprite v]\n        wait until <([paused? v] of [player v]) = [false]>\n        broadcast (start boss pattern v)\n    end\nend\n\nwhen I receive [start boss pattern v]\nforever\n    wait until <<touching (red pen detection v)?> and <<(costume [number v]) = [5]> or <(costume [number v]) = [6]>>>\n    stop [other scripts in sprite v]\n    switch costume to (hurt v)\n    create clone of (dust v)\n    if <[100] > (health)> then\n        start sound [hurt v]\n        repeat (20)\n            change [health v] by (0.75)\n            change [ghost v] effect by (5)\n            change size by (2)\n        end\n        wait (2) seconds\n        go to x: (0) y: (85)\n        switch costume to (still v)\n        repeat (20)\n            change [ghost v] effect by (-5)\n            change size by (-2)\n        end\n        broadcast (start boss pattern v)\n    else\n        switch costume to (hurt2 v)\n        start sound [hurt2 v]\n        repeat (6)\n            wait (0.1) seconds\n            change [brightness v] effect by (3)\n            next costume\n        end\n        start sound [boom v]\n        repeat (6)\n            wait (0.03) seconds\n            change [brightness v] effect by (4)\n            change [ghost v] effect by (15)\n            next costume\n        end\n        wait (0.1) seconds\n        hide\n        broadcast (eraser gone v)\n    end\nend\n\ndefine laser\nquick shake\nstart sound [erase v]\ncreate clone of (dust v)\nwait (0.15) seconds\nstart sound [laser v]\nswitch costume to (still red v)\nshake\nswitch costume to (laser1 v)\nstart sound [laser2 v]\nwait (0.05) seconds\nrepeat (3)\n    switch costume to (laser2 v)\n    wait (0.05) seconds\n    switch costume to (laser3 v)\n    wait (0.05) seconds\n    switch costume to (laser4 v)\n    wait (0.05) seconds\nend\nswitch costume to (laser5 v)\nspawn enemy\nif <(pick random (1) to (2)) = [1]> then\n    spawn enemy\nend\nbroadcast (enemy beam v)\nwait (0.05) seconds\nif <(pick random (1) to (3)) = [1]> then\n    stomp\nend\n\ndefine erase\nif <(pick random (1) to (3)) = [1]> then\n    if <(pick random (1) to (2)) = [1]> then\n        quick shake\n        start sound [erase v]\n        create clone of (dust v)\n    else\n        shake\n        create clone of (dust v)\n        repeat (4)\n            create clone of (mini-erasers v)\n        end\n    end\nend\n\ndefine quick shake\nset [shake x v] to (x position)\nset [shake y v] to (y position)\nrepeat (3)\n    go to x: ((shake x) + (pick random (-15) to (15))) y: ((shake y) + (pick random (-15) to (15)))\nend\nrepeat (6)\n    go to x: ((shake x) + (pick random (-5) to (5))) y: ((shake y) + (pick random (-5) to (5)))\nend\nrepeat (3)\n    go to x: ((shake x) + (pick random (-2) to (2))) y: ((shake y) + (pick random (-2) to (2)))\nend\n\ndefine spawn enemy\nif <(item (1) of [enemies v]) = []> then\n    replace item (1) of [enemies v] with [!]\nelse\n    if <(item (2) of [enemies v]) = []> then\n        replace item (2) of [enemies v] with [!]\n    else\n        if <(item (3) of [enemies v]) = []> then\n            replace item (3) of [enemies v] with [!]\n        end\n    end\nend\n\ndefine move (#)\nswitch costume to (fly right v)\nrepeat until <(x position) > [155]>\n    change x by (#)\nend\nswitch costume to (still v)\nrepeat until <(x position) > [200]>\n    change x by ((#) / (2))\nend\nerase\nswitch costume to (fly left v)\nrepeat until <[-155] > (x position)>\n    change x by ((#) * (-1))\nend\nswitch costume to (still v)\nrepeat until <[-200] > (x position)>\n    change x by ((#) / (-2))\nend\nerase\n\n@dust\n\nwhen flag clicked\nhide\n\nwhen I receive [dust v]\ncreate clone of (_myself_ v)\ngo to (the eraser v)\nchange y by (-50)\nswitch costume to (costume1 v)\nshow\nwait (0.05) seconds\nrepeat (5)\n    next costume\n    wait (0.05) seconds\nend\nhide\n\nwhen I start as a clone\nerase all\nbroadcast (stamp v)\nbroadcast (erase v)\ngo to (the eraser v)\nswitch costume to (erase v)\ngo to [back v] layer\nclear graphic effects\nset size to (50) %\nshow\nrepeat (15)\n    change size by (3)\n    change [ghost v] effect by (2)\nend\nrepeat (15)\n    change size by (3)\n    change [ghost v] effect by (4)\nend\ndelete this clone\n\n@health bar\n\nwhen flag clicked\nhide\n\nwhen I receive [next level v]\nwait (0.1) seconds\nif <([costume # v] of [level v]) = [64]> then\n    show\n    go to [front v] layer\n    set [ghost v] effect to (50)\n    go to x: (0) y: (0)\n    forever\n        set x to (((-311) + ((3.11) * (([health v] of [the eraser v]) + (4)))) * (1.6))\n        if <(x position) > [10]> then\n            set x to (10)\n        end\n        if <([health v] of [the eraser v]) > [99]> then\n            set x to (15)\n        end\n    end\nelse\n    hide\nend\n\n@mini-erasers\n\nwhen I start as a clone\ngo to (the eraser v)\nchange x by (pick random (-60) to (60))\nchange y by (pick random (-30) to (30))\nswitch costume to (eraser v)\nshow\nrepeat until <<<touching (player v)?> or <touching (red pen detection v)?>> or <(timer) > [20]>>\n    if <([paused? v] of [player v]) = [false]> then\n        point towards (player v)\n        move (3) steps\n    end\nend\npoint towards (player v)\nmove (3) steps\nwait (0.2) seconds\nswitch costume to (pop v)\nwait (0.1) seconds\nswitch costume to (pop2 v)\nwait (0.1) seconds\ndelete this clone\n\nwhen I start as a clone\nset [timer v] to [0]\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        wait (1) seconds\n        change [timer v] by (1)\n    end\nend\n\n@title\n\nwhen flag clicked\nhide\nwait (0.1) seconds\nswitch costume to (80 v)\nshow\nchange costume [16] times\nchange costume [11] times\nchange costume [18] times\nchange costume [8] times\nchange costume [11] times\nbroadcast ("the platformer" v)\nwait (0.15) seconds\nchange costume [15] times\n\nwhen I receive [game start v]\nhide\n\ndefine change costume (#) times\nstart sound (pick random (2) to (3))\nrepeat (#)\n    switch costume to ((costume [number v]) - (1))\nend\nstop all sounds\nwait (0.05) seconds\n\n@paused\n\nwhen flag clicked\nset [ghost v] effect to (35)\nhide variable [time v]\nhide variable [hurt v]\nset [hurt v] to [0]\nset [mode v] to []\nforever\n    if <([paused? v] of [player v]) = [help]> then\n        show\n        switch costume to (white v)\n        go to [front v] layer\n        set [costume v] to (([costume # v] of [level v]) + (12))\n        create clone of (_myself_ v)\n        wait until <not <([paused? v] of [player v]) = [help]>>\n    else\n        if <([paused? v] of [player v]) = [true]> then\n            show\n            switch costume to (paused v)\n            go to [front v] layer\n        else\n            hide\n            go to [back v] layer\n        end\n    end\nend\n\nwhen I receive [epilogue v]\nstop [other scripts in sprite v]\ntime\nset [hurt v] to (join (hurt) [ times])\nif <(mode) = []> then\n    if <<(☁ fast time) > (timer)> and <([skipped? v] of [player v]) = [false]>> then\n        set [☁ fast time v] to (timer)\n    end\nelse\n    if <<(☁ fast time \(speedrun\)) > (timer)> and <(timer) > [1]>> then\n        set [☁ fast time \(speedrun\) v] to (timer)\n    end\nend\nset [ghost v] effect to (100)\nswitch costume to (white v)\ngo to [front v] layer\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\nif <(mode) = []> then\n    set [costume v] to [3]\n    repeat (7)\n        create clone of (_myself_ v)\n        change [costume v] by (1)\n        wait (3) seconds\n    end\nelse\n    set [costume v] to [3]\n    create clone of (_myself_ v)\n    if <(time) = [15:00]> then\n        set [costume v] to [11]\n        create clone of (_myself_ v)\n    else\n        set [costume v] to [12]\n        create clone of (_myself_ v)\n    end\nend\nwait until <mouse down?>\nwait until <not <mouse down?>>\nbroadcast (game start v)\nset [mode v] to [speedrun]\nswitch costume to (speedrun v)\nclear graphic effects\nshow\nwait (3) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nclear graphic effects\n\nwhen I start as a clone\nswitch costume to (costume)\ngo to [front v] layer\nif <(costume) = [3]> then\n    show variable [time v]\n    show variable [hurt v]\nelse\n    if <(costume) < [13]> then\n        set [ghost v] effect to (100)\n        repeat (50)\n            change [ghost v] effect by (-0.5)\n        end\n        repeat (50)\n            change [ghost v] effect by (-1.5)\n        end\n    else\n        clear graphic effects\n        wait until <not <([paused? v] of [player v]) = [help]>>\n        delete this clone\n    end\nend\n\nwhen I receive [red v]\nchange [hurt v] by (1)\n\nwhen I receive [game start v]\nhide variable [hurt v]\ndelete this clone\n\nwhen I receive [game start v]\nif <(mode) = [speedrun]> then\n    forever\n        time\n        if <(time) = [15:00]> then\n            stop [other scripts in sprite v]\n            broadcast (epilogue v)\n        end\n    end\nend\n\ndefine time\nif <(length of (round ((timer) - (([floor v] of ((timer) / (60)) ) * (60))))) = [1]> then\n    set [time v] to (join ([floor v] of ((timer) / (60)) ) (join [:] (join [0] (round ((timer) - (([floor v] of ((timer) / (60)) ) * (60)))))))\nelse\n    set [time v] to (join ([floor v] of ((timer) / (60)) ) (join [:] (round ((timer) - (([floor v] of ((timer) / (60)) ) * (60))))))\nend\n\nwhen [p v] key pressed\nif <(mode) = [speedrun]> then\n    broadcast (game start v)\nend\n\n@red pen detection\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\ngo to (mouse-pointer v)\nset [ghost v] effect to (100)\nshow\n\nwhen [r v] key pressed\ndelete this clone\n\nwhen I receive [erase v]\ndelete this clone\n\nwhen I receive [level start v]\ndelete this clone\n\n