Black & White - A Physics Platformer + Editor

Instructions:                           ^_^ Black & White ^_^\n                        @DuckGoose9254 2020\n=========================================\n- Press start to play!\n- Arrow keys or WASD to move!\n- Press the editor or E to edit the levels!\n- Editor instructions are in the game :)\n- Press F to show and hide the FPS counter\n- Press R to reset the project easier and faster!\n- Press the Volume button or V to turn on and off the volume\n\nPlease no advertising.\n=========================================\nV0.1 - Released\nV0.2 - Fixed the ghosts effects with the UI and fixed some grammar errors\nV0.3 - Added 5 new levels, a new LAKEY INSPIRED song, a walking animation to the cat, and added sound effects to the cat\nV0.4 - Fixed the FPS counter, fixed up level 2, made it so you press E to open editor inside of L, made it so you press any key to start, and made the start button size up and down\nV0.5 - Made the cat say more important things, added clicking sounds to a lot of things, and made it so you only need to press F to show the FPS counter

@Stage\n\nwhen I receive [reset v]\nhide variable [mouse v]\nbroadcast (FPS On v)\n\nwhen flag clicked\nforever\n    play sound (pick random (1) to (4)) until done\nend\n\nwhen flag clicked\nhide variable [fps v]\nhide variable [mouse v]\nforever\n    if <(Volume) = [1]> then\n        set volume to (100) %\n    else\n        set volume to (0) %\n    end\nend\n\nwhen I receive [reset v]\nforever\n    if <key (r v) pressed?> then\n        broadcast (Show sign v)\n        broadcast (Reset v) and wait\n    end\nend\n\nwhen flag clicked\nforever\n    change [counter v] by (1)\n    if <(timer) > [1]> then\n        set [fps v] to (Counter)\n        set [counter v] to [0]\n        reset timer\n    end\nend\n\nwhen I receive [fps on v]\nforever\n    if <key (f v) pressed?> then\n        show variable [fps v]\n        wait until <not <key (f v) pressed?>>\n        wait until <key (f v) pressed?>\n        hide variable [fps v]\n        wait until <not <key (f v) pressed?>>\n    end\nend\n\nwhen [m v] key pressed\nif <([abs v] of (mouse x) ) < [240]> then\n    show variable [mouse v]\n    set [mouse v] to (join (mouse x) (join [,] (mouse y)))\nelse\n    hide variable [mouse v]\nend\n\n@Physics\n\nwhen I receive [reset v]\nset [walk v] to [2]\nforever\n    change [walk v] by (1)\n    if <(Walk) > [4]> then\n        set [walk v] to [2]\n    end\n    wait (0.1) seconds\nend\n\ndefine Turn\nchange x by (20)\nif <not <touching color (#0f0f0f)?>> then\n    change [direction v] by (3)\n    change [xv v] by (.3)\nend\nchange x by (-40)\nif <not <touching color (#0f0f0f)?>> then\n    change [direction v] by (-3)\n    change [xv v] by (-.3)\nend\nchange x by (20)\nturn right (4) degrees\nif <not <touching color (#0f0f0f)?>> then\n    change [direction v] by (1)\nend\nturn left (8) degrees\nif <not <touching color (#0f0f0f)?>> then\n    change [direction v] by (-1)\nend\nturn right (4) degrees\nturn right (20) degrees\nif <not <touching color (#0f0f0f)?>> then\n    change [direction v] by (2)\nend\nturn left (40) degrees\nif <not <touching color (#0f0f0f)?>> then\n    change [direction v] by (-2)\nend\nturn right (20) degrees\n\ndefine Physics (friction) (stiffness)\nswitch costume to (hit box v)\nset rotation style [don't rotate v]\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [xv v] by (1)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [xv v] by (-1)\nend\nif <not <touching color (#0e0e0e)?>> then\n    change [yv v] by (-0.8)\nend\nchange y by (YV)\nif <touching color (#0f0f0f)?> then\n    repeat ([abs v] of ([ceiling v] of (YV) ) )\n        change y by (((([abs v] of (YV) ) / (YV)) * <touching color (#0f0f0f)?>) * (-1))\n    end\n    if <<(([abs v] of (YV) ) / (YV)) = [-1]> and <<key (up arrow v) pressed?> or <key (w v) pressed?>>> then\n        start sound [Woosh-Mark_DiAngelo-4778593.mp3 v]\n        set [yv v] to [14]\n    else\n        set [yv v] to [0]\n    end\nend\nset [xv v] to ((XV) * (friction))\nchange x by (XV)\nif <touching color (#0f0f0f)?> then\n    set [slope v] to [0]\n    repeat until <<(Slope) = [-8]> or <not <touching color (#0f0f0f)?>>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\n    if <(Slope) = [-8]> then\n        change y by ((Slope) * (-1))\n        repeat ([abs v] of ([ceiling v] of (XV) ) )\n            change x by (((([abs v] of (XV) ) / (XV)) * <touching color (#0f0f0f)?>) * (-1))\n        end\n        set [xv v] to [0]\n    end\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> then\n    switch costume to (Walk)\nelse\n    switch costume to (1 v)\nend\nset rotation style [all around v]\nturn right (Direction) degrees\nset [direction v] to ((Direction) * (stiffness))\nset [xv v] to ((XV) * (friction))\nTurn\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nshow\nset size to (100) %\npoint in direction (90)\ngo to x: (-190) y: (-90)\nset [direction v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset [level v] to [1]\nset [cat state v] to [1]\nforever\n    if <(Cat state) = [1]> then\n        broadcast (Check Cats set v)\n        Physics [.95] [.6]\n    else\n        if <key (space v) pressed?> then\n            set x to ((x position) + (((mouse x) - (x position)) / (4)))\n            set y to ((y position) + (((mouse y) - (y position)) / (4)))\n            broadcast (Check Cats set v)\n        end\n    end\nend\n\nwhen I receive [reset v]\nforever\n    if <(Mode?) = [Debugging]> then\n        if <key (z v) pressed?> then\n            change size by (-1)\n        end\n        if <(size) < [49]> then\n            set size to (50) %\n        end\n        if <key (x v) pressed?> then\n            change size by (1)\n        end\n        if <(size) > [199]> then\n            set size to (200) %\n        end\n    end\nend\n\nwhen I receive [reset v]\nforever\n    if <(Mode?) = [Not Debugging]> then\n        if <(Level) < [2]> then\n        if <(Level) > [9]> then\n    end\nend\n\nwhen I receive [check cats set v]\nforever\n    if <(Mode?) = [Debugging]> then\n        wait until <not <key (space v) pressed?>>\n        set [cat state v] to [0]\n    else\n        set [cat state v] to [1]\n    end\nend\n\nwhen I receive [start v]\nbroadcast (Reset v) and wait\n\nwhen I receive [talk cat v]\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [reset v]\nforever\n    if <(Mode?) = [Not Debugging]> then\n        if <touching color (#d83030)?> then\n            point in direction (90)\n            go to x: (-190) y: (-90)\n        end\n    end\nend\n\nwhen I receive [reset v]\nforever\n    if <(Cat state) = [1]> then\n        if <<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<key (left arrow v) pressed?> or <key (a v) pressed?>>> and <touching color (#0a0a0a)?>> then\n            play sound (pick random (2) to (3)) until done\n        end\n    else\n    end\nend\n\n@Ground\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nshow\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Level Count\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    set size to (120) %\n    go to x: (((Digits) * (17)) - (240)) y: (160)\n    if <(length of (Level)) < (Digits)> then\n        hide\n    else\n        show\n        switch costume to (letter (Digits) of (Level))\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(distance to [physics v]) < [50]> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\nhide\nset [digits v] to [1]\nrepeat (30)\n    create clone of (_myself_ v)\n    change [digits v] by (1)\nend\nhide\n\n@grunge\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\ngo to [front v] layer\nset [ghost v] effect to (96)\n\nwhen I receive [reset v]\nhide\n\n@Lava\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@Editor button\n\nwhen I receive [reset v]\nshow\nset [mode? v] to [Not Debugging]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (30)\n        if <mouse down?> then\n            next costume\n            start sound [Click v]\n            broadcast (Show sign v)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [ghost v] effect to (10)\n    end\n    if <key (e v) pressed?> then\n        next costume\n        start sound [Click v]\n        broadcast (Show sign v)\n        wait until <not <key (e v) pressed?>>\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nswitch costume to (1 v)\nforever\n    if <(costume [number v]) = [2]> then\n        set [mode? v] to [Debugging]\n    else\n        set [mode? v] to [Not Debugging]\n    end\nend\n\nwhen I receive [talk cat v]\nhide\nset [mode? v] to [Not Debugging]\nstop [other scripts in sprite v]\n\n@Paint\n\nwhen flag clicked\nhide\n\nwhen I receive [check if drawing v]\nforever\n    if <(Mode?) = [Debugging]> then\n        wait until <not <mouse down?>>\n        set [pen start moving v] to [1]\n    else\n        set [pen start moving v] to [0]\n    end\nend\n\nwhen I receive [reset v]\nerase all\nset [pen start moving v] to [0]\nforever\n    if <(Pen Start Moving) = [1]> then\n        show\n        go to (mouse-pointer v)\n        go to x: ((round ((x position) / (16))) * (16)) y: ((round ((y position) / (16))) * (16))\n        if <mouse down?> then\n            stamp\n        end\n        if <key (c v) pressed?> then\n            erase all\n        end\n        broadcast (Check if drawing v)\n    else\n        hide\n        broadcast (Check if drawing v)\n    end\nend\n\nwhen I receive [reset v]\nswitch costume to (1 v)\nforever\n    if <(Mode?) = [Debugging]> then\n        if <key (v v) pressed?> then\n            switch costume to (1 v)\n        end\n        if <key (b v) pressed?> then\n            switch costume to (2 v)\n        end\n        if <key (n v) pressed?> then\n            switch costume to (3 v)\n        end\n    end\nend\n\n@Editing sign\n\nwhen I receive [show sign v]\nwait (0.1) seconds\nshow\ngo to x: (174) y: (183)\nglide (0.2) secs to x: (174) y: (155)\nwait (pick random (0.7) to (1)) seconds\nglide (0.2) secs to x: (174) y: (183)\nhide\n\nwhen I receive [reset v]\nhide\nset [ghost v] effect to (20)\nforever\n    if <(Mode?) = [Debugging]> then\n        switch costume to (editer v)\n    else\n        switch costume to (play v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Buttons\n\nwhen I receive [reset v]\ngo to x: (32) y: (-142)\nforever\n    go to [front v] layer\n    if <(Mode?) = [Debugging]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\nset size to (80) %\nset [ghost v] effect to (20)\n\n@Volume\n\nwhen I receive [reset v]\nforever\n    if <(distance to [physics v]) < [50]> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\nset [volume v] to [1]\nswitch costume to (volume v)\n\nwhen I receive [reset v]\nshow\ngo to x: (-222) y: (130)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-20)\n        if <mouse down?> then\n            next costume\n            start sound [Click v]\n            wait until <not <mouse down?>>\n        end\n    else\n        set [brightness v] effect to (0)\n    end\n    if <key (v v) pressed?> then\n        next costume\n        start sound [Click v]\n        wait until <not <key (v v) pressed?>>\n    end\nend\n\nwhen I receive [reset v]\nforever\n    go to [front v] layer\n    if <(costume [number v]) = [1]> then\n        set [volume v] to [1]\n    else\n        set [volume v] to [0]\n    end\nend\n\n@Start Button\n\nwhen flag clicked\nshow\ngo to [front v] layer\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (30)\n        if <mouse down?> then\n            hide\n            start sound [Click v]\n            broadcast (Start v)\n            stop [this script v]\n        end\n    else\n        change size by (((100) - (size)) / (3))\n        set [ghost v] effect to (10)\n    end\n    if <key (any v) pressed?> then\n        hide\n        broadcast (Start v)\n        stop [this script v]\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nswitch costume to (intro v)\n\nwhen I receive [reset v]\nhide\n\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nswitch costume to (thumbnail v)\n\n@Follow Button\n\nwhen flag clicked\nhide\n\nwhen I receive [reset v]\nshow\ngo to x: (-202) y: (93)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (30)\n        if <mouse down?> then\n            hide\n            broadcast (Talk Cat v)\n            stop [this script v]\n        end\n    else\n        set [ghost v] effect to (10)\n    end\nend\n\n@Text\n\ndefine Say (thing) (sound)\nset instrument to (20 v)\nset [t v] to []\nset [textlenght v] to ((length of (thing)) - (1))\nrepeat until <(textlenght) = [-1]>\n    set [t v] to (join (t) (letter ((length of (thing)) - (textlenght)) of (thing)))\n    change [textlenght v] by (-1)\n    say (t)\n    play note (76) for ((sound) * (0.01)) beats\nend\nwait (1) seconds\nsay []\n\nwhen flag clicked\nhide\n\nwhen I receive [talk cat v]\nwait (0.5) seconds\nshow\nswitch costume to (1 v)\nset size to (300) %\ngo to x: (-135) y: (-252)\nglide (0.4) secs to x: (-135) y: (-129)\nSay [Hey!] [0.3]\nwait (0.5) seconds\nSay (join (Username) [!]) [0.3]\nwait (0.5) seconds\nSay [You're the BEST!] [0.3]\nwait (0.5) seconds\nSay [How about a Love and Favorite and a FOLLOW!!] [0.3]\nforever\n    wait (0.5) seconds\n    switch costume to (1 v)\n    Say [Love and Favorite and YOU'LL be the best Scratcher EVER!] [0.3]\n    wait (0.5) seconds\n    Say (join (Username) [ IS AWESOME!!]) [0.3]\n    wait (0.5) seconds\n    Say (join (join [Please FOLLOW me ] (Username)) [!]) [0.3]\n    wait (0.5) seconds\n    Say (join (Username) [ IS THE BEST!!!]) [0.3]\n    wait (0.5) seconds\n    switch costume to (2 v)\n    Say (join (Username) [, Please be careful with Covid-19!]) [0.3]\n    wait (0.5) seconds\n    Say [Go to www.cdc.gov to learn more about it!] [0.3]\nend\n\nwhen I receive [talk cat v]\nhide\nforever\n    if <(length of (username)) < [3]> then\n        set [username v] to [YOU]\n    else\n        set [username v] to (username)\n    end\nend\n\nwhen I receive [reset v]\nhide\nstop [other scripts in sprite v]\n\n