tutorial-pen platformer (tutorial+pen platformer)
@Stage\n\nwhen flag clicked\nforever\n    play sound [Vexento - Pixel Party v] until done\nend\n\n@player\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    set [exit v] to []\n    set [x vel v] to [0]\n    set [y vel v] to [0]\n    go to x: (-215) y: (10)\n    broadcast (setup v)\n    show\n    repeat until <[] < (EXIT)>\n        platformer\n    end\n    if <(EXIT) = [die]> then\n        repeat (3)\n            show\n            wait (0.3) seconds\n            hide\n            wait (0.3) seconds\n        end\n    else\n        change [level v] by (1)\n    end\n    if <(LEVEL) = [25]> then\n        set [level v] to [1]\n    end\nend\n\ndefine platformer\ntest-die\ntest-win\nset rotation style [left-right v]\nchange y by (y vel)\ntouch ground <[0] < (y vel)>\nif <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n    change [x vel v] by (3)\nend\nif <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n    change [x vel v] by (-3)\nend\nif <[0.5] < (x vel)> then\n    move (x vel)\n    point in direction (90)\nend\nif <[-0.5] > (x vel)> then\n    move (x vel)\n    point in direction (-90)\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(falling) < [4]>> then\n    set [y vel v] to [15]\nend\nif <touching color (#ffe900)?> then\n    set [y vel v] to [25]\nend\nchange [y vel v] by (-1.5)\n\ndefine touch ground <up>\nchange [falling v] by (1)\nrepeat until <not <touching color (#32ff00)?>>\n    set [y vel v] to [0]\n    if <up> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [falling v] to [0]\n    end\nend\n\ndefine move (step)\nset [slope v] to [0]\nchange x by (step)\nrepeat until <<(slope) = [8]> or <not <touching color (#32ff00)?>>>\n    change [slope v] by (1)\n    change y by (1)\nend\nif <(slope) = [8]> then\n    change x by (() - (step))\n    change y by (() - (slope))\nend\nset [x vel v] to ((x vel) * (0.73))\n\ndefine test-die\nif <(y position) < [-170]> then\n    set [exit v] to [die]\nend\nif <touching color (#ff0000)?> then\n    set [exit v] to [die]\nend\n\ndefine test-win\nif <[240] < (x position)> then\n    set [exit v] to [win]\nend\n\nwhen [x v] key pressed\nset [exit v] to [win]\n\nwhen [c v] key pressed\nif <not <(LEVEL) = [1]>> then\n    change [level v] by (-2)\n    set [exit v] to [win]\nend\n\nwhen [r v] key pressed\nset [exit v] to [die]\n\n@pen\n\ndefine draw line from x: (x) y: (y) to x: (x2) y: (y2) type: (type)\nif <(type) = [floor]> then\n    set pen color to (#33ff00)\nelse\n    if <(type) = [lava]> then\n        set pen color to (#ff0000)\n    else\n        if <(type) = [bounce]> then\n            set pen color to (#ffe900)\n        end\n    end\nend\ngo to x: (x) y: (y)\npen down\ngo to x: (x2) y: (y2)\npen up\n\nwhen I receive [setup v]\nstop [other scripts in sprite v]\npen up\nerase all\nset pen size to (5)\nset pen color to (#34ff00)\nforever\n    erase all\n    if <(LEVEL) = [1]> then\n        draw line from x: [-240] y: [-90] to x: [240] y: [-90] type: [floor]\n    else\n        if <(LEVEL) = [2]> then\n            draw line from x: [-240] y: [-90] to x: [-50] y: [-90] type: [floor]\n            draw line from x: [-50] y: [-90] to x: [-50] y: [0] type: [floor]\n            draw line from x: [-50] y: [0] to x: [50] y: [0] type: [floor]\n            draw line from x: [50] y: [0] to x: [50] y: [-90] type: [floor]\n            draw line from x: [50] y: [-90] to x: [240] y: [-90] type: [floor]\n        else\n            if <(LEVEL) = [3]> then\n                draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                draw line from x: [-50] y: [-90] to x: [50] y: [-90] type: [bounce]\n            else\n                if <(LEVEL) = [4]> then\n                    draw line from x: [-240] y: [-90] to x: [-100] y: [-90] type: [floor]\n                    draw line from x: [-50] y: [-90] to x: [50] y: [-90] type: [lava]\n                    draw line from x: [100] y: [-90] to x: [240] y: [-90] type: [floor]\n                else\n                    if <(LEVEL) = [5]> then\n                        draw line from x: [-240] y: [-90] to x: [-100] y: [-90] type: [floor]\n                        draw line from x: [-50] y: [-140] to x: [100] y: [-140] type: [floor]\n                        draw line from x: [160] y: [-90] to x: [160] y: [-120] type: [lava]\n                    else\n                        if <(LEVEL) = [6]> then\n                            draw line from x: [-240] y: [-90] to x: [-100] y: [0] type: [floor]\n                        else\n                            if <(LEVEL) = [7]> then\n                                draw line from x: [-240] y: [-90] to x: [240] y: [-90] type: [floor]\n                                draw line from x: [-100] y: [100] to x: [50] y: [100] type: [lava]\n                                draw line from x: [-80] y: [-85] to x: [-50] y: [-85] type: [bounce]\n                                draw line from x: [0] y: [-85] to x: [30] y: [-85] type: [bounce]\n                            else\n                                if <(LEVEL) = [8]> then\n                                    draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                    draw line from x: [-160] y: [0] to x: [-100] y: [0] type: [floor]\n                                    draw line from x: [-50] y: [80] to x: [0] y: [80] type: [floor]\n                                    draw line from x: [50] y: [130] to x: [200] y: [130] type: [floor]\n                                else\n                                    if <(LEVEL) = [9]> then\n                                        draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                        draw line from x: [0] y: [-180] to x: [50] y: [-180] type: [bounce]\n                                    else\n                                        if <(LEVEL) = [10]> then\n                                            draw line from x: [-240] y: [-90] to x: [240] y: [-90] type: [floor]\n                                            draw line from x: [-150] y: [-90] to x: [-130] y: [-50] type: [lava]\n                                            draw line from x: [-130] y: [-50] to x: [-110] y: [-90] type: [lava]\n                                            draw line from x: [0] y: [-90] to x: [20] y: [-50] type: [lava]\n                                            draw line from x: [20] y: [-50] to x: [40] y: [-90] type: [lava]\n                                            draw line from x: [150] y: [-90] to x: [170] y: [-50] type: [lava]\n                                            draw line from x: [170] y: [-50] to x: [190] y: [-90] type: [lava]\n                                        else\n                                            if <(LEVEL) = [11]> then\n                                                draw line from x: [-240] y: [-90] to x: [240] y: [-90] type: [floor]\n                                            else\n                                                if <(LEVEL) = [12]> then\n                                                    draw line from x: [-240] y: [-90] to x: [240] y: [160] type: [floor]\n                                                else\n                                                    if <(LEVEL) = [13]> then\n                                                        draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                    else\n                                                        if <(LEVEL) = [14]> then\n                                                            draw line from x: [-240] y: [-90] to x: [120] y: [50] type: [floor]\n                                                        else\n                                                            if <(LEVEL) = [15]> then\n                                                                draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                                draw line from x: [-100] y: [-50] to x: [-60] y: [-50] type: [bounce]\n                                                            else\n                                                                if <(LEVEL) = [16]> then\n                                                                    draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                                    draw line from x: [30] y: [10] to x: [] y: [] type: [floor]\n                                                                    draw line from x: [] y: [1] to x: [] y: [] type: [lava]\n                                                                else\n                                                                    if <(LEVEL) = [17]> then\n                                                                        draw line from x: [-240] y: [-50] to x: [-200] y: [-50] type: [floor]\n                                                                        draw line from x: [-240] y: [30] to x: [-200] y: [30] type: [floor]\n                                                                        draw line from x: [-240] y: [100] to x: [-200] y: [100] type: [floor]\n                                                                        draw line from x: [-170] y: [140] to x: [240] y: [140] type: []\n                                                                    else\n                                                                        if <(LEVEL) = [18]> then\n                                                                            draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                                            draw line from x: [240] y: [-90] to x: [-200] y: [-90] type: [lava]\n                                                                            draw line from x: [-170] y: [0] to x: [-170] y: [0] type: [floor]\n                                                                            draw line from x: [-60] y: [40] to x: [-60] y: [40] type: [floor]\n                                                                        else\n                                                                            if <(LEVEL) = [19]> then\n                                                                                draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                                                draw line from x: [-20] y: [] to x: [] y: [] type: []\n                                                                            else\n                                                                                if <(LEVEL) = [20]> then\n                                                                                    draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                                                else\n                                                                                    if <(LEVEL) = [21]> then\n                                                                                        draw line from x: [-240] y: [-90] to x: [-200] y: [-90] type: [floor]\n                                                                                        draw line from x: [-210] y: [0] to x: [240] y: [] type: [floor]\n                                                                                    else\n                                                                                        if <(LEVEL) = [22]> then\n                                                                                            draw line from x: [-240] y: [-40] to x: [240] y: [-40] type: [floor]\n                                                                                        else\n                                                                                            if <(LEVEL) = [23]> then\n                                                                                                draw line from x: [-240] y: [0] to x: [240] y: [0] type: [floor]\n                                                                                            else\n                                                                                                if <(LEVEL) = [24]> then\n                                                                                                    draw line from x: [-240] y: [-90] to x: [240] y: [-90] type: [floor]\n                                                                                                end\n                                                                                            end\n                                                                                        end\n                                                                                    end\n                                                                                end\n                                                                            end\n                                                                        end\n                                                                    end\n                                                                end\n                                                            end\n                                                        end\n                                                    end\n                                                end\n                                            end\n                                        end\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\n@tutor\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [back v] layer\n    switch costume to (LEVEL)\nend\n\n@picturs\n\n@thum\n\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\n\nwhen flag clicked\nhide\n\n
wsad or arrow keys to move \nx to skip level\nc to go back a level\nr to restart a level\n\nplatformer basics:\nhttps://scratch.mit.edu/projects/391302780