Platformer


@Stage\n\nwhen flag clicked\nforever\n    play sound [Overcooked v] until done\nend\n\n@Blank\n\n@Toast Player\n\nwhen I receive [on level v]\nset [ghost v] effect to (0)\nset size to (110) %\nswitch costume to (player v)\ngo to x: (-215) y: (-75)\n\nwhen I receive [on level v]\nset [death count v] to [0]\nforever\n    if <<(y position) < [-165]> or <touching (danger v)?>> then\n        broadcast (Die v)\n        change [death count v] by (1)\n        go to x: (-215) y: (-75)\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nbroadcast (On Level v)\n\nwhen flag clicked\nswitch costume to (player v)\n\nwhen I receive [on level v]\nhide variable [level v]\nset [x speed v] to [0]\nset [y speed v] to [0]\nshow\nforever\n    if <(Stop) = [0]> then\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change y by (1)\n                            if <touching (level v)?> then\n                                change x by ((X speed) * (-1))\n                                change y by (-5)\n                                if <key (up arrow v) pressed?> then\n                                    if <(X speed) > [0]> then\n                                        set [x speed v] to [-5]\n                                    else\n                                        set [x speed v] to [5]\n                                    end\n                                    set [y speed v] to [10]\n                                else\n                                    set [x speed v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [y speed v] by (-1)\n        change y by (Y speed)\n    end\nend\n\nwhen I receive [on level v]\nset [stop v] to [0]\nforever\n    if <(Stop) = [0]> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [x speed v] by (1.1)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [x speed v] by (-1.1)\n        end\n        set [x speed v] to ((X speed) * (.9))\n        change x by (X speed)\n    end\nend\n\nwhen I receive [on level v]\nforever\n    if <(Stop) = [0]> then\n        if <touching (level v)?> then\n            change y by ((Y speed) * (-1))\n            set [y speed v] to [0]\n        end\n        change y by (-1)\n        if <touching (level v)?> then\n            if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n                change [y speed v] by (14)\n            end\n        end\n        if <<key (s v) pressed?> or <key (down arrow v) pressed?>> then\n            switch costume to (player2 v)\n        else\n            switch costume to (player v)\n        end\n        change y by (1)\n        if <<touching color (#5ac7ff)?> and <touching (trampoline v)?>> then\n            set [y speed v] to [0]\n            change [y speed v] by (15)\n        end\n        if <touching (toaster v)?> then\n            change [level v] by (1)\n            set [x speed v] to [0]\n            set [y speed v] to [0]\n            broadcast (Next Level v)\n            go to x: (-215) y: (-75)\n        end\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-215) y: (-75)\n\n@Level\n\nwhen flag clicked\nswitch costume to (level 1 v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@Toaster\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nforever\n    if <(Level) = [1]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [2]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [3]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [4]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [5]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [6]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [7]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [8]> then\n        go to x: (205) y: (105)\n    end\n    if <(Level) = [9]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [10]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [10]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [11]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [12]> then\n        go to x: (205) y: (-85)\n    end\n    if <(Level) = [13]> then\n        go to x: (-20) y: (130)\n    end\n    if <(Level) = [14]> then\n        go to x: (200) y: (-85)\n    end\n    if <(Level) = [15]> then\n        hide\n    end\nend\n\n@Skip\n\nwhen flag clicked\ngo to [front v] layer\ngo to x: (-185) y: (145)\nshow\nforever\n    if <(Level) = [15]> then\n        hide\n    end\nend\n\nwhen this sprite clicked\nchange [level v] by (1)\nbroadcast (Next Level v)\n\n@Thumbnail\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\ngo to x: (0) y: (35)\nforever\n    go to [front v] layer\nend\n\n@Trampoline\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@Danger\n\nwhen flag clicked\nswitch costume to (level1 v)\ngo to x: (0) y: (0)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n