Platformer Template
@Stage\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [level v] to [1]\nforever\n    switch costume to (Level)\nend\n\n@Player\n\nwhen flag clicked\nshow\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (Spawn X) y: (Spawn Y)\nforever\n    if <key (right arrow v) pressed?> then\n        change [x velocity v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x velocity v] by (-1)\n    end\n    set [x velocity v] to ((X velocity) * (0.9))\n    change x by (X velocity)\n    if <touching (level v)?> then\n        Sense Hazard\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change x by ((X velocity) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(X velocity) > [0]> then\n                                    set [x velocity v] to [-5]\n                                else\n                                    set [x velocity v] to [5]\n                                end\n                                set [y velocity v] to [10]\n                            else\n                                set [x velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (Y velocity)\n    if <touching (level v)?> then\n        Sense Hazard\n        change y by ((Y velocity) * (-1))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        Sense Hazard\n        if <key (up arrow v) pressed?> then\n            change [y velocity v] by (15)\n        end\n    end\n    change y by (1)\n    if <(x position) > [230]> then\n        change [level v] by (1)\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        go to x: (Spawn X) y: (Spawn Y)\n    end\n    if <(y position) < [-184]> then\n        set [x velocity v] to [0]\n        set [y velocity v] to [0]\n        go to x: (Spawn X) y: (Spawn Y)\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume1 v)\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (costume2 v)\n    end\nend\n\nwhen flag clicked\nset [spawn x v] to [-214]\nset [spawn y v] to [-90]\n\nwhen flag clicked\nset [total level count v] to [99999]\n\ndefine Sense Hazard\nif <touching color (#ff0000)?> then\n    set [x velocity v] to [0]\n    set [y velocity v] to [0]\n    go to x: (Spawn X) y: (Spawn Y)\nend\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [level v] to [1]\nforever\n    switch costume to (Level)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n@Non-interacting level\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\nset [level v] to [1]\nforever\n    switch costume to (Level)\nend\n\n@Final screen\n\nwhen flag clicked\nhide\ngo to x: (0) y: (0)\nwait (0.3) seconds\nforever\n    if <(Level) > (Total Level Count)> then\n        show\n        stop [other scripts in sprite v]\n    end\nend\n\n
Edit this to make your own platformer.\n\nThis is a template that I made for JS_Coder's tutorial.\nFind that here: https://scratch.mit.edu/projects/370583228\nI put some notes in the code to explain what each part does.\n\nI added some things that weren't in that tutorial. You can tell because I say which ones I added in the notes.\nSome features that I added were hazards, turning player sprites, changeable spawn point variables,