my first platformer
@Stage\n\n@Sprite1\n\nwhen flag clicked\nshow\nswitch backdrop to (blue sky 2  v)\ngo to x: (-212) y: (-116)\nset [falling? v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset size to (70) %\nforever\n    phycics\nend\n\ndefine phycics\nchange [yv v] by (-1)\nchange y by (yv)\nchange [falling? v] by (1)\ntouch ground <(yv) > [0]>\nif <<<key (up arrow v) pressed?> and <(falling?) < [3]>> or <<<mouse down?> and <(mouse y) > (y position)>> and <(falling?) < [3]>>> then\n    set [yv v] to [10]\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [xv v] by (-1.5)\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xv v] by (1.5)\nend\nset [xv v] to ((xv) * (0.85))\nchange x by (xv)\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching color (#00ff15)?>>>\n    change y by (1)\n    change [slope v] by (1)\nend\nif <(slope) = [8]> then\n    change x by ((xv) * (-1))\n    change y by ((slope) * (-1))\n    if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        if <(xv) > [0]> then\n            set [xv v] to ((-15) * (0.8))\n        else\n            set [xv v] to ((15) * (0.8))\n        end\n        set [yv v] to ((15) * (0.8))\n    end\nend\nif <<<touching color (#ff0000)?> or <touching color (#9e0000)?>> or <touching color (#000000)?>> then\n    go to x: (-212) y: (-123)\nend\nif <(x position) > [238]> then\n    switch backdrop to (next backdrop v)\n    go to x: (-212) y: (-116)\nend\n\ndefine touch ground <up?>\nrepeat until <not <<touching color (#00ff15)?> or <touching color (#565656)?>>>\n    if <up?> then\n        change y by (-1)\n    else\n        set [falling? v] to [0]\n        change y by (1)\n    end\n    set [yv v] to [0]\nend\n\nwhen flag clicked\nforever\n    if <(backdrop [number v]) = [11]> then\n        hide\n        stop [all v]\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to [front v] layer\nshow\nhide\n\n
Use the arrow keys to move. Find your way back home!\nLike and fave to reduce lag.rgmogbgbkrikiosvphkpioutnaunftfdiosvgbgbiouqunmtlpmtcsiwftiogbioiosvikkriomoiomogbgbiogbiogbiogbiogbiogbiogbiogbiogbiogbiomoiogbiogbiomoiogbiogbiogbiogbiogbiogbiogbiogbiogbiomoiogbiogbiomoiogbiogbio\n