[UPDATED] Scrolling Platformer Engine
@Stage\n\nwhen flag clicked\nsetup\n\ndefine setup\ndelete all of [settings v]\nadd [0] to [settings v]\nadd [1] to [settings v]\ndelete all of [block hardness v]\nadd [infinity] to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd [infinity] to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd ((10) * (10)) to [block hardness v]\nadd ((10) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((10) * (10)) to [block hardness v]\nadd ((10) * (10)) to [block hardness v]\nadd ((10) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((18) * (10)) to [block hardness v]\nadd ((100) * (10)) to [block hardness v]\nadd [1] to [block hardness v]\nadd [1] to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd [infinity] to [block hardness v]\nadd ((4) * (10)) to [block hardness v]\nadd [infinity] to [block hardness v]\nadd ((7) * (10)) to [block hardness v]\ndelete all of [sound types v]\nadd [] to [sound types v]\nadd [grass] to [sound types v]\nadd [gravel] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [gravel] to [sound types v]\nadd [stone] to [sound types v]\nadd [grass] to [sound types v]\nadd [wood] to [sound types v]\nadd [wood] to [sound types v]\nadd [stone] to [sound types v]\nadd [wood] to [sound types v]\nadd [wood] to [sound types v]\nadd [wood] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [stone] to [sound types v]\nadd [grass] to [sound types v]\nadd [wood] to [sound types v]\nadd [sand] to [sound types v]\nadd [grass] to [sound types v]\nadd [] to [sound types v]\nadd [grass] to [sound types v]\nadd [] to [sound types v]\nadd [stone] to [sound types v]\n\n@player\n\ndefine reset\nset size to (70) %\npoint in direction (90)\nset rotation style [left-right v]\nset [speed v] to [0]\nset [falling speed v] to [0]\ngo to x: (0) y: (0)\nset [player x v] to [-100]\nset [player y v] to [100]\nset [camera x v] to [-100]\nset [camera y v] to [100]\n\ndefine touch ground\nset [touching ground? v] to [0]\nset [slope v] to [0]\nif <(falling speed) < [0]> then\n    repeat until <<(slope) = [40]> or <not <touching (ground v)?>>>\n        set [touching ground? v] to [1]\n        set [falling speed v] to [0]\n        change [slope v] by (1)\n        change y by (1)\n    end\nelse\n    repeat until <<(slope) = [-40]> or <not <touching (ground v)?>>>\n        change [slope v] by (-1)\n        set [falling speed v] to [0]\n        change y by (-1)\n    end\nend\nif <(slope) = [40]> then\n    change y by (((0) - (slope)) + (1))\nelse\n    if <(slope) = [-40]> then\n        change y by (((0) - (slope)) + (-11))\n    end\nend\n\ndefine wall detection\nset [slope v] to [0]\nrepeat until <<(slope) = [8]> or <not <touching (ground v)?>>>\n    change [slope v] by (1)\n    change y by (1)\nend\nif <(slope) = [8]> then\n    change x by (() - (speed))\n    change y by (() - (slope))\n    set [speed v] to ((speed) * (0.05))\nend\n\ndefine center camera\nchange [player x v] by ((x position) - (last x))\nchange [player y v] by ((y position) - (last y))\nchange [camera x v] by (round (((player x) - (camera x)) / (5)))\nchange [camera y v] by (round (((player y) - (camera y)) / (5)))\nif <(y position) < [-175]> then\n    reset\nend\nif <(camera x) < [0]> then\n    set [camera x v] to [0]\nend\nif <(camera y) < [0]> then\n    set [camera y v] to [0]\nend\ngo to x: ((player x) + (() - (camera x))) y: ((player y) + (() - (camera y)))\n\nwhen flag clicked\nclear graphic effects\nshow\nreset\nforever\n    set [speed v] to ((speed) * (0.6))\n    change [speed v] by ((<<key (d v) pressed?> or <key (right arrow v) pressed?>> - <<key (a v) pressed?> or <key (left arrow v) pressed?>>) * (3))\n    point in direction (speed)\n    set [last y v] to (y position)\n    set [last x v] to (x position)\n    switch costume to (hitbox v)\n    change [falling speed v] by (-1)\n    if <<(touching ground?) = [1]> and <<key (w v) pressed?> or <key (up arrow v) pressed?>>> then\n        set [falling speed v] to [14]\n    end\n    if <(falling speed) < [-25]> then\n        set [falling speed v] to [-25]\n    end\n    change y by (falling speed)\n    touch ground\n    change x by (speed)\n    wall detection\n    switch costume to (player v)\n    center camera\nend\n\n@Ground\n\nwhen flag clicked\nmake clone at grid x: [0] and grid y: [0] with costume: [2]\nmake clone at grid x: [1] and grid y: [0] with costume: [3]\n\ndefine make clone at grid x: (x) and grid y: (y) with costume: (costume)\nset [clone x v] to (x)\nset [clone y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\nshow\nforever\n    switch costume to (size hack v)\n    go to x: (((0) - (camera x)) + ((clone x) * (480))) y: (((0) - (camera y)) + ((clone y) * (360)))\n    switch costume to (costume)\nend\n\n@Foreground\n\nwhen flag clicked\nmake clone at grid x: [0] and grid y: [0] with costume: [2]\nmake clone at grid x: [1] and grid y: [0] with costume: [3]\n\ndefine make clone at grid x: (x) and grid y: (y) with costume: (costume)\nset [clone x v] to (x)\nset [clone y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\ngo to [front v] layer\nshow\nforever\n    switch costume to (size hack v)\n    go to x: (((0) - (camera x)) + ((clone x) * (480))) y: (((0) - (camera y)) + ((clone y) * (360)))\n    switch costume to (costume)\nend\n\n@Background\n\nwhen flag clicked\nmake clone at grid x: [0] and grid y: [0] with costume: [2]\nmake clone at grid x: [1] and grid y: [0] with costume: [3]\n\ndefine make clone at grid x: (x) and grid y: (y) with costume: (costume)\nset [clone x v] to (x)\nset [clone y v] to (y)\nset [costume v] to (costume)\ncreate clone of (_myself_ v)\nhide\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nforever\n    switch costume to (size hack v)\n    go to x: (((0) - (camera x)) + ((clone x) * (480))) y: (((0) - (camera y)) + ((clone y) * (360)))\n    switch costume to (costume)\nend\n\n
My old scrolling platformer tutorial from my old account, @10010101001010101010 is very glitchy and is old, too. I made a new, updated scrolling platformer engine that you can use for your games if you give credit.\n\nNOT A GAME, IT IS CODE THAT YOU CAN USE