Platformer Code!
@Stage\n\nwhen flag clicked\nforever\nend\n\n@player\n\ndefine None\nchange y by (y vel)\nif <touching (ground v)?> then\n    repeat ([abs v] of (y vel) )\n        if <touching (ground v)?> then\n            change y by ((-1) * (([abs v] of (y vel) ) / (y vel)))\n        end\n    end\n    if <<key (up arrow v) pressed?> and <not <(y vel) > [0]>>> then\n        set [y vel v] to (jump height)\n    else\n        set [y vel v] to [0]\n    end\nelse\n    change [y vel v] by (gravity)\nend\nif <key (right arrow v) pressed?> then\n    change [x vel v] by (movement speed)\nend\nif <key (left arrow v) pressed?> then\n    change [x vel v] by ((-1) * (movement speed))\nend\nchange x by (x vel)\nif <touching (ground v)?> then\n    set [old y v] to (y position)\n    repeat (([abs v] of (x vel) ) + (1))\n        if <touching (ground v)?> then\n            change y by (1)\n        end\n    end\n    if <touching (ground v)?> then\n        set y to (old y)\n        repeat ([ceiling v] of ([abs v] of (x vel) ) )\n            if <touching (ground v)?> then\n                change x by ((-1) * (([abs v] of (x vel) ) / (x vel)))\n            end\n        end\n        if <key (up arrow v) pressed?> then\n            if <(x vel) < [0]> then\n                set [x vel v] to [0]\n                if <key (left arrow v) pressed?> then\n                    set [x vel v] to (wall jump hm)\n                    set [y vel v] to (wall jump vm)\n                end\n            else\n                set [x vel v] to [0]\n                if <key (right arrow v) pressed?> then\n                    set [x vel v] to ((-1) * (wall jump hm))\n                    set [y vel v] to (wall jump vm)\n                end\n            end\n        end\n    end\nend\nset [x vel v] to ((x vel) * (friction))\n\nwhen flag clicked\ngo to x: (-34) y: (-117)\nshow\nset [y vel v] to [0]\nset [x vel v] to [0]\nforever\n    platform physics (12) (-1) (0.9) (1) (8) (8)\nend\n\n@ground\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\nend\n\n
This is the basic coding for a platformer!\nDo whatever you want with it!\nFor this code you need to make the obstacles and ground a seperate sprite and you have to specifically name the sprite ground as spelt there or change it in the code up to you