Gobo || A Scrolling Platformer
@Stage\n\n@Blank\n\n@Gobo\n\ndefine Controls - Left and Right\nset [speed x v] to ((speed x) * (0.7))\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [speed x v] by (-1.5)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [speed x v] by (1.5)\nend\n\ndefine Walk (direction) (speed) max step (step)\npoint in direction (direction)\nchange x by (speed)\nchange [frame v] by (([abs v] of (speed) ) / (8))\nset [slope v] to [0]\nGet Touching <(in platforrm) = [1]>\nrepeat until <<(slope) = (step)> or <(touch) = [0]>>\n    change y by (1)\n    change [slope v] by (1)\n    Get Touching <(in platforrm) = [1]>\nend\nif <(slope) = (step)> then\n    change x by ((0) - (speed))\n    change y by ((0) - (slope))\n    if <<(touch) = [1]> and <(in platforrm) = [1]>> then\n        set [in platforrm v] to [2]\n        Walk (direction) (speed) max step (step)\n        if <(speed x) = [0]> then\n            set [in platforrm v] to [1]\n        end\n    else\n        if <<<<<(x position) < (mouse y)> and <mouse down?>> or <<key (up arrow v) pressed?> or <key (space v) pressed?>>> and <([abs v] of (speed) ) > [3.5]>> and <(touch) > [1]>> then\n            set [speed x v] to ((-1.2) * (speed))\n            set [speed y v] to [11]\n            set [falling? v] to [6]\n            set [wall jump v] to [15]\n        else\n            set [speed x v] to [0]\n        end\n    end\nend\n\ndefine Controls - Jump, Crouch\nif <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n    if <<(jump key) = [0]> and <(falling?) < [3]>> then\n        set [speed y v] to [14]\n        set [falling? v] to [6]\n        set [jump key v] to [1]\n    end\nelse\n    set [jump key v] to [0]\nend\nif <<key (down arrow v) pressed?> or <<mouse down?> and <(mouse y) < (y position)>>> then\n    set [in platforrm v] to [2]\nend\n\ndefine Gravity\nif <<key (up arrow v) pressed?> or <<(speed y) < [4]> or <key (space v) pressed?>>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nchange [falling? v] by (1)\n\ndefine Check Hit Ceiling / Floor <up?>\nGet Touching \nif <(touch) = [0]> then\n    set [in platforrm v] to [1]\nelse\n    if <<up?> and <(touch) = [1]>> then\n        set [in platforrm v] to [2]\n    end\nend\nrepeat until <(touch) < (in platforrm)>\n    if <up?> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling? v] to [0]\n    end\n    Get Touching <not <up?>>\n    set [speed y v] to [0]\nend\n\ndefine Get Touching <check platform?>\nif <touching (ground v)?> then\n    set [touch v] to [9]\nelse\n    if <<check platform?> and <touching (drop through v)?>> then\n        set [touch v] to [1]\n    else\n        set [touch v] to [0]\n    end\nend\n\ndefine Reset Level\nset size to (25) %\nset rotation style [left-right v]\nshow\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [falling? v] to [10]\nset [in platforrm v] to [1]\nset [frame v] to [0]\nset [wall jump v] to [0]\n\ndefine Set Costume\nif <(falling?) < [6]> then\n    if <(frame) = [0]> then\n        switch costume to (stand_1 v)\n    else\n        switch costume to ([floor v] of ((4) + ((frame) mod (5))) )\n    end\nelse\n    if <(speed y) > [0]> then\n        switch costume to (jump_1 v)\n    else\n        switch costume to (fall_1 v)\n    end\nend\n\nwhen I receive [game loop v]\nReset Level\nclear sound effects\nset volume to (100) %\nshow\nforever\n    if <key (p v) pressed?> then\n        wait until <not <key (p v) pressed?>>\n        wait until <key (p v) pressed?>\n        wait until <not <key (p v) pressed?>>\n    end\n    clear graphic effects\n    set size to (25) %\n    switch costume to (hitbox v)\n    set rotation style [left-right v]\n    Controls - Jump, Crouch\n    Gravity\n    Check Hit Ceiling / Floor <(speed y) > [0]>\n    if <(wall jump) > [0]> then\n        change [wall jump v] by (-1)\n    else\n        Controls - Left and Right\n    end\n    if <(speed x) < [-0.5]> then\n        Walk (-90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n    else\n        if <(speed x) > [0.5]> then\n            Walk (90) (speed x) max step (([ceiling v] of ([abs v] of ((speed x) * (1.3)) ) ) + (1))\n        else\n            set [frame v] to [0]\n        end\n    end\n    if <touching (spike v)?> then\n        go to checkpoint\n        point in direction (90)\n        set [speed x v] to [0]\n        set [speed y v] to [0]\n    end\n    Set Costume\n    scroll\nend\n\nwhen [r v] key pressed\ngo to checkpoint\n\nwhen flag clicked\nset [scrolly v] to [100]\nset [scrollx v] to [881]\n\nwhen I receive [game loop v]\nforever\n    if <(ScrollY) > [500]> then\n        go to checkpoint\n    end\nend\n\ndefine scroll\nif <not <(ScrollX) < [-1448]>> then\n    change [scrollx v] by (() - (round ((x position) / (10))))\n    change x by (() - (round ((x position) / (10))))\n    change [scrolly v] by (() - (round ((y position) / (10))))\n    change y by (() - (round ((y position) / (10))))\nelse\n    if <(x position) < [-15]> then\n        change [scrollx v] by (15)\n    end\nend\n\nwhen I receive [game loop v]\nset voice to (tenor v)::tts\nset [checkpoint v] to [1]\nset [☁ checkpoint v] to [1]\nwait until <[-164] > (ScrollX)>\nset [checkpoint v] to [2]\nset [☁ checkpoint v] to [2]\nbroadcast (checkpoint v)\nwait until <<[-40] > (ScrollY)> and <(ScrollX) > [-185]>>\nset [checkpoint v] to [3]\nset [☁ checkpoint v] to [3]\nbroadcast (checkpoint v)\nwait until <<[-80] > (ScrollY)> and <(ScrollX) > [545]>>\nset [checkpoint v] to [4]\nset [☁ checkpoint v] to [4]\nbroadcast (checkpoint v)\nwait until <<<[-845] > (ScrollY)> and <[840] > (ScrollX)>> and <(ScrollX) > [750]>>\nset [checkpoint v] to [5]\nset [☁ checkpoint v] to [5]\nbroadcast (checkpoint v)\n\ndefine go to checkpoint\nif <(checkpoint) = [1]> then\n    set [scrolly v] to [100]\n    set [scrollx v] to [881]\nend\nif <(checkpoint) = [2]> then\n    set [scrolly v] to [315]\n    set [scrollx v] to [-165]\nend\nif <(checkpoint) = [3]> then\n    set [scrolly v] to [-51]\n    set [scrollx v] to [-177]\nend\nif <(checkpoint) = [4]> then\n    set [scrolly v] to [-395]\n    set [scrollx v] to [509]\nend\nif <(checkpoint) = [5]> then\n    set [scrolly v] to [-850]\n    set [scrollx v] to [814]\nend\n\nwhen flag clicked\nset [☁ won? v] to [0]\ngo to x: (0) y: (0)\nbroadcast (game loop v)\nforever\n    reset timer\n    repeat (2)\n        set [. v] to [0]\n    end\n    if <(timer) = [0]> then\n        broadcast (turbo v) and wait\n    end\nend\n\nwhen I receive [game loop v]\nplay sound [intro v] until done\nforever\n    play sound [loop v] until done\nend\n\nwhen [m v] key pressed\nbroadcast (mute or ummutr v)\n\nwhen I receive [game loop v]\nforever\n    if <[239] < (x position)> then\n        broadcast (game finished!!! v)\n        set [☁ won? v] to [1]\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen I receive [mute or ummutr v]\nif <(volume) = [100]> then\n    set volume to (0) %\n    set [pitch v] effect to ((-1) / (0))\nelse\n    set volume to (100) %\n    clear sound effects\nend\n\nwhen [p v] key pressed\nbroadcast (mute or ummutr v)\n\n@Ground\n\ndefine Set size to (percent) %\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\ngo [backward v] (100) layers\nSet size to (500) %\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    go to x: (ScrollX) y: (ScrollY)\n    if <<(x position) = (ScrollX)> and <(ScrollY) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [turbo v]\nstop [other scripts in sprite v]\nset size to (100) %\nshow\nswitch costume to (costume1 v)\nplay sound [wrong v] until done\nwait (.5) seconds\nstop [all v]\n\n@Checkpoint\n\nwhen flag clicked\nset voice to (tenor v)::tts\nhide\nforever\n    go to x: (([x position v] of [gobo v]) + (10)) y: ((([sin v] of ((timer) * (500)) ) * (3)) + (([y position v] of [gobo v]) + (70)))\nend\n\nwhen I receive [checkpoint v]\nshow\nwait (1) seconds\nhide\n\nwhen I receive [checkpoint v]\nspeak [You reached a checkpoint!]::tts\n\nwhen I receive [game loop v]\nwait until <<(ScrollY) < [225]> and <(checkpoint) = [2]>>\nspeak [Climb up the bridge]::tts\nwait until <<(ScrollY) < [-75]> and <[55] < (ScrollX)>>\nspeak [This part requires out of the box thinking]::tts\nwait until <<(ScrollY) < [-390]> and <[400] < (ScrollX)>>\nspeak [Good job on getting here!]::tts\nwait until <<<(ScrollY) < [-836]> and <[290] < (ScrollX)>> and <(ScrollX) < [400]>>\nspeak [Take a leap of faith]::tts\nwait until <<(ScrollY) < [-673]> and <(ScrollX) < [60]>>\nspeak [Now take another leap of faith]::tts\nwait until <<(ScrollY) < [-326]> and <(ScrollX) < [60]>>\nspeak [Now take another leap of faith]::tts\n\nwhen I receive [game loop v]\nwait until <<(ScrollX) < [-800]> and <[-150] < (ScrollY)>>\nspeak [Oh no]::tts\nspeak [Looks like you are trapped]::tts\nspeak [Press R to go back to the checkpoint]::tts\n\n@Drop through\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\ngo [backward v] (200) layers\nHack Zoom to (500)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\ngo to [back v] layer\nforever\n    go to x: (ScrollX) y: (ScrollY)\n    if <<(x position) = (ScrollX)> and <(ScrollY) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@spike\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\ngo [backward v] (101) layers\nHack Zoom to (500)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    go to x: (ScrollX) y: (ScrollY)\n    if <<(x position) = (ScrollX)> and <(ScrollY) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@Border\n\nwhen flag clicked\nhide\n\nwhen I receive [game loop v]\nshow\n\n@Art\n\ndefine Hack Zoom to (percent)\nif <(percent) > [100]> then\n    set [#costume v] to (costume [number v])\n    switch costume to (dot v)\n    set size to (percent) %\n    switch costume to (#costume)\nelse\n    set size to (percent) %\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\ngo [backward v] (100) layers\nHack Zoom to (500)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nforever\n    go to x: (ScrollX) y: (ScrollY)\n    if <<(x position) = (ScrollX)> and <(ScrollY) = (y position)>> then\n        show\n    else\n        hide\n    end\nend\n\n@White out!\n\nwhen flag clicked\nhide\n\nwhen I receive [game finished!!! v]\nset [ghost v] effect to (100)\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nbroadcast (game win splash v) and wait\nrepeat (20)\n    change [ghost v] effect by (5)\nend\n\n@Game splash\n\nwhen flag clicked\nhide\n\nwhen I receive [game win splash v]\nshow\ngo to [front v] layer\n\n@Totally not self-promoting\n\n
      rr   r rrrrr