Platformer Engine
@Stage\n\nwhen flag clicked\nforever\n    play sound [tobu-higher v] until done\nend\n\n@Player\n\ndefine Physics Jump height: (height) velocity x: (velocity) gravity: (gravity) friction: (friction)\nif <not <touching (platform v)?>> then\n    change [yv v] by (gravity)\nend\nchange y by (YV)\ndie\nif <<touching (platform v)?> and <(YV) < [2]>> then\n    repeat until <not <touching (platform v)?>>\n        change y by (1)\n    end\n    set [yv v] to [0]\n    if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        set [yv v] to (height)\n    end\nelse\n    if <<touching (platform v)?> and <(YV) > [2]>> then\n        repeat until <not <touching (platform v)?>>\n            change y by (-1)\n        end\n        set [yv v] to [0]\n    end\nend\nif <<key (left arrow v) pressed?> or <<(x position) > (mouse x)> and <mouse down?>>> then\n    change [xv v] by ((0) - (velocity))\n    point in direction (-90)\nelse\n    if <<key (right arrow v) pressed?> or <<(mouse x) > (x position)> and <mouse down?>>> then\n        change [xv v] by (velocity)\n        point in direction (90)\n    end\nend\nset [xv v] to ((XV) * (friction))\nchange x by (XV)\ndie\nif <touching (platform v)?> then\n    change x by ((XV) * (-1))\n    if <(direction) = [-90]> then\n        set [xv v] to [-1]\n    end\n    if <(direction) = [90]> then\n        set [xv v] to [1]\n    end\nend\n\nwhen flag clicked\ngo to x: (-189) y: (-10)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    Physics Jump height: [15] velocity x: [1] gravity: [-1] friction: [.9]\n    if <(x position) > [230]> then\n        go to x: (-189) y: (-10)\n        broadcast (next level v)\n    end\nend\n\ndefine die\nif <touching color (#ff4c4c)?> then\n    go to x: (-189) y: (-10)\nend\n\n@platform\n\nwhen flag clicked\nswitch costume to (level 1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@thumbnail\n\nwhen flag clicked\nshow\nforever\n    set [ghost v] effect to (100)\nend\n\n
Hi there! \nThis is my new Platformer-engine!\nYou dont need to give credits!\n\nInformation\nthis has wall detection, celling detction and ground detection, slope detection\nfriction\nmobile friendly\nlol\n\n100% by me