[NEW ABILITIES] The Scientist 2 (platformer)

Instructions: GUYS HOLD SPACE TO FLOAT\nPart 1: https://scratch.mit.edu/projects/821751616/\n> Welcome to my scrolling platformer series, The Scientist. Don't worry, I've tried to make it as non-generic as possible. \n> I apologize for the not super good quality :b It's my first scrolling platformer in nearly 2 years, so it's not the best xD That, and I'm really bad at level design :c\n> I had some really cool effects planned for the floating ability, but unfortunately my progress didn't save, and due to other irl events, I just didn't have the motivation to   code it all over again.... I've just been going through some tough times lately :(\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\ngo to @yoshihome and @PhilHub and comment: f4f (trust reel no joek!!!111 [but pls do])

@Stage\n\nwhen flag clicked\nforever\n    play sound [Roundtrip to the Moon \(by @theCharpy\) v] until done\nend\n\nwhen flag clicked\nforever\n    switch backdrop to (lab1 \(@thecharpy\) v)\nend\n\n@TN (@theCharpy)\n\nwhen flag clicked\n\nwhen [timer v] > (0.01)\nset [ghost v] effect to (100)\nstart sound [Large Cowbell \(@theCharpy\) v]\nshow\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (0.5) seconds\nforever\n    play sound [Aetherian by theCharpy v] until done\n    wait (1) seconds\nend\n\nwhen flag clicked\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.01)\nforever\n    switch costume to ( v)\n    set size to (100) %\n    go to [front v] layer\n    switch costume to (tn \(@thecharpy\) v)\nend\n\n@levels (@theCharpy)\n\nwhen I receive [tick \(@thecharpy\) v]\npos ((levelX \(@theCharpy\)) - (sx \(@theCharpy\))) ((levelY \(@theCharpy\)) - (sy \(@theCharpy\))) (@theCharpy)\n\ndefine pos (x \(@thecharpy\)) (y \(@thecharpy\)) (@theCharpy)\ngo to x: (round (x \(@thecharpy\))) y: (round (y \(@thecharpy\)))\nif <<(round (x \(@thecharpy\))) = (round (x position))> and <(round (y \(@thecharpy\))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset \(@thecharpy\) v]\ndelete this clone\n\ndefine spawn platform at x: (x \(@thecharpy\)) y: (y \(@thecharpy\)) platform#: (costume# \(@thecharpy\)) (@theCharpy)\nswitch costume to (costume# \(@thecharpy\))\nset [levelx \(@thecharpy\) v] to (x \(@thecharpy\))\nset [levely \(@thecharpy\) v] to (y \(@thecharpy\))\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [brightness v] effect to (-1)\nhide\n\nwhen I receive [spawnplatforms \(@thecharpy\) v]\nhide\nset [levelx \(@thecharpy\) v] to [0]\nset [levely \(@thecharpy\) v] to [0]\nif <(level \(@theCharpy\)) = [1]> then\n    spawn platform at x: [0] y: [0] platform#: [1] (@theCharpy)\n    spawn platform at x: [480] y: [0] platform#: [2] (@theCharpy)\n    spawn platform at x: [1000] y: [270] platform#: [3] (@theCharpy)\n    spawn platform at x: [1600] y: [50] platform#: [4] (@theCharpy)\nelse\n    if <(level \(@theCharpy\)) = [2]> then\n        spawn platform at x: [0] y: [0] platform#: [5] (@theCharpy)\n        spawn platform at x: [480] y: [0] platform#: [6] (@theCharpy)\n        spawn platform at x: [1000] y: [270] platform#: [7] (@theCharpy)\n        spawn platform at x: [1600] y: [50] platform#: [8] (@theCharpy)\n    else\n        if <(level \(@theCharpy\)) = [3]> then\n            spawn platform at x: [0] y: [0] platform#: [9] (@theCharpy)\n            spawn platform at x: [480] y: [0] platform#: [10] (@theCharpy)\n            spawn platform at x: [1000] y: [270] platform#: [11] (@theCharpy)\n            spawn platform at x: [1600] y: [50] platform#: [12] (@theCharpy)\n        else\n            if <(level \(@theCharpy\)) = [4]> then\n                spawn platform at x: [0] y: [0] platform#: [13] (@theCharpy)\n                spawn platform at x: [480] y: [0] platform#: [14] (@theCharpy)\n                spawn platform at x: [1000] y: [270] platform#: [15] (@theCharpy)\n                spawn platform at x: [1600] y: [50] platform#: [16] (@theCharpy)\n            else\n                stop [all v]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [level \(@thecharpy\) v] to [1]\n\n@player hitbox (@theCharpy)\n\nwhen flag clicked\nset [reset \(@thecharpy\) v] to [1]\nset [pausefornextlevel \(@thecharpy\) v] to [0]\nclear graphic effects\nhide\ngo to [front v] layer\nbroadcast (reset \(@theCharpy\) v)\nbroadcast (start game \(@theCharpy\) v)\n\nwhen I receive [start game \(@thecharpy\) v]\nset [scientist.size \(@thecharpy\) v] to [100]\nset [shouldfloat? \(@thecharpy\) v] to [0]\nset [slip+ \(@thecharpy\) v] to [0.85]\nforever\n    broadcast (reset \(@theCharpy\) v)\n    set [canuseslide? \(@thecharpy\) v] to [1]\n    set [shouldfloat? \(@thecharpy\) v] to [0]\n    set [slip+ \(@thecharpy\) v] to [0.85]\n    set [canuseshrink? \(@thecharpy\) v] to [1]\n    set [endbomb \(@thecharpy\) v] to [1]\n    set [scientist.size \(@thecharpy\) v] to [100]\n    set [canusebomb? \(@thecharpy\) v] to [1]\n    set [canusejump \(@thecharpy\) v] to [1]\n    set [scientistx \(@thecharpy\) v] to [0]\n    set [scientisty \(@thecharpy\) v] to [150]\n    set [yv \(@thecharpy\) v] to [0]\n    set [xv \(@thecharpy\) v] to [0]\n    set [inair \(@thecharpy\) v] to [0]\n    set [reset \(@thecharpy\) v] to [0]\n    set [sx \(@thecharpy\) v] to [0]\n    set [sy \(@thecharpy\) v] to [0]\n    set size to (scientist.size \(@theCharpy\)) %\n    switch costume to (hitbox \(@thecharpy\) v)\n    set [ghost v] effect to (99)\n    show\n    broadcast (spawnPlatforms \(@theCharpy\) v) and wait\n    repeat until <(reset \(@theCharpy\)) > [0]>\n        physics (@theCharpy)\n        broadcast (tick \(@theCharpy\) v)\n    end\nend\n\ndefine physics (@theCharpy)\nset size to (scientist.size \(@theCharpy\)) %\nswitch costume to (hitbox \(@thecharpy\) v)\nset [ghost v] effect to (99)\nshow\nif <(pausefornextlevel \(@theCharpy\)) = [0]> then\n    set rotation style [left-right v]\n    if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<mouse down?> and <<(mouse x) < (x position)> and <(touchingBombButton \(@theCharpy\)) = [false]>>>>> then\n        if <(slip+ \(@theCharpy\)) < [0.8]> then\n            change [xv \(@thecharpy\) v] by (-4)\n        else\n            if <[0.9] < (slip+ \(@theCharpy\))> then\n                change [xv \(@thecharpy\) v] by (-0.6)\n            else\n                change [xv \(@thecharpy\) v] by (-1.1)\n            end\n        end\n        point in direction (-90)\n    end\n    if <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<mouse down?> and <<(mouse x) > (x position)> and <(touchingBombButton \(@theCharpy\)) = [false]>>>>> then\n        if <(slip+ \(@theCharpy\)) < [0.8]> then\n            change [xv \(@thecharpy\) v] by (4)\n        else\n            if <[0.9] < (slip+ \(@theCharpy\))> then\n                change [xv \(@thecharpy\) v] by (0.6)\n            else\n                change [xv \(@thecharpy\) v] by (1.1)\n            end\n        end\n        point in direction (90)\n    end\n    set [xv \(@thecharpy\) v] to ((xv \(@theCharpy\)) * (slip+ \(@theCharpy\)))\n    if <([abs v] of (xv \(@theCharpy\)) ) > [0.9]> then\n        xscroll (round (xv \(@theCharpy\))) (@theCharpy)\n    end\n    if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(inair \(@theCharpy\)) < [4]> then\n            set [yv \(@thecharpy\) v] to [10]\n        end\n    end\n    if <(yv \(@theCharpy\)) > [-20]> then\n        change [yv \(@thecharpy\) v] by ((-1.5) + (shouldFloat? \(@theCharpy\)))\n    end\n    yscroll (yv \(@theCharpy\)) (@theCharpy)\n    set [sx \(@thecharpy\) v] to (scientistX \(@theCharpy\))\n    if <(sx \(@theCharpy\)) < [0]> then\n        set [sx \(@thecharpy\) v] to [0]\n    end\n    if <(sx \(@theCharpy\)) > [5761]> then\n        set [sx \(@thecharpy\) v] to [5761]\n    end\n    change [sy \(@thecharpy\) v] by (round (((scientistY \(@theCharpy\)) - (sy \(@theCharpy\))) / (10)))\n    if <(sy \(@theCharpy\)) < [0]> then\n        set [sy \(@thecharpy\) v] to [0]\n    end\n    go to x: ((scientistX \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((scientistY \(@theCharpy\)) - (sy \(@theCharpy\)))\n    if <(scientistY \(@theCharpy\)) < [-170]> then\n        set [reset \(@thecharpy\) v] to [1]\n    end\n    if <(shouldFloat? \(@theCharpy\)) = [1]> then\n        set rotation style [all around v]\n        if <key (space v) pressed?> then\n            change [yv \(@thecharpy\) v] by (1)\n            set [yv \(@thecharpy\) v] to ((yv \(@theCharpy\)) * (0.9))\n        end\n    end\nend\nset [gamespeed \(@thecharpy\) v] to (xv \(@theCharpy\))\n\ndefine yscroll (yset \(@thecharpy\)) (@theCharpy)\nchange [scientisty \(@thecharpy\) v] by (yset \(@thecharpy\))\nchange [inair \(@thecharpy\) v] by (1)\ngo to x: ((scientistX \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((scientistY \(@theCharpy\)) - (sy \(@theCharpy\)))\nrepeat until <not <touching (levels \(@thecharpy\) v)?>>\n    if <(yset \(@thecharpy\)) > [0]> then\n        change [scientisty \(@thecharpy\) v] by (-1)\n    else\n        change [scientisty \(@thecharpy\) v] by (1)\n        set [inair \(@thecharpy\) v] to [0]\n    end\n    go to x: ((scientistX \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((scientistY \(@theCharpy\)) - (sy \(@theCharpy\)))\n    set [yv \(@thecharpy\) v] to [0]\nend\n\ndefine xscroll (xset \(@thecharpy\)) (@theCharpy)\nchange [scientistx \(@thecharpy\) v] by (xset \(@thecharpy\))\ngo to x: ((scientistX \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((scientistY \(@theCharpy\)) - (sy \(@theCharpy\)))\nif <touching (levels \(@thecharpy\) v)?> then\n    repeat (12)\n        change [scientisty \(@thecharpy\) v] by (1)\n        go to x: ((scientistX \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((scientistY \(@theCharpy\)) - (sy \(@theCharpy\)))\n        if <not <touching (levels \(@thecharpy\) v)?>> then\n            stop [this script v]\n        end\n    end\n    change [scientisty \(@thecharpy\) v] by (-12)\n    if <<key (w v) pressed?> or <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>>> then\n        if <(xset \(@thecharpy\)) > [0]> then\n            set [xv \(@thecharpy\) v] to [-16]\n        else\n            set [xv \(@thecharpy\) v] to [16]\n        end\n        set [inair \(@thecharpy\) v] to [0]\n    else\n        set [xv \(@thecharpy\) v] to [0]\n    end\n    repeat until <not <touching (levels \(@thecharpy\) v)?>>\n        if <(xset \(@thecharpy\)) > [0]> then\n            change [scientistx \(@thecharpy\) v] by (-1)\n        else\n            change [scientistx \(@thecharpy\) v] by (1)\n        end\n        go to x: ((scientistX \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((scientistY \(@theCharpy\)) - (sy \(@theCharpy\)))\n    end\nend\n\ndefine next level (@theCharpy)\nbroadcast (next level \(@theCharpy\) v) and wait\n\nwhen I receive [jumpboost \(@thecharpy\) v]\nstart sound [585801__colorscrimsontears__time-travel-future \(@theCharpy\) v]\nset [shouldfloat? \(@thecharpy\) v] to [1]\nwait (8.4) seconds\nstart sound [585800__colorscrimsontears__time-travel-present \(@theCharpy\) v]\nwait (2.2) seconds\nset [shouldfloat? \(@thecharpy\) v] to [0]\n\nwhen I receive [activate \(@thecharpy\) v]\nif <(powerup \(@theCharpy\)) = [shrink]> then\n    broadcast (shrink \(@theCharpy\) v)\nelse\n    if <(powerup \(@theCharpy\)) = [slide]> then\n        broadcast (speedboost \(@theCharpy\) v)\n    else\n        if <(powerup \(@theCharpy\)) = [float]> then\n            broadcast (jumpboost \(@theCharpy\) v)\n        end\n    end\nend\n\nwhen [r v] key pressed\nset [reset \(@thecharpy\) v] to [1]\n\nwhen I receive [shrink \(@thecharpy\) v]\nset [scientist.size \(@thecharpy\) v] to [50]\nwait (10) seconds\nrepeat (10)\n    change [scientist.size \(@thecharpy\) v] by (((100) - (scientist.size \(@theCharpy\))) / (4))\nend\nset [scientist.size \(@thecharpy\) v] to [100]\n\nwhen I receive [speedboost \(@thecharpy\) v]\nset [slip+ \(@thecharpy\) v] to [0.98]\nwait (10) seconds\nset [slip+ \(@thecharpy\) v] to [0.85]\n\nwhen [e v] key pressed\nif <(username) = [theCharpy]> then\n    ask [what xpos?] and wait\n    set [admin_testsave \(@thecharpy\) v] to (answer)\n    ask [what ypos?] and wait\n    xscroll (admin_testSave \(@theCharpy\)) (@theCharpy)\n    yscroll (answer) (@theCharpy)\nend\n\nwhen [f v] key pressed\nif <(username) = [theCharpy]> then\n    xscroll (px \(@theCharpy\)) (@theCharpy)\n    yscroll (py \(@theCharpy\)) (@theCharpy)\nend\n\nwhen I receive [start game \(@thecharpy\) v]\nforever\n    if <(reset \(@theCharpy\)) = [0]> then\n        if <touching (portal \(@thecharpy\) v)?> then\n            set [pausefornextlevel \(@thecharpy\) v] to [1]\n            broadcast (next level \(@theCharpy\) v)\n            set [reset \(@thecharpy\) v] to [1]\n            wait until <(pausefornextlevel \(@theCharpy\)) = [0]>\n            set [reset \(@thecharpy\) v] to [1]\n            hide\n        end\n    end\nend\n\n@player art (@theCharpy)\n\ndefine animate (@theCharpy)\nset size to (scientist.size \(@theCharpy\)) %\nif <(animation \(@theCharpy\)) = [run]> then\n    next costume\n    if <not < (costume [name v]) contains [run]?>> then\n        switch costume to (run1 \(@thecharpy\) v)\n    end\nelse\n    if <(animation \(@theCharpy\)) = [jump]> then\n        switch costume to (jump \(@thecharpy\) v)\n    else\n        if <(animation \(@theCharpy\)) = [fall]> then\n            switch costume to (fall \(@thecharpy\) v)\n        else\n            if <(animation \(@theCharpy\)) = [idle]> then\n                switch costume to (idle \(@thecharpy\) v)\n            else\n                switch costume to (idle \(@thecharpy\) v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start game \(@thecharpy\) v]\nshow\nset rotation style [left-right v]\nset [animation \(@thecharpy\) v] to [idle]\ngo to [front v] layer\nforever\n    if <<<touching color (#adadad)?> or <touching color (#c7c7c7)?>> or <touching color (#29ff00)?>> then\n        set [reset \(@thecharpy\) v] to [1]\n    end\n    if <<<touching color (#9966ff)?> or <touching color (#29ff00)?>> or <touching color (#00ceff)?>> then\n        set [reset \(@thecharpy\) v] to [1]\n    end\n    go to (player hitbox \(@thecharpy\) v)\n    point in direction ([direction v] of [player hitbox \(@thecharpy\) v])\n    if <([yv \(@thecharpy\) v] of [player hitbox \(@thecharpy\) v]) > [0]> then\n        set [animation \(@thecharpy\) v] to [jump]\n    else\n        if <<not <key (up arrow v) pressed?>> and <<<key (a v) pressed?> or <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>>> or <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>>>>> then\n            set [animation \(@thecharpy\) v] to [run]\n        else\n            if <[0] > ([yv \(@thecharpy\) v] of [player hitbox \(@thecharpy\) v])> then\n                set [animation \(@thecharpy\) v] to [fall]\n            else\n                set [animation \(@thecharpy\) v] to [idle]\n            end\n        end\n    end\n    animate (@theCharpy)\nend\n\nwhen this sprite clicked\nset [reset \(@thecharpy\) v] to [1]\n\nwhen [r v] key pressed\nset [reset \(@thecharpy\) v] to [1]\n\nwhen flag clicked\nset [detector: love/fave.counter \(@thecharpy\) v] to [0]\nwait until <(detector: love/fave.counter \(@theCharpy\)) = [2]>\nset [ghost v] effect to (50)\n\nwhen flag clicked\nforever\n    if <(shouldFloat? \(@theCharpy\)) = [0]> then\n        wait until <(animation \(@theCharpy\)) = [jump]>\n        play sound [Jump v] until done\n    end\nend\n\n@portal (@theCharpy)\n\nwhen I start as a clone\nmap portal pos (px \(@theCharpy\)) (py \(@theCharpy\)) (@theCharpy)\nif <(costume [name v]) = [portalbase \(@theCharpy\)]> then\n    forever\n        turn right (1) degrees\n        go to x: (((-0.5) * (((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (1))) + ()) y: ((((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (1)) + ())\n        map portal pos (x position) (y position) (@theCharpy)\n    end\nend\nif <(costume [name v]) = [portalin1 \(@theCharpy\)]> then\n    forever\n        turn right (-1) degrees\n        go to x: (((0.5) * (((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (1))) + ()) y: ((((([sin v] of (sin \(@theCharpy\)) ) * (-2)) * (2)) * (0.5)) + ())\n        map portal pos (x position) (y position) (@theCharpy)\n    end\nend\nif <(costume [name v]) = [portalin2 \(@theCharpy\)]> then\n    forever\n        turn right (1) degrees\n        go to x: (((0.5) * (((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (1))) + ()) y: ((((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (0.5)) + ())\n        map portal pos (x position) (y position) (@theCharpy)\n    end\nend\nif <(costume [name v]) = [portalin3 \(@theCharpy\)]> then\n    forever\n        turn right (-1) degrees\n        go to x: (((0.5) * (((([cos v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (2))) + ()) y: ((((([sin v] of (sin \(@theCharpy\)) ) * (-2)) * (2)) * (0.5)) + ())\n        map portal pos (x position) (y position) (@theCharpy)\n    end\nend\nif <(costume [name v]) = [portalcenter \(@theCharpy\)]> then\n    forever\n        turn right (1) degrees\n        go to x: (((-1) * (((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (1))) + ()) y: ((((([sin v] of (sin \(@theCharpy\)) ) * (2)) * (2)) * (0.5)) + ())\n        map portal pos (x position) (y position) (@theCharpy)\n    end\nend\n\nwhen flag clicked\nset [sin \(@thecharpy\) v] to [0]\nforever\n    change [sin \(@thecharpy\) v] by (5)\n    if <(level \(@theCharpy\)) = [1]> then\n        set [px \(@thecharpy\) v] to [2100]\n        set [py \(@thecharpy\) v] to [150]\n    else\n        if <(level \(@theCharpy\)) = [2]> then\n            set [px \(@thecharpy\) v] to [1740]\n            set [py \(@thecharpy\) v] to [50]\n        else\n            if <(level \(@theCharpy\)) = [3]> then\n                set [px \(@thecharpy\) v] to [867]\n                set [py \(@thecharpy\) v] to [130]\n            else\n                set [px \(@thecharpy\) v] to [1430]\n                set [py \(@thecharpy\) v] to [670]\n            end\n        end\n    end\nend\n\nwhen I receive [tick \(@thecharpy\) v]\ngo to x: (((portalX \(@theCharpy\)) - (sx \(@theCharpy\))) + (px \(@theCharpy\))) y: (((portalY \(@theCharpy\)) - (sy \(@theCharpy\))) + (py \(@theCharpy\)))\nif <<(round (x position)) = (round (((portalX \(@theCharpy\)) - (sx \(@theCharpy\))) + (px \(@theCharpy\))))> and <(round (y position)) = (round (((portalY \(@theCharpy\)) - (sy \(@theCharpy\))) + (py \(@theCharpy\))))>> then\n    show\nelse\n    hide\nend\n\ndefine create portal (@theCharpy)\nshow\nset size to (150) %\nswitch costume to (portalbase \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nswitch costume to (portalin1 \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nswitch costume to (portalin2 \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nswitch costume to (portalin3 \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nswitch costume to (portalcenter \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nhide\n\ndefine map portal pos (x \(@thecharpy\)) (y \(@thecharpy\)) (@theCharpy)\nset [portalx \(@thecharpy\) v] to (x \(@thecharpy\))\nset [portaly \(@thecharpy\) v] to (y \(@thecharpy\))\n\nwhen flag clicked\nwait (5) seconds\ncreate portal (@theCharpy)\n\n@transition (@theCharpy)\n\nwhen flag clicked\nhide\n\nwhen I receive [next level \(@thecharpy\) v]\nplay sound [Connect v] until done\nchange [level \(@thecharpy\) v] by (1)\nset [brightness v] effect to (-1)\nshow\nswitch costume to (door1 \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nswitch costume to (door2 \(@thecharpy\) v)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nif <(costume [number v]) = [1]> then\n    go to x: (-220) y: (0)\n    set [door.v \(@thecharpy\) v] to [0]\n    repeat until <(x position) > (round (0))>\n        change [door.v \(@thecharpy\) v] by (1)\n    end\n    set [door.v \(@thecharpy\) v] to [-10]\n    wait until <not <(x position) > (round (0))>>\n    repeat until <(x position) > (round (0))>\n        change [door.v \(@thecharpy\) v] by (1)\n    end\n    set [door.v \(@thecharpy\) v] to [-5]\n    wait until <not <(x position) > (round (0))>>\n    repeat until <(x position) > (round (0))>\n        change [door.v \(@thecharpy\) v] by (1)\n    end\n    set [door.v \(@thecharpy\) v] to [-2]\n    wait until <not <(x position) > (round (0))>>\n    repeat until <(x position) > (round (0))>\n        change [door.v \(@thecharpy\) v] by (1)\n    end\n    go to x: (0) y: (0)\n    set [door.v \(@thecharpy\) v] to [0]\n    set [pausefornextlevel \(@thecharpy\) v] to [0]\n    wait (0.5) seconds\n    repeat (30)\n        change [door.v \(@thecharpy\) v] by (-0.6)\n    end\n    delete this clone\nend\nif <(costume [number v]) = [2]> then\n    go to x: (220) y: (0)\n    set [door.v \(@thecharpy\) v] to [0]\n    repeat until <(round (0)) > (x position)>\n        change [door.v \(@thecharpy\) v] by (-1)\n    end\n    set [door.v \(@thecharpy\) v] to [10]\n    wait until <not <(round (0)) > (x position)>>\n    repeat until <(round (0)) > (x position)>\n        change [door.v \(@thecharpy\) v] by (-1)\n    end\n    set [door.v \(@thecharpy\) v] to [5]\n    wait until <not <(round (0)) > (x position)>>\n    repeat until <(round (0)) > (x position)>\n        change [door.v \(@thecharpy\) v] by (-1)\n    end\n    set [door.v \(@thecharpy\) v] to [2]\n    wait until <not <(round (0)) > (x position)>>\n    repeat until <(round (0)) > (x position)>\n        change [door.v \(@thecharpy\) v] by (-1)\n    end\n    go to x: (0) y: (0)\n    set [door.v \(@thecharpy\) v] to [0]\n    wait (0.5) seconds\n    repeat (30)\n        change [door.v \(@thecharpy\) v] by (0.6)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nset [costume \(@thecharpy\) v] to (costume [number v])\ngo to [front v] layer\nforever\n    go to [front v] layer\n    switch costume to (pos hack \(@thecharpy\) v)\n    change x by (door.v \(@theCharpy\))\n    switch costume to (costume \(@theCharpy\))\nend\n\n@enemies (@theCharpy)\n\ndefine spawn enemy at x: (x \(@thecharpy\)) y: (y \(@thecharpy\)) with range: (mrange \(@thecharpy\)) || (@theCharpy)\nset [enemyx \(@thecharpy\) v] to (x \(@thecharpy\))\nset [enemyy \(@thecharpy\) v] to (y \(@thecharpy\))\nset [enemymotionrange \(@thecharpy\) v] to (mrange \(@thecharpy\))\ncreate clone of (_myself_ v)\n\nwhen I receive [tick \(@thecharpy\) v]\npos ((enemyX \(@theCharpy\)) - (sx \(@theCharpy\))) ((enemyY \(@theCharpy\)) - (sy \(@theCharpy\))) (@theCharpy)\n\ndefine pos (x \(@thecharpy\)) (y \(@thecharpy\)) (@theCharpy)\nset size to (25) %\ngo to x: (round (x \(@thecharpy\))) y: (round (y \(@thecharpy\)))\nif <<(round (x \(@thecharpy\))) = (round (x position))> and <(round (y \(@thecharpy\))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen I start as a clone\nswitch costume to (enemy \(@thecharpy\) v)\nforever\n    if <touching (shockwaves \(@thecharpy\) v)?> then\n        set [oldsx \(@thecharpy\) v] to (sx \(@theCharpy\))\n        set [oldsy \(@thecharpy\) v] to (sy \(@theCharpy\))\n        set [ogx \(@thecharpy\) v] to ((enemyX \(@theCharpy\)) - (sx \(@theCharpy\)))\n        set [ogy \(@thecharpy\) v] to ((enemyY \(@theCharpy\)) - (sy \(@theCharpy\)))\n        repeat until <<(round ((enemyX \(@theCharpy\)) - (sx \(@theCharpy\)))) = (round (bombX \(@theCharpy\)))> and <(round ((enemyY \(@theCharpy\)) - (sy \(@theCharpy\)))) = (round (bombY \(@theCharpy\)))>>\n            change [enemyx \(@thecharpy\) v] by (((bombX \(@theCharpy\)) - ((enemyX \(@theCharpy\)) - (sx \(@theCharpy\)))) / (8))\n            change [enemyy \(@thecharpy\) v] by (((bombY \(@theCharpy\)) - ((enemyY \(@theCharpy\)) - (sy \(@theCharpy\)))) / (8))\n        end\n        repeat (25)\n            change [ghost v] effect by (4)\n        end\n        delete this clone\n    else\n        change [enemyx \(@thecharpy\) v] by ((((([cos v] of (sin \(@theCharpy\)) ) * (1)) * (1)) * (2)) * (enemymotionrange \(@theCharpy\)))\n    end\nend\n\nwhen I receive [reset \(@thecharpy\) v]\ndelete this clone\n\nspawn enemy at x: [1560] y: [140] with range: [1.3] || (@theCharpy)\n\nwhen I receive [spawnplatforms \(@thecharpy\) v]\nswitch costume to (blank \(@thecharpy\) v)\nhide\nif <(level \(@theCharpy\)) = [1]> then\n    spawn enemy at x: [1560] y: [100] with range: [1.3] || (@theCharpy)\nelse\n    if <(level \(@theCharpy\)) = [3]> then\n        spawn enemy at x: [150] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [200] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [250] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [400] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [450] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [500] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [650] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [700] y: [90] with range: [1] || (@theCharpy)\n        spawn enemy at x: [750] y: [90] with range: [1] || (@theCharpy)\n    else\n        if <(level \(@theCharpy\)) = [4]> then\n            spawn enemy at x: [150] y: [90] with range: [1] || (@theCharpy)\n            spawn enemy at x: [200] y: [90] with range: [1] || (@theCharpy)\n            spawn enemy at x: [250] y: [90] with range: [1] || (@theCharpy)\n        end\n    end\nend\n\nwhen flag clicked\nset [timer \(@thecharpy\) v] to [0]\nforever\n    wait (1) seconds\n    change [timer \(@thecharpy\) v] by (1)\nend\n\ndefine point towards coords: ( (x \(@thecharpy\)) , (y \(@thecharpy\)) ) || (@theCharpy)\npoint in direction (([atan v] of (((x \(@thecharpy\)) - (x position)) / ((y \(@thecharpy\)) - (y position))) ) + ((180) * <(y \(@thecharpy\)) < (y position)>))\n\nspawn enemy at x: [600] y: [90] with range: [1] || (@theCharpy)\nspawn enemy at x: [650] y: [90] with range: [1] || (@theCharpy)\nspawn enemy at x: [700] y: [90] with range: [1] || (@theCharpy)\n\nwait (3) seconds\n\n@slippery slide (@theCharpy)\n\nwhen flag clicked\nset [canuseslide? \(@thecharpy\) v] to [1]\nset [powerup \(@thecharpy\) v] to []\ngo to x: (-40) y: (-145)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((110) - (size)) / (3))\n        if <(canUseSlide? \(@theCharpy\)) = [1]> then\n            if <mouse down?> then\n                set [powerup \(@thecharpy\) v] to [slide]\n                set [canuseslide? \(@thecharpy\) v] to [0]\n                broadcast (StartCounterSpeed \(@theCharpy\) v)\n                broadcast (activate \(@theCharpy\) v)\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [startcounterspeed \(@thecharpy\) v]\nwait (20) seconds\nset [canuseslide? \(@thecharpy\) v] to [1]\n\nwhen flag clicked\nforever\n    if <(canUseSlide? \(@theCharpy\)) = [1]> then\n        set [brightness v] effect to (0)\n    else\n        set [brightness v] effect to (-20)\n    end\nend\n\nwhen [z v] key pressed\nset [powerup \(@thecharpy\) v] to [slide]\nset [canuseslide? \(@thecharpy\) v] to [0]\nbroadcast (StartCounterSpeed \(@theCharpy\) v)\nbroadcast (activate \(@theCharpy\) v)\n\n@float (@theCharpy)\n\nwhen flag clicked\ngo to x: (-120) y: (-145)\nset [canusejump \(@thecharpy\) v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((110) - (size)) / (3))\n        if <mouse down?> then\n            if <(canUseJump \(@theCharpy\)) = [1]> then\n                set [powerup \(@thecharpy\) v] to [float]\n                set [canusejump \(@thecharpy\) v] to [0]\n                broadcast (activate \(@theCharpy\) v)\n                broadcast (startJumpCounter \(@theCharpy\) v)\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [startjumpcounter \(@thecharpy\) v]\nwait (20) seconds\nset [canusejump \(@thecharpy\) v] to [1]\n\nwhen flag clicked\nforever\n    if <(canUseJump \(@theCharpy\)) = [1]> then\n        set [brightness v] effect to (0)\n    else\n        set [brightness v] effect to (-20)\n    end\nend\n\nwhen [x v] key pressed\nif <(canUseJump \(@theCharpy\)) = [1]> then\n    set [powerup \(@thecharpy\) v] to [float]\n    set [canusejump \(@thecharpy\) v] to [0]\n    broadcast (activate \(@theCharpy\) v)\n    broadcast (startJumpCounter \(@theCharpy\) v)\nend\n\n@VortexBomb (@theCharpy)\n\nwhen flag clicked\ngo to x: (-200) y: (-145)\nset [canusebomb? \(@thecharpy\) v] to [1]\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((110) - (size)) / (3))\n        if <(canUseBomb? \(@theCharpy\)) = [1]> then\n            if <mouse down?> then\n                set [powerup \(@thecharpy\) v] to [bomb]\n                set [canusebomb? \(@thecharpy\) v] to [0]\n                broadcast (vortextbomb \(@theCharpy\) v)\n                broadcast (StartCounterBomb \(@theCharpy\) v)\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [startcounterbomb \(@thecharpy\) v]\nwait (10) seconds\nset [canusebomb? \(@thecharpy\) v] to [1]\n\nwhen flag clicked\nforever\n    if <(canUseBomb? \(@theCharpy\)) = [1]> then\n        set [brightness v] effect to (0)\n    else\n        set [brightness v] effect to (-20)\n    end\nend\n\nwhen flag clicked\nforever\n    set [touchingbombbutton \(@thecharpy\) v] to <touching (mouse-pointer v)?>\nend\n\nwhen [c v] key pressed\nif <(canUseBomb? \(@theCharpy\)) = [1]> then\n    set [powerup \(@thecharpy\) v] to [bomb]\n    set [canusebomb? \(@thecharpy\) v] to [0]\n    broadcast (vortextbomb \(@theCharpy\) v)\n    broadcast (StartCounterBomb \(@theCharpy\) v)\nend\n\n@Shrink (@theCharpy)\n\nwhen flag clicked\nset [canuseshrink? \(@thecharpy\) v] to [1]\ngo to x: (40) y: (-145)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((110) - (size)) / (3))\n        if <(canUseShrink? \(@theCharpy\)) = [1]> then\n            if <mouse down?> then\n                set [powerup \(@thecharpy\) v] to [shrink]\n                set [canuseshrink? \(@thecharpy\) v] to [0]\n                broadcast (startShrinkCounter \(@theCharpy\) v)\n                broadcast (activate \(@theCharpy\) v)\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        change size by (((100) - (size)) / (3))\n    end\nend\n\nwhen I receive [startcounterspeed \(@thecharpy\) v]\nwait (20) seconds\nset [canuseshrink? \(@thecharpy\) v] to [1]\n\nwhen flag clicked\nforever\n    if <(canUseShrink? \(@theCharpy\)) = [1]> then\n        set [brightness v] effect to (0)\n    else\n        set [brightness v] effect to (-20)\n    end\nend\n\nwhen [v v] key pressed\nif <(canUseShrink? \(@theCharpy\)) = [1]> then\n    set [powerup \(@thecharpy\) v] to [shrink]\n    set [canuseshrink? \(@thecharpy\) v] to [0]\n    broadcast (startShrinkCounter \(@theCharpy\) v)\n    broadcast (activate \(@theCharpy\) v)\nend\n\n@bomb (@theCharpy)\n\nwhen I start as a clone\nstart sound [Clang \(@theCharpy\) v]\nset [bomb.x \(@thecharpy\) v] to (sx \(@theCharpy\))\nset [bomb.y \(@thecharpy\) v] to (sy \(@theCharpy\))\nshow\nif <([direction v] of [player hitbox \(@thecharpy\) v]) = [90]> then\n    set [bomb.yv \(@thecharpy\) v] to [5]\n    set [bomb.xv \(@thecharpy\) v] to [6]\n    repeat until <touching (levels \(@thecharpy\) v)?>\n        turn right (2) degrees\n        change [bomb.yv \(@thecharpy\) v] by (-0.5)\n    end\n    set [bomb.yv \(@thecharpy\) v] to [0]\n    set [bomb.xv \(@thecharpy\) v] to [0]\n    start sound [i forgor the name rip :c from freesound.org \(@theCharpy\) v]\n    broadcast (explode \(@theCharpy\) v)\n    wait until <(endbomb \(@theCharpy\)) = [1]>\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (5)\n    end\n    set [endbomb \(@thecharpy\) v] to [0]\n    wait (7) seconds\n    delete this clone\nelse\n    set [bomb.yv \(@thecharpy\) v] to [5]\n    set [bomb.xv \(@thecharpy\) v] to [-6]\n    repeat until <touching (levels \(@thecharpy\) v)?>\n        turn right (-2) degrees\n        change [bomb.yv \(@thecharpy\) v] by (-0.5)\n    end\n    set [bomb.yv \(@thecharpy\) v] to [0]\n    set [bomb.xv \(@thecharpy\) v] to [0]\n    broadcast (explode \(@theCharpy\) v)\n    wait until <(endbomb \(@theCharpy\)) = [1]>\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (5)\n    end\n    set [endbomb \(@thecharpy\) v] to [0]\n    wait (7) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nforever\n    go [forward v] (1) layers\n    change [bomb.x \(@thecharpy\) v] by (bomb.xv \(@theCharpy\))\n    change [bomb.y \(@thecharpy\) v] by (bomb.yv \(@theCharpy\))\n    switch costume to (pos hack \(@thecharpy\) v)\n    go to x: ((bomb.x \(@theCharpy\)) - (sx \(@theCharpy\))) y: ((bomb.y \(@theCharpy\)) - (sy \(@theCharpy\)))\n    switch costume to (bomb1 v)\n    set [bombx \(@thecharpy\) v] to ((bomb.x \(@theCharpy\)) - (sx \(@theCharpy\)))\n    set [bomby \(@thecharpy\) v] to ((bomb.y \(@theCharpy\)) - (sy \(@theCharpy\)))\nend\n\nwhen I receive [vortextbomb \(@thecharpy\) v]\nshow\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset size to (100) %\nswitch costume to (blank \(@thecharpy\) v)\nshow\n\nwhen I receive [reset \(@thecharpy\) v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@shockwaves (@theCharpy)\n\nwhen flag clicked\nset [endbomb \(@thecharpy\) v] to [0]\nhide\n\nwhen I receive [explode \(@thecharpy\) v]\nset [endbomb \(@thecharpy\) v] to [0]\nset [timer \(@thecharpy\) v] to [0]\nrepeat until <(timer \(@theCharpy\)) = [5]>\n    create clone of (_myself_ v)\n    wait (0.2) seconds\nend\nset [timer \(@thecharpy\) v] to [0]\nset [endbomb \(@thecharpy\) v] to [1]\n\nwhen I start as a clone\ngo to [back v] layer\nforever\n    switch costume to (pos hack \(@thecharpy\) v)\n    go to x: (bombX \(@theCharpy\)) y: (bombY \(@theCharpy\))\n    switch costume to (shockwave \(@thecharpy\) v)\nend\n\nwhen I start as a clone\nshow\nset size to (0) %\nrepeat (50)\n    change size by (8)\n    change [ghost v] effect by (2)\nend\ndelete this clone\n\nwhen I receive [reset \(@thecharpy\) v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@detector (@theCharpy)\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\nset [detector: love/fave.counter \(@thecharpy\) v] to [0]\nforever\n    set [detector: l/f.sensing \(@thecharpy\) v] to [none]\n    [love \(@theCharpy\)] [-201] [-220] (@theCharpy)\n    [fave \(@theCharpy\)] [-201] [-220] (@theCharpy)\nend\n\ndefine (l/f) (x) (y) (@theCharpy)\nswitch costume to (blank \(@thecharpy\) v)\nset size to (9999999999999) %\ngo to x: (x) y: (y)\nset size to (100) %\nswitch costume to (l/f)\nif <touching (mouse-pointer v)?> then\n    set [detector: l/f.sensing \(@thecharpy\) v] to (costume [name v])\nend\n\nwhen flag clicked\nforever\n    wait until <(detector: l/f.sensing \(@theCharpy\)) = [love \(@theCharpy\)]>\n    wait (0.2) seconds\n    if <(detector: l/f.sensing \(@theCharpy\)) = [love \(@theCharpy\)]> then\n        change [detector: love/fave.counter \(@thecharpy\) v] by (1)\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait until <(detector: l/f.sensing \(@theCharpy\)) = [fave \(@theCharpy\)]>\n    wait (0.2) seconds\n    if <(detector: l/f.sensing \(@theCharpy\)) = [fave \(@theCharpy\)]> then\n        change [detector: love/fave.counter \(@thecharpy\) v] by (1)\n        stop [this script v]\n    end\nend\n\n@popup (@theCharpy)\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nclear graphic effects\nforever\n    go to [front v] layer\nend\n\nwhen this sprite clicked\nclear graphic effects\nshow\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nclear graphic effects\nwait until <mouse down?>\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\n@levelsart (@theCharpy)\n\nwhen I receive [tick \(@thecharpy\) v]\npos ((levelX \(@theCharpy\)) - (sx \(@theCharpy\))) ((levelY \(@theCharpy\)) - (sy \(@theCharpy\))) (@theCharpy)\n\nif <(level \(@theCharpy\)) = [5]> then\n\ndefine pos (x \(@thecharpy\)) (y \(@thecharpy\)) (@theCharpy)\ngo to x: (round (x \(@thecharpy\))) y: (round (y \(@thecharpy\)))\nif <<(round (x \(@thecharpy\))) = (round (x position))> and <(round (y \(@thecharpy\))) = (round (y position))>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset \(@thecharpy\) v]\ndelete this clone\n\ndefine spawn platform at x: (x \(@thecharpy\)) y: (y \(@thecharpy\)) platform#: (costume# \(@thecharpy\)) (@theCharpy)\nswitch costume to (costume# \(@thecharpy\))\nset [levelx \(@thecharpy\) v] to (x \(@thecharpy\))\nset [levely \(@thecharpy\) v] to (y \(@thecharpy\))\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nset [brightness v] effect to (-1)\nhide\n\nwhen I receive [spawnplatforms \(@thecharpy\) v]\nhide\nset [levelx \(@thecharpy\) v] to [0]\nset [levely \(@thecharpy\) v] to [0]\nif <(level \(@theCharpy\)) = [1]> then\n    spawn platform at x: [0] y: [0] platform#: [1] (@theCharpy)\n    spawn platform at x: [480] y: [0] platform#: [2] (@theCharpy)\n    spawn platform at x: [1000] y: [270] platform#: [3] (@theCharpy)\n    spawn platform at x: [1600] y: [50] platform#: [4] (@theCharpy)\nelse\n    if <(level \(@theCharpy\)) = [2]> then\n        spawn platform at x: [0] y: [0] platform#: [5] (@theCharpy)\n        spawn platform at x: [480] y: [0] platform#: [6] (@theCharpy)\n        spawn platform at x: [1000] y: [270] platform#: [7] (@theCharpy)\n        spawn platform at x: [1600] y: [50] platform#: [8] (@theCharpy)\n    else\n        if <(level \(@theCharpy\)) = [3]> then\n            spawn platform at x: [0] y: [0] platform#: [9] (@theCharpy)\n            spawn platform at x: [480] y: [0] platform#: [10] (@theCharpy)\n            spawn platform at x: [1000] y: [270] platform#: [11] (@theCharpy)\n            spawn platform at x: [1600] y: [50] platform#: [12] (@theCharpy)\n        else\n            if <(level \(@theCharpy\)) = [4]> then\n                spawn platform at x: [0] y: [0] platform#: [13] (@theCharpy)\n                spawn platform at x: [480] y: [0] platform#: [14] (@theCharpy)\n                spawn platform at x: [1000] y: [270] platform#: [15] (@theCharpy)\n                spawn platform at x: [1600] y: [50] platform#: [16] (@theCharpy)\n            else\n                stop [all v]\n            end\n        end\n    end\nend\n\nwhen flag clicked\nset [level \(@thecharpy\) v] to [1]\n\nwhen I start as a clone\n\n