Draw: The Platformer HARD MODE

Instructions:     —————— DESCRIPTION ——————\nIt's like the original game but brutally difficult. Your ink depletes automatically, and you die when your ink reaches 0%. All levels have been remixed, and you gain extra ink by beating them. You have access to all ink colors from the beginning, and they all use the same amount of ink, but you can't skip levels.\n\n   —————— CONTROLS ——————\nArrow keys/WAD — Move\nClick and drag — Draw\nSpace — Switch pen\nR — Restart\nP — Pause\n\n    —————— CREDITS ——————\n@djpro — Player movement\nEdward Shallow — Music\nSound Jay and FesliyanStudios — Sounds

@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.2) 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.2) 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    set [inkless v] to [true]\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 (-120) end (-120)\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 (-100) end (-100)\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 <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\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]\nset [inkless v] to [true]\nrepeat until <key (r v) pressed?>\n    go to x: (0) y: (-15)\nend\n\nwhen flag clicked\nhide\nswitch costume to (1 v)\nset [paused? 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 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 (75)\n    set volume to (75) %\n    wait until <not <<((level 1) - (1)) < (costume [number v])> and <(costume [number v]) < (level 2)>>>\nend\n\nwhen I receive [red v]\nswitch costume to ((item (length of [levels visited v]) of [levels visited v]) + (1))\nstamp\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\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 flag clicked\nforever\n    set [pitch v] effect to (pick random (55) to (65))\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\nhide\nset [drawing? v] to [false]\nhide variable [doom v]\n\nwhen I receive [ink bubble v]\nset [replenishing v] to [true]\nrepeat (25)\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 I receive [red v]\nrepeat (4)\n    if <(costume [number v]) < [101]> then\n        change [ink v] by (1)\n    end\nend\n\nwhen I receive [game start v]\nset [ink v] to [0]\ngo to x: (-15) y: (0)\nswitch costume to (0 v)\nset [ghost v] effect to (100)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\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    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            change [ink v] by ((difference) / (90))\n        else\n            set [ink v] to [100]\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]\nforever\n    if <<([mode v] of [paused v]) = []> and <(drawing?) = [true]>> then\n        change [ink v] by (0.3)\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\nwhen I receive [game start v]\nwait (4) seconds\nforever\n    if <([paused? v] of [player v]) = [false]> then\n        change [ink v] by (0.02)\n        if <(ink) > [99.9]> then\n            if <<([inkless v] of [player v]) = [true]> and <([costume name v] of [level v]) < [60]>> then\n                set [ink v] to [100]\n            else\n                wait (1) seconds\n                if <(ink) > [99.9]> then\n                    set [doom v] to (join [You died! You completed ] (join (([costume name v] of [level v]) - (1)) [ levels out of 64.]))\n                    show variable [doom v]\n                    stop [all v]\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [next level v]\nif <([inkless v] of [player v]) = [false]> then\n    set [replenishing v] to [true]\n    repeat (6)\n        if <not <(costume [number v]) = [1]>> then\n            change [ink v] by (-1)\n        end\n    end\n    set [replenishing v] to [false]\nend\n\nwhen I receive [drain v]\nrepeat until <(costume [number v]) > [99]>\n    change [ink v] by (1)\nend\nset [ink v] to [100]\n\n@pen\n\nwhen flag clicked\nerase all\nhide\nerase all\n\nwhen [space v] key pressed\nchange [color v] by (1)\nif <(color) > [3]> then\n    set [color v] to [1]\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 [next level 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 (8) x: (190) y: (-150) size: (1)\nlevel (8) x: (170) y: (-160) size: (1)\nlevel (8) x: (190) y: (-160) size: (1)\nlevel (10) x: (-215) y: (-15) 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 (43) x: (0) y: (-100) size: (2)\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 (60) x: (0) y: (-80) size: (2)\nlevel (63) x: (160) y: (-60) 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: (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 []\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]>\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 (2))\n    if <(health) = [105]> then\n        move [18]\n    else\n        move [10]\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\nset size to (100) %\ngo to x: (0) y: (0)\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\nwait (0.5) seconds\ncreate clone of (_myself_ v)\n\nwhen I receive [game start v]\nhide\n\ndefine change costume (#) times\nstart sound (pick random (1) to (2))\nrepeat (#)\n    switch costume to ((costume [number v]) - (1))\nend\nstop all sounds\nwait (0.05) seconds\n\nwhen I start as a clone\nswitch costume to (80 v)\nset size to (900) %\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (200) y: (0)\nrepeat (10)\n    switch costume to (80 v)\n    change size by (-80)\n    switch costume to (costume1 v)\n    change x by (-20)\nend\nset size to (100) %\nstart sound [draw3 v]\nrepeat (3)\n    go to x: (pick random (-20) to (20)) y: (pick random (-20) to (20))\nend\nrepeat (3)\n    go to x: (pick random (-5) to (5)) y: (pick random (-5) to (5))\nend\ngo to x: (0) y: (0)\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]\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 <(☁ fastest time) > (timer)> then\n    set [☁ fastest time v] to (timer)\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\nset [costume v] to [3]\nrepeat (7)\n    create clone of (_myself_ v)\n    change [costume v] by (1)\n    wait (3) seconds\nend\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\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\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