Burger Platformer


@Stage\n\n@burger\n\nwhen flag clicked\npoint in direction (90)\nshow\nset size to (70) %\nforever\n    if <touching (door v)?> then\n        broadcast (next v)\n        go to x: (-170) y: (80)\n    end\nend\n\nwhen flag clicked\ngo to x: (-170) y: (80)\nset [y velocity v] to [0]\nset [x velocity v] to [0]\nforever\n    Platformer Gravity: [-1] Jump height: [15] Side Movement Speed [3] Friction [.7] slope: [8]\nend\n\ndefine Platformer Gravity: (gravity) Jump height: (jump height) Side Movement Speed (side movement) Friction (friction) slope: (slope)\nchange [y velocity v] by (gravity)\nchange y by (Y Velocity)\nif <touching (level v)?> then\n    repeat until <not <touching (level 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?> and <(([abs v] of (Y Velocity) ) / (Y Velocity)) = [-1]>> * (jump height))\nend\nset [x velocity v] to (((X Velocity) + ((<key (left arrow v) pressed?> * ((side movement) * (-1))) + (<key (right arrow v) pressed?> * (side movement)))) * (friction))\nchange x by (X Velocity)\nset [slope v] to [0]\nrepeat until <<(slope) = ((slope) * (-1))> or <not <touching (level v)?>>>\n    change y by (1)\n    change [slope v] by (-1)\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X Velocity) ) / (X Velocity)) * (-1))\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (oil v)?> then\n        go to x: (-170) y: (80)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching color (#d0a723)?> then\n        go to x: (-170) y: (80)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<<([costume # v] of [level v]) = [5]> and <touching (mouldyfrie v)?>> and <touching (mouldyfrie v)?>> then\n        go to x: (-170) y: (80)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (mouldyfrie v)?> then\n        go to x: (-170) y: (80)\n    end\nend\n\nwhen flag clicked\nplay sound [YAYAYAAYAY v] until done\n\n@level\n\nwhen flag clicked\nswitch costume to (1 v)\n\nwhen I receive [next v]\nnext costume\n\n@oil\n\n@door\n\nwhen flag clicked\nforever\n    show\n    switch backdrop to (start v)\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [10]> then\n        hide\n    end\nend\n\n@MouldyFrie\n\nwhen flag clicked\ngo to x: (-26) y: (-27)\nforever\n    repeat until <([costume # v] of [level v]) = [5]>\n        hide\n    end\n    broadcast (123456789 v)\nend\n\nwhen I receive [123456789 v]\nforever\n    show\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    if <([costume # v] of [level v]) = [7]> then\n        show\n        switch costume to (2 v)\n        go to x: (-2) y: (-85)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [8]> then\n        show\n        switch costume to (3 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [5]> then\n        show\n        switch costume to (1 v)\n        go to x: (-27) y: (-28)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [6]> then\n        show\n        switch costume to (1 v)\n        go to x: (-27) y: (-28)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [9]> then\n        go to x: (15) y: (-79)\n        show\n        switch costume to (4 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [10]> then\n        switch costume to (costume1 v)\n    end\nend\n\nswitch costume to (1 v)\n\n@Sprite1\n\nwhen flag clicked\nforever\n    repeat until <([costume # v] of [level v]) = [10]>\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <([costume # v] of [level v]) = [10]> then\n        show\n    end\nend\n\n@burger2\n\nwhen flag clicked\nset [ghost v] effect to (0)\ngo to [front v] layer\nwait (2) seconds\nrepeat (40)\n    change [ghost v] effect by (3)\nend\n\n