Platformer Template 

Instructions: IT IS AN ENGINE, NOT AN ACTUAL GAME. \nThis is a project for Scratchers who want to create a platformer. Here is a sample platformer you can play. Inside, there are comments explaining the scripts and directions for customizing your game. Just customize it and remix it and it will be yours! \n\nInstructions for the sample game:\n- WAD or Arrow keys to move\n- Avoid the spikes\n- Try not to die :)\n- Enjoy!!!\nObviously the instructions would be very different after you customize it so feel free to also change the directions! \n\nIf you download any music or anything else, remember to give credit :)\n\nPlease love, favorite and follow! It would greatly help if you do so :) 

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop8 v)\n\nwhen flag clicked\nforever\n    play sound [Dubstep v] until done\nend\n\n@User-Controlled Sprite\n\nwhen flag clicked\nReset\nforever\n    if <(DEAD?) = [1]> then\n        Touch Spike\n    else\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            change [xv v] by (1)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            change [xv v] by (-1)\n        end\n        set [xv v] to ((XV) * (0.85))\n        change x by (XV)\n        if <touching (ground v)?> then\n            change y by (1)\n            if <touching (ground v)?> then\n                change y by (1)\n                if <touching (ground v)?> then\n                    change y by (1)\n                    if <touching (ground v)?> then\n                        change y by (1)\n                        if <touching (ground v)?> then\n                            change y by (1)\n                            if <touching (ground v)?> then\n                                change x by ((XV) * (-1))\n                                change y by (-5)\n                                if <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <key (w v) pressed?>> then\n                                    if <(XV) > [0]> then\n                                        set [xv v] to [-5]\n                                    else\n                                        set [xv v] to [5]\n                                    end\n                                    set [yv v] to [10]\n                                else\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change [yv v] by (-1)\n        change y by (YV)\n        if <touching (ground v)?> then\n            change y by ((YV) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <<touching (ground v)?> and <<<key (up arrow v) pressed?> or <key (space v) pressed?>> or <key (w v) pressed?>>> then\n            start sound [Jump v]\n            set [yv v] to [15]\n        end\n        change y by (1)\n    end\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <(User Controlled Sprite) = [0]> then\n        if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n            switch costume to (cat right v)\n        end\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            switch costume to (cat left v)\n        end\n    end\n    if <(User Controlled Sprite) = [1]> then\n        if <key (any v) pressed?> then\n            if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                switch costume to (box right v)\n            end\n            if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                switch costume to (box left v)\n            end\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                switch costume to (box jump v)\n            end\n        else\n            switch costume to (box v)\n        end\n    end\n    if <(User Controlled Sprite) = [2]> then\n        if <key (any v) pressed?> then\n            if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n                switch costume to (circle right v)\n            end\n            if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n                switch costume to (circle left v)\n            end\n            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                switch costume to (circle jump v)\n            end\n        else\n            switch costume to (circle v)\n        end\n    end\n    if <(User Controlled Sprite) = [3]> then\n        if <(YV) = [0]> then\n            if <([abs v] of (XV) ) > [0.5]> then\n                if <(costume [number v]) = [21]> then\n                    wait ((XV) * (0.001)) seconds\n                    switch costume to (person walking v)\n                else\n                    wait ((XV) * (0.001)) seconds\n                    next costume\n                end\n            else\n                switch costume to (person v)\n            end\n        else\n            switch costume to (person v)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <(User Controlled Sprite) = [3]>> then\n        point in direction (90)\n    end\nend\n\ndefine Reset\nshow variable [deaths v]\nset [dead? v] to [0]\ngo to x: (-200) y: (0)\nset [xv v] to [0]\nset [yv v] to [0]\nset [user controlled sprite v] to [3]\nset size to (100) %\nclear graphic effects\nshow\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    if <(x position) > [235]> then\n        broadcast (Next Level v)\n        Reset\n    end\nend\n\nwhen flag clicked\nforever\n    if <[0.5] > ([abs v] of (XV) )> then\n        set [xv v] to [0]\n    end\nend\n\nwhen flag clicked\nset [dead? v] to [0]\nforever\n    if <touching (obstacles v)?> then\n        set [dead? v] to [1]\n        if <(User Controlled Sprite) = [0]> then\n            start sound [Meow v]\n        else\n            start sound [Oops v]\n        end\n        Die\n    end\nend\n\ndefine Die\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nset [ghost v] effect to (100)\nReset\n\nwhen flag clicked\nset [deaths v] to [0]\nforever\n    if <touching (obstacles v)?> then\n        change [deaths v] by (1)\n        wait until <not <touching (obstacles v)?>>\n    end\nend\n\ndefine Touch Spike\nchange x by ((XV) * (-1))\nchange y by ((YV) * (-1))\nset [xv v] to [0]\nset [yv v] to [0]\n\n@Ground\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@Obstacles\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (level 1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@thumbnail\n\nwhen flag clicked\nhide\n\nshow\nhide variable [deaths v]\n\n