100% Pen Platformer (Penformer)

Instructions: 100% Pen! Dark mode supported! [M] Key.\nInstructions:\nArrow keys or WASD or tap on screen and hold.\nBlack or Blue - Ground. Red - Lava. Gray - Spikes. Yellow - Bounce. Green - Swamp.\n[M] Key to turn on/off dark mode.\n[R] Key - Respawn.\n[S] Key - Skip level. Press only when the blue letter S appears. Or, to skip a level, tap on the letter S on the screen.\nTURBO MODE IS BLOCKED!\nPlay on a small screen or the quality will be poor.\nEnjoy!

@Stage\n\n@Pen\n\ndefine Platformer Engine\nchange [yv v] by (-0.5)\nTouch test\nTesting for arrow keys\nif <(Right) = [true]> then\n    change [xv v] by (1)\nend\nTesting for arrow keys\nif <(Left) = [true]> then\n    change [xv v] by (-1)\nend\nif <[touching v] contains [4]?> then\n    set [xv v] to ((xv) * (0.6))\nelse\n    set [xv v] to ((xv) * (0.84))\nend\nchange [player x v] by (xv)\nTouch test\nif <[touching v] contains [1]?> then\n    change [player y v] by (1)\n    Touch test\n    if <[touching v] contains [1]?> then\n        change [player y v] by (1)\n        Touch test\n        if <[touching v] contains [1]?> then\n            change [player y v] by (1)\n            Touch test\n            if <[touching v] contains [1]?> then\n                change [player y v] by (1)\n                Touch test\n                if <[touching v] contains [1]?> then\n                    change [player y v] by (1)\n                    Touch test\n                    if <[touching v] contains [1]?> then\n                        change [player y v] by (1)\n                        Touch test\n                        if <[touching v] contains [1]?> then\n                            change [player y v] by (-6)\n                            change [player x v] by ((xv) * (-1))\n                            Testing for arrow keys\n                            if <(Up) = [true]> then\n                                set [yv v] to [6]\n                                if <(xv) > [0]> then\n                                    set [xv v] to [-8]\n                                else\n                                    set [xv v] to [8]\n                                end\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\nTouch test\nchange [player y v] by (yv)\nTouch test\nif <[touching v] contains [1]?> then\n    change [player y v] by ((yv) * (-1))\n    set [yv v] to [0]\nend\nTouch test\nchange [player y v] by (-0.5)\nTouch test\nTesting for arrow keys\nif <[touching v] contains [1]?> then\n    if <(Up) = [true]> then\n        if <[touching v] contains [4]?> then\n            set [yv v] to [8]\n        else\n            set [yv v] to [10]\n        end\n    end\nend\nTouch test\nchange [player y v] by (0.5)\nTouch test\nif <<[touching v] contains [2]?> or <<[touching v] contains [3]?> or <(Player Y) < [-220]>>> then\n    change [deaths count v] by (1)\n    set [player x v] to [-200]\n    set [player y v] to [0]\n    set [xv v] to [0]\n    set [yv v] to [0]\nend\nTouch test\nif <[touching v] contains [5]?> then\n    set [yv v] to [15]\nend\nTouch test\nif <[touching v] contains [6]?> then\n    set [yv v] to [-10]\nend\nTouch test\nif <<(Player X) > [240]> or <<(Deaths Count) > [15]> and <<key (s v) pressed?> or <<mouse down?> and <<(mouse x) < [-210]> and <(mouse y) > [140]>>>>>> then\n    if <(Level) < [14]> then\n        set [deaths count v] to [0]\n        change [level v] by (1)\n        set [player x v] to [-200]\n        set [player y v] to [0]\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\nend\nif <(Player X) < [-270]> then\n    set [player x v] to [-270]\nend\nif <key (r v) pressed?> then\n    set [player x v] to [-200]\n    set [player y v] to [0]\n    set [xv v] to [0]\n    set [yv v] to [0]\nend\n\ndefine Testing for arrow keys\nset [right v] to <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<key ((join [] [в]) v) pressed?> or <<mouse down?> and <(mouse x) > (Player X)>>>>>\nset [left v] to <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<key ((join [] [ф]) v) pressed?> or <<mouse down?> and <(mouse x) < (Player X)>>>>>\nset [up v] to <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<key ((join [] [ц]) v) pressed?> or <<mouse down?> and <(mouse y) > (Player Y)>>>>>\n\nwhen flag clicked\nerase all\npen up\nLevel\nset [player x v] to [-200]\nset [player y v] to [0]\nset [xv v] to [0]\nset [yv v] to [0]\nset [pen size v] to [5]\nset [player size v] to [25]\nset [i v] to [0]\nset [dark mode v] to [0]\nset [level v] to [1]\nset [deaths count v] to [0]\nforever\n    Level\n    Draw\n    Platformer Engine\nend\n\ndefine Touch test\ndelete all of [touching v]\nset [i v] to [0]\nrepeat (length of [level x v])\n    change [i v] by (1)\n    if <<<(Player X) < ((item (i) of [level x v]) + (item (i) of [level width v]))> and <((Player X) + (Player Size)) > (item (i) of [level x v])>> and <<(Player Y) < ((item (i) of [level y v]) + (item (i) of [level height v]))> and <((Player Y) + (Player Size)) > (item (i) of [level y v])>>> then\n        if <not <[touching v] contains (item (i) of [level type v])?>> then\n            add (item (i) of [level type v]) to [touching v]\n        end\n    end\nend\n\ndefine Create level line (x) (y) (width) (height) (type)\nadd (x) to [level x v]\nadd (y) to [level y v]\nadd (width) to [level width v]\nadd (height) to [level height v]\nadd (type) to [level type v]\n\ndefine Level\ndelete all of [level x v]\ndelete all of [level y v]\ndelete all of [level width v]\ndelete all of [level height v]\ndelete all of [level type v]\nif <(Level) = [1]> then\n    Create level line [-220] [-160] [440] [25] [1]\nelse\n    if <(Level) = [2]> then\n        Create level line [-220] [-160] [202] [25] [1]\n        Create level line [-20] [-160] [50] [25] [2]\n        Create level line [28] [-160] [192] [25] [1]\n    else\n        if <(Level) = [3]> then\n            Create level line [-220] [-160] [215] [25] [1]\n            Create level line [-8] [-160] [25] [110] [3]\n            Create level line [14] [-160] [206] [25] [1]\n        else\n            if <(Level) = [4]> then\n                Create level line [-220] [-160] [202] [25] [1]\n                Create level line [-20] [-160] [50] [25] [5]\n                Create level line [28] [-138] [25] [200] [2]\n                Create level line [28] [-160] [192] [25] [1]\n            else\n                if <(Level) = [5]> then\n                    Create level line [-220] [-160] [440] [25] [1]\n                    Create level line [-220] [135] [440] [25] [1]\n                    Create level line [-100] [-138] [25] [200] [1]\n                    Create level line [-10] [-82] [25] [220] [1]\n                    Create level line [80] [-138] [25] [200] [1]\n                else\n                    if <(Level) = [6]> then\n                        Create level line [-220] [-160] [440] [25] [1]\n                        Create level line [-230] [-138] [460] [80] [4]\n                    else\n                        if <(Level) = [7]> then\n                            Create level line [-220] [-160] [440] [25] [1]\n                            Create level line [-150] [-138] [60] [80] [2]\n                            Create level line [-10] [-138] [40] [80] [2]\n                            Create level line [110] [-138] [60] [80] [2]\n                        else\n                            if <(Level) = [8]> then\n                                Create level line [-220] [-160] [180] [25] [1]\n                                Create level line [-65] [-138] [25] [200] [1]\n                                Create level line [-120] [-138] [58] [25] [5]\n                                Create level line [-42] [37] [52] [25] [1]\n                                Create level line [8] [37] [72] [25] [2]\n                                Create level line [-62] [60] [275] [18] [4]\n                                Create level line [78] [37] [52] [25] [1]\n                                Create level line [128] [37] [72] [25] [2]\n                                Create level line [198] [37] [20] [25] [1]\n                            else\n                                if <(Level) = [9]> then\n                                    Create level line [-220] [-160] [440] [25] [5]\n                                    Create level line [-220] [50] [25] [25] [1]\n                                    Create level line [-197] [50] [150] [25] [2]\n                                    Create level line [-49] [50] [25] [25] [1]\n                                    Create level line [-26] [50] [150] [25] [2]\n                                    Create level line [122] [50] [25] [25] [1]\n                                    Create level line [145] [50] [75] [25] [2]\n                                else\n                                    if <(Level) = [10]> then\n                                        Create level line [-220] [-160] [440] [25] [5]\n                                        Create level line [-220] [60] [440] [25] [6]\n                                        Create level line [-150] [-100] [25] [25] [3]\n                                        Create level line [-95] [0] [25] [25] [3]\n                                        Create level line [-40] [-100] [25] [25] [3]\n                                        Create level line [15] [0] [25] [25] [3]\n                                        Create level line [70] [-100] [25] [25] [3]\n                                        Create level line [130] [0] [25] [25] [3]\n                                    else\n                                        if <(Level) = [11]> then\n                                            Create level line [-220] [-160] [60] [25] [1]\n                                            Create level line [-162] [-160] [50] [25] [5]\n                                            Create level line [-114] [-160] [20] [230] [2]\n                                            Create level line [-96] [-160] [50] [25] [5]\n                                            Create level line [-48] [-160] [20] [230] [2]\n                                            Create level line [-30] [-160] [50] [25] [5]\n                                            Create level line [18] [-160] [20] [230] [2]\n                                            Create level line [36] [-160] [50] [25] [5]\n                                            Create level line [84] [-160] [20] [230] [2]\n                                            Create level line [102] [-160] [50] [25] [5]\n                                            Create level line [150] [-160] [70] [25] [1]\n                                        else\n                                            if <(Level) = [12]> then\n                                                Create level line [-240] [-180] [480] [360] [4]\n                                                Create level line [-220] [-160] [440] [25] [1]\n                                                Create level line [-150] [-138] [14] [14] [3]\n                                                Create level line [-50] [-138] [14] [14] [3]\n                                                Create level line [50] [-138] [14] [14] [3]\n                                                Create level line [150] [-138] [14] [14] [3]\n                                            else\n                                                if <(Level) = [13]> then\n                                                    Create level line [-220] [-160] [80] [25] [1]\n                                                    Create level line [-142] [-160] [360] [25] [2]\n                                                    Create level line [193] [-138] [25] [231] [2]\n                                                    Create level line [-80] [-20] [60] [25] [1]\n                                                    Create level line [158] [90] [60] [25] [1]\n                                                else\n                                                    Create level line [-220] [-160] [440] [25] [1]\n                                                    Create level line [-235] [-160] [25] [300] [1]\n                                                    Create level line [210] [-160] [25] [300] [1]\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\ndefine Draw\nerase all\npen up\nset pen size to (Pen Size)\nset [i v] to [0]\nrepeat (length of [level x v])\n    change [i v] by (1)\n    go to x: ((item (i) of [level x v]) + (Pen Size)) y: ((item (i) of [level y v]) + (Pen Size))\n    set pen color to (#000000)\n    if <(item (i) of [level type v]) = [1]> then\n        if <(Dark Mode) = [1]> then\n            set pen color to (#3396e2)\n        else\n            set pen color to (#000000)\n        end\n    else\n        if <(item (i) of [level type v]) = [2]> then\n            set pen color to (#ff0000)\n        else\n            if <(item (i) of [level type v]) = [3]> then\n                set pen color to (#808080)\n            else\n                if <(item (i) of [level type v]) = [4]> then\n                    set pen color to (#10ff00)\n                else\n                    set pen color to (#fff600)\n                end\n            end\n        end\n    end\n    pen down\n    go to x: (((item (i) of [level x v]) + (item (i) of [level width v])) - (Pen Size)) y: ((item (i) of [level y v]) + (Pen Size))\n    go to x: (((item (i) of [level x v]) + (item (i) of [level width v])) - (Pen Size)) y: (((item (i) of [level y v]) + (item (i) of [level height v])) - (Pen Size))\n    go to x: ((item (i) of [level x v]) + (Pen Size)) y: (((item (i) of [level y v]) + (item (i) of [level height v])) - (Pen Size))\n    go to x: ((item (i) of [level x v]) + (Pen Size)) y: ((item (i) of [level y v]) + (Pen Size))\n    pen up\nend\nif <(Dark Mode) = [1]> then\n    set pen color to (#3396e2)\nelse\n    set pen color to (#000000)\nend\ngo to x: (Player X) y: (Player Y)\npen down\ngo to x: (Player X) y: ((Player Y) + (Player Size))\ngo to x: ((Player X) + (Player Size)) y: ((Player Y) + (Player Size))\ngo to x: ((Player X) + (Player Size)) y: (Player Y)\ngo to x: (Player X) y: (Player Y)\npen up\nif <(Deaths Count) > [15]> then\n    set pen color to (#008fff)\n    go to x: (-218) y: (172)\n    pen down\n    change x by (-14)\n    change y by (-12)\n    change x by (14)\n    change y by (-12)\n    change x by (-14)\nend\n\nwhen flag clicked\nswitch backdrop to (light mode v)\nforever\n    if <key (m v) pressed?> then\n        if <(Dark Mode) = [1]> then\n            set [dark mode v] to [0]\n            switch backdrop to (light mode v)\n        else\n            set [dark mode v] to [1]\n            switch backdrop to (dark mode v)\n        end\n        wait until <not <key (m v) pressed?>>\n    end\nend\n\nwhen flag clicked\nset [turbo detector v] to [0]\nforever\n    set [turbo detector v] to (timer)\n    repeat (10)\n        set size to (size) %\n    end\n    if <not <((timer) - (Turbo Detector)) > [0.1]>> then\n        stop [all v]\n    end\nend\n\nset [deaths count v] to [20]\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n