Platformer Engine
@Stage\n\n@level\n\n@player\n\nwhen flag clicked\nset [wall jumping v] to [1]\nreset\n\ndefine Touch ground <something above>\nchange [in air? v] by (1)\nif <touching color (#323232)?> then\n    repeat until <not <touching color (#323232)?>>\n        if <something above> then\n            change y by (-1)\n        else\n            change y by (1)\n            set [in air? v] to [0]\n        end\n        set [yv v] to [0]\n    end\nelse\n    if <(yv) < [0]> then\n        repeat until <not <touching color (#ffff00)?>>\n            change y by (1)\n            set [yv v] to [22]\n            set [in air? v] to [0]\n        end\n    end\nend\n\ndefine reset\ngo to x: (0) y: (0)\nset [yv v] to [0]\nset [xv v] to [0]\nforever\n    change [xv v] by (<key (right arrow v) pressed?> - <key (left arrow v) pressed?>)\n    set [xv v] to ((xv) * (0.88))\n    change x by (xv)\n    if <touching color (#323232)?> then\n        change x by ((0) - (xv))\n        if <(Wall jumping) = [1]> then\n            if <key (up arrow v) pressed?> then\n                if <(xv) > [0]> then\n                    set [xv v] to [-12]\n                else\n                    set [xv v] to [12]\n                end\n                set [yv v] to [12]\n            else\n                set [xv v] to [0]\n            end\n        end\n    end\n    if <touching color (#57a1ff)?> then\n        if <key (up arrow v) pressed?> then\n            change [yv v] by (0.5)\n        else\n            change [yv v] by (-.05)\n        end\n    else\n        change [yv v] by (-1)\n    end\n    if <key (up arrow v) pressed?> then\n        if <touching color (#57a1ff)?> then\n        else\n            if <(in air?) < [4]> then\n                set [yv v] to [12]\n            end\n        end\n    end\n    change y by (yv)\n    if <touching color (#ff4b4b)?> then\n        go to [back v] layer\n        reset\n    else\n        go to [front v] layer\n    end\n    Touch ground <(yv) > [0]>\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\n
Hello, @vivmsquash here, with a platformer engine! This platformer engine includes:\n• Wall detection\n• Ceiling detection\n• Wall jumping\n• Water detection\n• Trampoline detection\n• Lava/spike detection\n• Velocity movement\n100% by me! Feel free to remix without credit or use code with credit!