SCRIBBLE || A Platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (intro v)\n\nwhen I receive [starting screen v]\nswitch backdrop to (paper v)\n\nwhen I receive [play platformer v]\nswitch backdrop to (paper v)\n\n@Player\n\nwhen I start as a clone\nshow\nrepeat (15)\n    change size by (-3)\n    change [ghost v] effect by (7)\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\ndefine Platform Gravity: (gravity) Jump Height: (jump height) Side Movement Speed: (side movement) Friction: (friction) Slope: (slope)\nswitch costume to (hitbox v)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <<<touching (level v)?> or <touching (crate v)?>> or <touching (moving platform v)?>> then\n    repeat until <not <<<touching (level v)?> or <touching (crate v)?>> or <touching (moving platform v)?>>>\n        change y by ((([abs v] of (Y Velocity) ) / (Y Velocity)) * (-1))\n    end\n    set [y velocity v] to (<<<key (up arrow v) pressed?> or <<key (w v) pressed?> or >> and <(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]>> * (jump height))\nend\nset [x velocity v] to ((friction) * ((X Velocity) + ((<<<key (left arrow v) pressed?> or <key (a v) pressed?>> or > * ((side movement) * (-1))) + (<<<key (right arrow v) pressed?> or <key (d v) pressed?>> or > * (side movement)))))\nchange x by (X Velocity)\nset [slope v] to [0]\nrepeat until <<(Slope) = ((slope) * (-1))> or <not <<<touching (level v)?> or <touching (crate v)?>> or <touching (moving platform v)?>>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <<touching (level v)?> or <touching (crate v)?>> then\n    change y by (Slope)\n    repeat until <not <<<touching (level v)?> or <touching (crate v)?>> or <touching (moving platform v)?>>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\n    if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n        if <(X Velocity) > [0]> then\n            set [x velocity v] to [-20]\n        else\n            set [x velocity v] to [20]\n        end\n        set [y velocity v] to [10]\n    else\n        set [y velocity v] to [0]\n    end\nend\npoint in direction ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\nswitch costume to (CharacterChosen)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or > then\n    switch costume to (CharacterChosen)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or > then\n    switch costume to (join (CharacterChosen) [2])\nend\n\nwhen I receive [play platformer v]\nswitch backdrop to (starting screen v)\nset rotation style [don't rotate v]\ngo to x: (-215) y: (-55)\nset [y velocity v] to [0]\nset [x velocity v] to [0]\nset [level v] to [1]\ngo to [front v] layer\nshow\nforever\n    Platform Gravity: [-1] Jump Height: [12.35] Side Movement Speed: [3] Friction: [.7] Slope: [8]\n    if <touching (spike v)?> then\n        broadcast (OOF v)\n        hide\n        go to x: (-215) y: (-55)\n        show\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n    end\n    if <touching (water v)?> then\n        broadcast (OOF2 v)\n        hide\n        go to x: (-215) y: (-55)\n        show\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n    end\n    if <touching (spinny v)?> then\n        broadcast (OOF3 v)\n        hide\n        go to x: (-215) y: (-55)\n        show\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n    end\n    if <touching (crushy v)?> then\n        broadcast (OOF4 v)\n        hide\n        go to x: (-215) y: (-55)\n        show\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n    end\n    if <(x position) > [238]> then\n        hide\n        go to x: (-215) y: (-55)\n        broadcast (Next Level v)\n        wait (0.8) seconds\n        show\n    end\n    if <touching (trampoline v)?> then\n        start sound [Cartoon Sound Effect - Bounce.mp3 v]\n        set [y velocity v] to [16.5]\n    end\n    if <touching (speed boost v)?> then\n        start sound [Zoop v]\n        set [x velocity v] to [20]\n    end\nend\n\nif <(Y Velocity) > [2]> then\n    switch costume to (jump v)\nend\nif <(Y Velocity) < [-3]> then\n    switch costume to (fall v)\nend\n\nwhen I receive [play platformer v]\nforever\n    wait (0.005) seconds\n    create clone of (_myself_ v)\nend\n\n@Introduction\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\nswitch costume to (giphy v)\nwait (0.1) seconds\nswitch costume to (giphy2 v)\nwait (0.1) seconds\nswitch costume to (giphy3 v)\nwait (0.1) seconds\nswitch costume to (giphy4 v)\nwait (0.1) seconds\nswitch costume to (giphy5 v)\nwait (0.1) seconds\nswitch costume to (giphy6 v)\nwait (0.1) seconds\nswitch costume to (giphy7 v)\nwait (0.1) seconds\nswitch costume to (giphy8 v)\nwait (0.01) seconds\nswitch costume to (giphy9 v)\nwait (0.01) seconds\nswitch costume to (giphy10 v)\nwait (0.01) seconds\nswitch costume to (giphy11 v)\nwait (0.01) seconds\nswitch costume to (giphy12 v)\nwait (0.01) seconds\nswitch costume to (giphy13 v)\nwait (0.01) seconds\nswitch costume to (giphy14 v)\nwait (0.01) seconds\nswitch costume to (giphy15 v)\nwait (0.01) seconds\nswitch costume to (giphy16 v)\nwait (0.01) seconds\nswitch costume to (giphy17 v)\nwait (0.01) seconds\nswitch costume to (giphy18 v)\nwait (0.01) seconds\nswitch costume to (giphy19 v)\nwait (0.01) seconds\nswitch costume to (giphy20 v)\nwait (0.01) seconds\nif <(costume [number v]) = [20]> then\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    broadcast (Starting Screen v)\n    set [ghost v] effect to (100)\n    hide\nend\n\nwhen flag clicked\nwait (0.2) seconds\nplay sound [Teleport3 v] until done\nset [pitch v] effect to (100)\n\n@Level\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\nwhen I receive [next level v]\nwait (0.6) seconds\nchange [level v] by (1)\n\nwait (3) seconds\n\n@Spike\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\ngo to [back v] layer\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\nwait (3) seconds\n\n@Button\n\nwhen flag clicked\nhide\n\nwhen I receive [starting screen v]\nshow\ngo to [front v] layer\ngo to x: (0) y: (-125)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (3))\n        set [ghost v] effect to (10)\n        point in direction (([sin v] of ((timer) * (1000)) ) + (90))\n        if <mouse down?> then\n            broadcast (Play Platformer v)\n            repeat (2)\n                change [ghost v] effect by (5)\n            end\n            hide\n            wait until <not <mouse down?>>\n        end\n    else\n        point in direction (90)\n        change size by (((100) - (size)) / (3))\n        set [ghost v] effect to (-10)\n    end\nend\n\nwhen I receive [play platformer v]\nhide\nstop [other scripts in sprite v]\n\n@Player Selections\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [left v]\nswitch costume to ((costume [number v]) - (1))\nforever\n    set [characterchosen v] to (costume [name v])\n    switch costume to (CharacterChosen)\nend\n\nwhen I receive [right v]\nnext costume\nforever\n    set [characterchosen v] to (costume [name v])\n    switch costume to (CharacterChosen)\nend\n\nwhen I receive [starting screen v]\ngo to x: (0) y: (-37)\nshow\nswitch costume to (character_squareyellow v)\nset [characterchosen v] to [character_squareYellow]\n\nwhen I receive [play platformer v]\nhide\n\n@Right Arrow\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (selected v)\n    else\n        switch costume to (notselected v)\n    end\nend\n\nwhen I receive [starting screen v]\nshow\ngo to x: (54) y: (-37)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        start sound [Collect v]\n        broadcast (Right v)\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [play platformer v]\nhide\nstop [other scripts in sprite v]\n\n@Left Arrow\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (selected v)\n    else\n        switch costume to (notselected v)\n    end\nend\n\nwhen I receive [starting screen v]\nshow\ngo to x: (-54) y: (-37)\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        start sound [Collect v]\n        broadcast (Left v)\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [play platformer v]\nhide\nstop [other scripts in sprite v]\n\n@Instructions2\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [instructions v]\nshow\nwait (2) seconds\nforever\n    if <key (space v) pressed?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (100)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [instructions v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [play platformer v]\nhide\n\n@info2\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\n\nwhen I receive [help v]\nshow\nwait (2) seconds\nforever\n    if <key (space v) pressed?> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [ghost v] effect to (100)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen I receive [help v]\ngo to [front v] layer\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen I receive [play platformer v]\nhide\n\n@Instructions\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (Instructions v)\n        play sound [Collect v] until done\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nforever\n    set y to ((([sin v] of ((timer) * (200)) ) * (5)) + (-126))\n    point in direction (([sin v] of ((timer) * (1000)) ) + (90))\nend\n\nwhen I receive [starting screen v]\nshow\ngo to x: (181) y: (-126)\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [play platformer v]\nhide\n\nwhen I receive [play platformer v]\nhide\n\n@info\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (Help v)\n        play sound [Collect v] until done\n    end\nend\n\nwhen I receive [green flag v]\nhide\n\nwhen flag clicked\nforever\n    set y to ((([sin v] of ((timer) * (200)) ) * (5)) + (-126))\n    point in direction (([sin v] of ((timer) * (1000)) ) + (90))\nend\n\nwhen I receive [starting screen v]\nshow\ngo to x: (-181) y: (-126)\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (110) %\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [play platformer v]\nhide\n\nwhen I receive [play platformer v]\nhide\n\n@Wordy\n\nwhen flag clicked\nforever\n    set y to ((([sin v] of ((timer) * (500)) ) * (5)) + (100))\n    point in direction (([sin v] of ((timer) * (150)) ) + (90))\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\nhide\n\nwhen I receive [starting screen v]\nshow\ngo to x: (0) y: (100)\n\n@Thumb\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nset [level v] to [4]\n\n@Water\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\ngo to x: (0) y: (0)\ngo to [back v] layer\nhide\nforever\n    next costume\n    wait (0.1) seconds\n    set [ghost v] effect to (10)\n    if <(Level) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\n@Level Assets\n\nwhen flag clicked\nforever\n    hide\nend\n\n@Death Messages\n\nwhen flag clicked\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [oof v]\nshow\nswitch costume to (pick random (1) to (2))\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait (1) seconds\nrepeat (4)\n    change [ghost v] effect by (24)\nend\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [oof2 v]\nshow\nswitch costume to (pick random (3) to (4))\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait (1) seconds\nrepeat (4)\n    change [ghost v] effect by (24)\nend\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [oof3 v]\nshow\nswitch costume to (pick random (5) to (6))\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait (1) seconds\nrepeat (4)\n    change [ghost v] effect by (24)\nend\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [oof4 v]\nshow\nswitch costume to (pick random (7) to (8))\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\nwait (1) seconds\nrepeat (4)\n    change [ghost v] effect by (24)\nend\nset [ghost v] effect to (100)\nhide\n\n@Volume\n\nwhen flag clicked\nhide\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo to x: (215) y: (157)\nforever\n    if <(costume [number v]) = [1]> then\n        set volume to (100) %\n    else\n        if <(costume [number v]) = [2]> then\n            set volume to (40) %\n        else\n            if <(costume [number v]) = [3]> then\n                set volume to (0) %\n            end\n        end\n    end\n    if <touching (mouse-pointer v)?> then\n        set size to (130) %\n    else\n        set size to (100) %\n    end\nend\n\nwhen I receive [starting screen v]\nshow\ngo to x: (215) y: (157)\nforever\n    play sound [Unlimited v] until done\nend\n\nwhen I receive [starting screen v]\nforever\n    point in direction ((([sin v] of ((timer) * (1000)) ) * (4)) + (90))\nend\n\nwhen this sprite clicked\nnext costume\n\n@Next Level\n\nwhen flag clicked\nhide\nswitch costume to (transition v)\nforever\n    go to [front v] layer\nend\n\nwhen I receive [next level v]\nshow\ngo to x: (-480) y: (0)\nglide (0.2) secs to x: (0) y: (0)\nwait (0.5) seconds\nglide (0.2) secs to x: (480) y: (0)\nhide\ngo to x: (-480) y: (0)\n\n@Clouds\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (30)\ngo to x: (400) y: (pick random (130) to (150))\nswitch costume to (pick random (1) to (2))\nset size to (105) %\nrepeat until <(x position) < [-200]>\n    change x by (pick random (-1) to (-4))\nend\ndelete this clone\n\nwhen I receive [play platformer v]\ngo to [back v] layer\ngo [forward v] (1) layers\nwait (0.01) seconds\nforever\n    wait (4) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\n\nforever\n    if <<(Level) = [7]> or <<(Level) = [9]> or <(Level) = [11]>>> then\n        hide\n    else\n        show\n    end\nend\n\nwait (3) seconds\n\n@Trampoline\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\ngo to [front v] layer\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\nwait (3) seconds\n\n@Crate\n\nwhen I receive [play platformer v]\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\nwhen flag clicked\nhide\n\nset [level v] to [18]\n\n@Spinny\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\ngo to [back v] layer\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\nwhen I receive [play platformer v]\nforever\n    if <(Level) = [1]> then\n        hide\n    else\n        if <(Level) = [2]> then\n            show\n            go to x: (60) y: (-115)\n        else\n            if <(Level) = [3]> then\n                show\n                go to x: (-115) y: (-115)\n            else\n                if <(Level) = [4]> then\n                    hide\n                else\n                    if <(Level) = [5]> then\n                        show\n                        go to x: (-90) y: (-115)\n                    else\n                        if <(Level) = [6]> then\n                            show\n                            go to x: (70) y: (-115)\n                        else\n                            if <(Level) = [7]> then\n                                show\n                                go to x: (-20) y: (-115)\n                                glide (1.5) secs to x: (200) y: (-115)\n                                glide (1.5) secs to x: (-20) y: (-115)\n                            else\n                                if <(Level) = [8]> then\n                                    show\n                                    go to x: (-20) y: (-115)\n                                    glide (0.5) secs to x: (50) y: (-115)\n                                    glide (0.5) secs to x: (-20) y: (-115)\n                                else\n                                    if <(Level) = [9]> then\n                                        hide\n                                    else\n                                        if <(Level) = [10]> then\n                                            show\n                                            go to x: (40) y: (-115)\n                                        else\n                                            if <(Level) = [11]> then\n                                                show\n                                                go to x: (-100) y: (-115)\n                                            else\n                                                if <(Level) = [12]> then\n                                                    show\n                                                    go to x: (-100) y: (-115)\n                                                else\n                                                    if <(Level) = [13]> then\n                                                        show\n                                                        go to x: (-100) y: (-115)\n                                                    else\n                                                        if <(Level) = [14]> then\n                                                            show\n                                                            go to x: (-100) y: (-115)\n                                                        else\n                                                            if <(Level) = [15]> then\n                                                                hide\n                                                            else\n                                                                if <(Level) = [16]> then\n                                                                    show\n                                                                    go to x: (-100) y: (-115)\n                                                                    glide (0.8) secs to x: (100) y: (-115)\n                                                                    glide (0.8) secs to x: (-100) y: (-115)\n                                                                else\n                                                                    if <(Level) = [17]> then\n                                                                        hide\n                                                                    else\n                                                                        if <(Level) = [18]> then\n                                                                            hide\n                                                                        else\n                                                                            if <(Level) = [19]> then\n                                                                                hide\n                                                                            else\n                                                                                if <(Level) = [20]> then\n                                                                                    hide\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [play platformer v]\ncreate clone of (_myself_ v)\nforever\n    turn right (5) degrees\nend\n\nwhen I start as a clone\nforever\n    if <(Level) = [5]> then\n        show\n        turn right (5) degrees\n        go to x: (210) y: (-115)\n    else\n        if <(Level) = [6]> then\n            show\n            turn right (5) degrees\n            go to x: (170) y: (-115)\n        else\n            if <(Level) = [11]> then\n                show\n                turn right (5) degrees\n                go to x: (80) y: (-115)\n            else\n                if <(Level) = [14]> then\n                    show\n                    turn right (5) degrees\n                    go to x: (100) y: (-115)\n                else\n                    hide\n                end\n            end\n        end\n    end\nend\n\nhide\n\nset [level v] to [15]\n\ngo [backward v] (1) layers\n\nwhen I receive [next level v]\nhide\nwait (0.6) seconds\nshow\n\n@Moving Platform\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\ngo to [back v] layer\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\nwhen I receive [play platformer v]\nhide\ngo to x: (-100) y: (-125)\nforever\n    if <(Level) = [4]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    glide (2) secs to x: (100) y: (-125)\n    glide (2) secs to x: (-100) y: (-125)\nend\n\nwhen I receive [next level v]\ngo to x: (-100) y: (-125)\n\n@Crushy\n\nwhen flag clicked\nhide\ngo to x: (100) y: (80)\nforever\n    glide (1) secs to x: (60) y: (-26)\n    wait (0.5) seconds\n    glide (1) secs to x: (60) y: (80)\nend\n\nwhen I receive [play platformer v]\nforever\n    if <(Level) = [12]> then\n        show\n    else\n        hide\n    end\nend\n\n@Love, Fav, Follow\n\nwhen flag clicked\nhide\n\nwhen I receive [play platformer v]\nforever\n    if <(Level) = [20]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [play platformer v]\nforever\n    set y to ((([sin v] of ((timer) * (500)) ) * (5)) + (90))\n    point in direction (([sin v] of ((timer) * (150)) ) + (90))\nend\n\n@Decor\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [play platformer v]\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\n@Texty\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [play platformer v]\nshow\nforever\n    switch costume to (join [Level ] (Level))\nend\n\n
~~~~~~~~~~~SCRIBBLE || A Platformer~~~~~~~~~~~~\n\nI came First in @carot3 's contest!\n\nWAD or Arrow keys to move (no mobile).\n\nGet to the end!\n\nLove and Fav for part 2!\n\nFor @carot3 's contest\n\nThanks for playing!