Toast 2 - Platformer || #games #all
@Stage\n\nwhen flag clicked\nbroadcast (Start v)\n\nwhen I receive [start v]\nset volume to (100) %\nforever\n    play sound [Specification v] until done\nend\n\nwhen I receive [boss? v]\nset volume to (0) %\n\nwhen I receive [end v]\nrepeat (100)\n    change volume by (1)\nend\n\n@Player\n\ndefine Setup\nif <(Stage) = [10]> then\n    go to x: (180) y: (-50)\nelse\n    go to x: (((((Stage) mod (2)) * (2)) - (1)) * (-200)) y: (-50)\nend\nset [player_x v] to [0]\nset [player_y v] to [0]\nset [player_jump v] to [0]\nset [player_jumper v] to [0]\nset [ghost v] effect to (100)\nshow\n\ndefine Stage? (i) (x_speed) (y_jumping power)\nset [player_walljump? v] to [0]\nset [i v] to [0]\nrepeat until <<(i) < (i)> or <not <<touching (stage v)?> or <touching (jumper v)?>>>>\n    change y by (1)\n    change [i v] by (1)\nend\nif <(i) < (i)> then\n    change x by (() - (Player_x))\n    change y by (() - (i))\n    if <not <touching (jumper v)?>> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <[0] < (mouse y)>>> then\n            set [player_walljump? v] to (((Player_x) / ([abs v] of (Player_x) )) * (15))\n            set [player_x v] to (((Player_x) / ([abs v] of (Player_x) )) * ((x_speed) * (-1)))\n            set [player_y v] to (y_jumping power)\n        end\n    end\nend\n\nset [player_y v] to [0]\n\ndefine Plat (x_speed) (x_friction) (y_gravity) (y_jumping power)\nchange [player_y v] by (y_gravity)\nif <[0] < (Player_walljump?)> then\n    change [player_walljump? v] by (-1)\nelse\n    if <(Player_walljump?) < [0]> then\n        change [player_walljump? v] by (1)\n    else\n        set [player_walljump? v] to [0]\n    end\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <[0] < (mouse x)>>> then\n    if <([abs v] of (Player_walljump?) ) < [1]> then\n        change [player_x v] by ((x_speed) * (1))\n    end\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < [0]>>> then\n    if <([abs v] of (Player_walljump?) ) < [1]> then\n        change [player_x v] by ((x_speed) * (-1))\n    end\nend\nif <(Player_walljump?) = [0]> then\n    set [player_x v] to ((Player_x) * (x_friction))\nend\nchange x by (Player_x)\nif <<[210] < ([abs v] of (x position) )> and <(Stage) < [10]>> then\n    set x to (((x position) / ([abs v] of (x position) )) * (210))\nend\nif <<touching (stage v)?> or <touching (jumper v)?>> then\n    Stage? [5] [5] [10]\nend\nchange y by (Player_y)\nif <touching (stage v)?> then\n    change y by (() - (Player_y))\n    set [player_walljump? v] to [0]\n    set [player_y v] to [0]\nend\nchange y by (-1)\nif <touching (jumper v)?> then\n    change [player_jumper v] by (1)\n    set [player_y v] to ((y_jumping power) * (1.3))\nelse\n    if <touching (stage v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <[0] < (mouse y)>>> then\n            change [player_jump v] by (1)\n            set [player_y v] to (y_jumping power)\n        end\n    end\nend\nchange y by (1)\nif <<<(y position) < [-175]> or <touching (spike v)?>> or <key (r v) pressed?>> then\n    wait until <not <key (r v) pressed?>>\n    start sound [Oops v]\n    broadcast (delete v) and wait\n    create clone of (player_ v)\n    Setup\n    set [player? v] to [y]\n    broadcast (Player wait v)\n    broadcast (re v)\nend\nif <<[235] < (x position)> and <(Stage) = [10]>> then\n    broadcast (delete v) and wait\n    set [clear? v] to [y]\n    broadcast (clear v)\nend\n\nwhen I receive [start v]\nset [clear? v] to [n]\nset [stage v] to [1]\nSetup\nbroadcast (message1 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\nPlat [6] [0.5] [-1] [13]\nbroadcast (message2 v)\n\nwhen I receive [ready v]\nSetup\nset [player? v] to [y]\nbroadcast (Player wait v)\n\nwhen I receive [clear v]\ngo to x: (-240) y: (-95)\npoint in direction (90)\nglide (2) secs to x: (-50) y: (y position)\nbroadcast (boss? v)\nglide (0.1) secs to x: (-70) y: (y position)\nwait (0.5) seconds\nbroadcast (end v)\n\nwhen I receive [player wait v]\nwait (0.5) seconds\nset [player? v] to [n]\n\n@Player_\n\ndefine Setup\ngo to (player v)\nshow\n\nwhen I receive [start v]\nSetup\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\nswitch costume to (x v)\nset [ghost v] effect to (50)\nset [clone_y v] to [5]\nrepeat until <touching (_edge_ v)?>\n    change y by (Clone_y)\n    turn right (4) degrees\n    change [clone_y v] by (-1)\nend\ndelete this clone\n\nwhen I receive [message2 v]\nif <(costume [name v]) = [-]> then\n    if <(Player?) = [n]> then\n        go to x: ([x position v] of [player v]) y: ([y position v] of [player v])\n    else\n        change x by ((([x position v] of [player v]) - (x position)) / (2))\n        change y by ((([y position v] of [player v]) - (y position)) / (2))\n    end\nend\n\nwhen I receive [clear v]\nforever\n    go to (player v)\nend\n\nwhen I receive [... v]\nhide\n\n@Player_eyes\n\ndefine Setup\ngo to (player v)\ngo to [front v] layer\nshow\nset [eyes_x v] to [0]\nset [eyes_y v] to [0]\n\nwhen I receive [start v]\nSetup\n\nwhen flag clicked\nhide\n\nwhen I receive [message2 v]\nchange [eyes_x v] by (((Player_x) - (eyes_x)) / (5))\nchange [eyes_y v] by (((Player_y) - (eyes_y)) / (5))\nif <(Player?) = [n]> then\n    go to x: (([x position v] of [player v]) + ((eyes_x) * (1.2))) y: (([y position v] of [player v]) + ((eyes_y) * (1.2)))\nelse\n    change x by (((([x position v] of [player v]) + (eyes_x)) - (x position)) / (2))\n    change y by (((([y position v] of [player v]) + (eyes_y)) - (y position)) / (2))\nend\nif <(Clear?) = [n]> then\n    broadcast (message1 v)\nend\n\nwhen I receive [clear v]\nforever\n    go to (player v)\n    change x by ((([direction v] of [player v]) / (90)) * (5))\nend\n\nwhen I receive [... v]\nhide\n\n@Stage\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen I receive [re v]\nswitch costume to ((10) + (Stage))\ncreate clone of (_myself_ v)\nswitch costume to ((0) + (Stage))\ncreate clone of (_myself_ v)\nswitch costume to (wall v)\n\nwhen I receive [delete v]\ndelete this clone\n\nwhen I start as a clone\ngo to x: (0) y: (0)\nshow\nif <[10] < (costume [number v])> then\n    if <(Stage) = [5]> then\n        wait until <[0] < (Player_jumper)>\n        wait until <(Player_y) < [0]>\n        repeat until <(Player_y) = [0]>\n            change y by (((-120) - (y position)) / (5))\n        end\n        \n            change y by (((0) - (y position)) / (5))\n        end\n    else\n        if <(Stage) = [8]> then\n            go to x: (-85) y: (-120)\n            hide\n            wait until <<([x position v] of [player v]) < [0]> and <(Player_jumper) = [0]>>\n            show\n            repeat (40)\n                change y by (((-45) - (y position)) / (8))\n            end\n            \n                change y by (((-120) - (y position)) / (8))\n            end\n        end\n    end\n    delete this clone\nend\n\nwhen I receive [go v]\nswitch costume to ((10) + (Stage))\ncreate clone of (_myself_ v)\nswitch costume to ((0) + (Stage))\ncreate clone of (_myself_ v)\nswitch costume to (wall v)\n\nwhen I receive [go v]\ngo to x: (180) y: (0)\nset [mine v] to [1]\nrepeat (9)\n    repeat until <(Mine) < (Stage)>\n        change x by (((((((Mine) mod (2)) * (2)) - (1)) * (180)) - (x position)) / (5))\n        change y by (((0) - (y position)) / (5))\n        switch costume to (wall v)\n    end\n    change [mine v] by (1)\n    repeat until <(y position) < [-125]>\n        change y by (((-150) - (y position)) / (5))\n    end\n    set x to (((((Mine) mod (2)) * (2)) - (1)) * (180))\n    set y to (-300)\nend\n\nwhen I receive [clear v]\nstop [other scripts in sprite v]\ngo to x: (0) y: (0)\nswitch costume to (stage1 v)\nshow\n\nwhen flag clicked\nswitch costume to (stage1 v)\nhide\n\n@Spike\n\nwhen I receive [go v]\nshow\n\nwhen I receive [re v]\ngo to x: (0) y: (0)\npoint in direction (90)\nswitch costume to (Stage)\nhide\nif <(Stage) = [2]> then\n    go to x: (0) y: (-40)\n    wait until <([x position v] of [player v]) < [80]>\n    show\n    repeat until <([x position v] of [player v]) < [0]>\n        change y by (((0) - (y position)) / (5))\n    end\n    \n        change y by (((-40) - (y position)) / (5))\n    end\nelse\n    if <(Stage) = [3]> then\n        go to x: (0) y: (-40)\n        wait until <[-60] < ([x position v] of [player v])>\n        show\n        repeat until <[10] < ([x position v] of [player v])>\n            change y by (((0) - (y position)) / (5))\n        end\n        \n            change y by (((-40) - (y position)) / (5))\n        end\n    else\n        if <(Stage) = [4]> then\n            go to x: (-280) y: (70)\n            wait until <[0] < (Player_jumper)>\n            show\n            repeat until <[0] < (x position)>\n                change x by (((x position) - (-281)) / (6))\n            end\n            \n                change x by (((280) - (x position)) / (7))\n            end\n        else\n            if <(Stage) = [5]> then\n                go to x: (0) y: (-40)\n                wait until <[0] < (Player_jumper)>\n                show\n                repeat until <(Player_y) < [3]>\n                    change y by (((0) - (y position)) / (5))\n                end\n                \n                    change y by (((-40) - (y position)) / (5))\n                end\n            else\n                if <(Stage) = [6]> then\n                    wait until <[0] < (Player_jumper)>\n                    set [mine v] to [-8]\n                    show\n                    repeat until <(y position) < [-160]>\n                        change y by (Mine)\n                        change [mine v] by (-1)\n                    end\n                    set [mine v] to [5]\n                    repeat until <(y position) < [-280]>\n                        change y by (Mine)\n                        change [mine v] by (-1)\n                    end\n                    set [mine v] to [5]\n                    repeat until <(y position) < [-500]>\n                        change y by (Mine)\n                        change [mine v] by (-1)\n                    end\n                else\n                    if <(Stage) = [7]> then\n                        go to x: (0) y: (-40)\n                        set [mine v] to (days since 2000)\n                        wait until <[4] < (((days since 2000) - (Mine)) * (86400))>\n                        show\n                        repeat until <<(y position) < [-20]> and <[106] < ([x position v] of [player v])>>\n                            change y by (((0) - (y position)) / (5))\n                        end\n                        \n                            change y by (((-40) - (y position)) / (5))\n                        end\n                    else\n                        if <(Stage) = [8]> then\n                            go to x: (0) y: (180)\n                            wait until <[0] < (Player_jumper)>\n                            show\n                            \n                                change y by (((0) - (y position)) / (5))\n                            end\n                        else\n                            if <(Stage) = [9]> then\n                                go to x: (0) y: (-40)\n                                wait until <[0] < (Player_jump)>\n                                show\n                                repeat until <(Player_y) < [0]>\n                                    change y by (((0) - (y position)) / (5))\n                                end\n                                repeat until <[106] < ([x position v] of [player v])>\n                                    change x by (((80) - (x position)) / (5))\n                                end\n                                \n                                    change x by (((0) - (x position)) / (5))\n                                    change y by (((-45) - (y position)) / (5))\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (stage1 v)\n\nwhen I receive [delete v]\nhide\nstop [other scripts in sprite v]\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Jumper\n\nwhen I receive [go v]\ngo to [back v] layer\nshow\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (stage1 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nhide\n\nwhen I receive [re v]\ngo to x: (0) y: (0)\nswitch costume to (Stage)\nshow\nif <(Stage) = [3]> then\n    wait until <[-60] < ([x position v] of [player v])>\n    repeat until <[10] < ([x position v] of [player v])>\n        change y by (((-40) - (y position)) / (5))\n    end\n    \n        change y by (((0) - (y position)) / (5))\n    end\nelse\n    if <(Stage) = [5]> then\n        wait until <[0] < (Player_jumper)>\n        wait until <(Player_y) < [0]>\n        repeat until <(Player_y) = [0]>\n            change y by (((-120) - (y position)) / (5))\n        end\n        \n            change y by (((0) - (y position)) / (5))\n        end\n    else\n        if <(Stage) = [7]> then\n            set [mine v] to (days since 2000)\n            wait until <[2] < (((days since 2000) - (Mine)) * (86400))>\n            repeat until <<(y position) < [-20]> and <[106] < ([x position v] of [player v])>>\n                change y by (((-45) - (y position)) / (5))\n            end\n            repeat until \n                change y by (((0) - (y position)) / (5))\n            end\n        else\n            if <(Stage) = [9]> then\n                wait until <[0] < (Player_jump)>\n                wait until <(Player_y) < [0]>\n                repeat until <[106] < ([x position v] of [player v])>\n                    change x by (((80) - (x position)) / (5))\n                end\n                \n                    change x by (((0) - (x position)) / (5))\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [delete v]\nhide\n\n@TN\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\nend\n\n@C25\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (200) y: (-140)\nset [ghost v] effect to (50)\nset size to (0) %\nshow\nforever\n    change size by (((40) - (size)) / (5))\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (25)\n        repeat until <not <touching (mouse-pointer v)?>>\n            change size by (((50) - (size)) / (5))\n        end\n        set [ghost v] effect to (50)\n    end\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen I receive [end v]\nstop [other scripts in sprite v]\nrepeat (50)\n    change [ghost v] effect by (2)\nend\nhide\n\n@exposition\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\ngo to x: (0) y: (50)\nswitch costume to (stage1 v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nset [player_x v] to [0]\nrepeat until <[0] < ([abs v] of (Player_x) )>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nrepeat until <[1] < (Player_y)>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nbroadcast (ready v) and wait\nbroadcast (go v)\nrepeat until <[0] < ([x position v] of [player v])>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nwait until <[190] < ([x position v] of [player v])>\nrepeat until <([x position v] of [player v]) < [40]>\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-10)\nend\ng\nhide\n\ndefine g\nrepeat (5)\n    change y by ((() - (y position)) / (5))\n    change [ghost v] effect by (-20)\nend\nrepeat (5)\n    change y by (-3)\n    change [ghost v] effect by (20)\nend\nnext costume\n\n@Wall\n\nwhen flag clicked\ngo to x: (-240) y: (0)\nhide\n\nwhen I receive [go v]\nshow\nrepeat (9)\n    repeat until <<[190] < ([abs v] of ([x position v] of [player v]) )> and <(([x position v] of [player v]) / ([abs v] of ([x position v] of [player v]) )) = ((((Stage) mod (2)) * (2)) - (1))>>\n        if <([abs v] of ([x position v] of [player v]) ) < [190]> then\n            change x by (((((((Stage) mod (2)) * (2)) - (1)) * (-260)) - (x position)) / (5))\n        else\n            change x by (((((((Stage) mod (2)) * (2)) - (1)) * (-230)) - (x position)) / (5))\n        end\n        change y by (((0) - (y position)) / (5))\n    end\n    change [stage v] by (1)\n    set [player_jump v] to [0]\n    set [player_jumper v] to [0]\n    broadcast (delete v) and wait\n    broadcast (re v)\n    set x to (((((Stage) mod (2)) * (2)) - (1)) * (-230))\n    set y to (-300)\nend\nhide\n\n@end\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nswitch costume to (1 v)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nrepeat (50)\n    change [ghost v] effect by (-2)\n    go to [front v] layer\nend\nclear graphic effects\nwait (3) seconds\nrepeat (50)\n    change [brightness v] effect by (-2)\nend\nstop [all v]\n\n@EndSpike\n\nwhen flag clicked\ngo to x: (0) y: (-40)\nswitch costume to (1 v)\nhide\n\nwhen I receive [boss? v]\nshow\nglide (0.2) secs to x: (0) y: (0)\n\n
============Instructions===============\nTOP LOVED On  9.1.2021  \nThanks You Soo Much!\n========================================\nMade by me - @HDNaufal\n========================================\nUse Key Right To Go Right = ▶\nUse Key Left To Go Left = ◀        = ✅\nUse Key Up To jump = ▲\n\nW,A,S and D = ✅\n========================================\nSpace = Skip       R = Restart\nOrange = Bouncy\n========================================\n♬Song♬ : Spirit Run!   By  HeatleyBros\n========================================\nMy Other Games ▼\nhttps://scratch.mit.edu/projects/463984312\nhttps://scratch.mit.edu/projects/459511713/\n========================================\n\nIn the Game, I put 2 Easter Egg!  \n