Scrolling Platformer Template v1.2
@Stage\n\nwhen I receive [green flag v]\nforever\n    wait (2) seconds\n    play sound [bensound-badass v] until done\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (GREEN FLAG v)\nbroadcast (PLAY GAME v)\n\nwhen I receive [green flag v]\nset rotation style [left-right v]\nhide\ngo to [front v] layer\n\nwhen I receive [play game v]\nset [level v] to [1]\nforever\n    broadcast (RESET v) and wait\n    broadcast (SET UP v) and wait\n    Game On\n    repeat until <(EXIT) > []>\n        Tick\n        broadcast (TICK v) and wait\n    end\n    Game Over\nend\n\ndefine Game On\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [speed y v] to [0]\nset [speed x v] to [0]\nset [exit v] to []\nshow\n\ndefine Tick\nswitch costume to (hitbox v)\nif <<key (a v) pressed?> or <key (left arrow v) pressed?>> then\n    change [speed x v] by (-2.7)\n    point in direction (-90)\nend\nif <<key (d v) pressed?> or <key (right arrow v) pressed?>> then\n    change [speed x v] by (2.7)\n    point in direction (90)\nend\nset [speed x v] to ((Speed X) * (0.8))\nif <([abs v] of (Speed X) ) > [0.9]> then\n    Change Player X By (round (Speed X))\nend\nif <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n    if <(in air) < [4]> then\n        set [speed y v] to [12]\n    end\nend\nchange [speed y v] by (-1)\nChange Player Y By (Speed Y)\nset [scroll x v] to (x)\nset [scroll y v] to (y)\nPosition\nswitch costume to (visual v)\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\n\ndefine Change Player Y By (speed y)\nchange [y v] by (speed y)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platforms v)?>>\n    if <(speed y) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [speed y v] to [0]\nend\n\ndefine Position\ngo to x: ((x) - (SCROLL X)) y: ((y) - (SCROLL Y))\n\ndefine Change Player X By (speed x)\nchange [x v] by (speed x)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platforms v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platforms v)?>>\n        if <(speed x) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game Over\nset [exit v] to []\nrepeat (5)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\n\n@Platforms\n\nwhen I receive [green flag v]\nshow\n\nwhen I receive [tick v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\nwhen I receive [set up v]\nset [x v] to [0]\nset [y v] to [0]\nswitch costume to (level 1-1 v)\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nchange [y v] by (70)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nchange [y v] by (-140)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (360)\nchange [y v] by (140)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (-360)\nchange [y v] by (140)\nnext costume\ncreate clone of (_myself_ v)\nchange [x v] by (-360)\nchange [y v] by (140)\nnext costume\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\n@Thumbnail\n\nwhen I receive [green flag v]\ngo to x: (0) y: (0)\nhide\n\ngo to [front v] layer\nshow\n\n
Use WASD to move the blob around. Feel free to remix and use for your own projects, just remember to credit me. This project is for people who are lazy and don't want to start from scratch every time they make a scrolling platformer (like me).\n\nThis includes basic movement, wall detection, ceiling detection, and hitboxes. No sounds effects yet!