Sketch- A  Mobile Friendly Platformer

Instructions: READ ALL INSTRUCTIONS\nDouble-click green flag\nArrow keys, WASD, or mobile to move\nR or restart button to restart\nClick/tap the pen on the bottom-left corner to be able to draw (draw with mouse/finger) and click/tap it again so that you can move on mobile\nThe pen will say "Equipped" if it's equipped (use fullscreen to see)\nClick/tap the eraser on the bottom-left corner to erase all\nWhen you erase, you get 1/4 of your ink back\nIf you run out of ink, you might want to click the green flag again\nYou can't move when you're drawing\n40 levels\nNo ads

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [next level v]\nswitch backdrop to (backdrop2 v)\nwait (0.2) seconds\nswitch backdrop to (backdrop1 v)\n\nwhen I receive [done v]\nswitch backdrop to (backdrop3 v)\n\n@Stickman \n\nwhen flag clicked\nshow\nforever\n    if <(Die?) = [No]> then\n        if <(Stop?) = [No]> then\n            if <not <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n                if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n                    switch costume to (walk1 v)\n                    wait (0.05) seconds\n                    switch costume to (walk2 v)\n                    wait (0.05) seconds\n                    switch costume to (walk3 v)\n                    wait (0.05) seconds\n                    switch costume to (walk4 v)\n                    wait (0.05) seconds\n                    switch costume to (walk5 v)\n                    wait (0.05) seconds\n                    switch costume to (walk6 v)\n                    wait (0.05) seconds\n                    switch costume to (walk7 v)\n                    wait (0.05) seconds\n                    switch costume to (walk8 v)\n                    wait (0.05) seconds\n                end\n                if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n                    switch costume to (costume1 v)\n                    wait (0.05) seconds\n                    switch costume to (costume2 v)\n                    wait (0.05) seconds\n                    switch costume to (costume3 v)\n                    wait (0.05) seconds\n                    switch costume to (costume4 v)\n                    wait (0.05) seconds\n                    switch costume to (costume5 v)\n                    wait (0.05) seconds\n                    switch costume to (costume6 v)\n                    wait (0.05) seconds\n                    switch costume to (costume7 v)\n                    wait (0.05) seconds\n                    switch costume to (costume8 v)\n                    wait (0.05) seconds\n                end\n            end\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n                if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n                    switch costume to (walk1 v)\n                end\n                if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n                    switch costume to (costume1 v)\n                end\n            end\n        end\n    end\n    if <(Stop?) = [Yes]> then\n        switch costume to (walk1 v)\n    end\n    if <<touching (eraser v)?> or <<(y position) < [-168]> or <(Die?) = [yes]>>> then\n        if <(costume [number v]) < [9]> then\n            wait (0.02) seconds\n            switch costume to (erase v)\n            wait (0.02) seconds\n            switch costume to (erase2 v)\n            wait (0.02) seconds\n            switch costume to (erase3 v)\n            wait (0.02) seconds\n            switch costume to (erase4 v)\n            wait (0.02) seconds\n            switch costume to (erase5 v)\n            wait (0.02) seconds\n            switch costume to (erase6 v)\n            wait (0.02) seconds\n            switch costume to (erase7 v)\n            wait (0.02) seconds\n            switch costume to (erase8 v)\n            hide\n        end\n        if <(costume [number v]) > [8]> then\n            wait (0.02) seconds\n            switch costume to (erase-2 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-2 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-3 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-4 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-5 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-6 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-7 v)\n            wait (0.02) seconds\n            switch costume to (erase-2-8 v)\n            hide\n        end\n        switch costume to (walk1 v)\n        show\n    end\nend\n\nwhen I receive [die v]\nif <(costume [number v]) > [8]> then\n    switch costume to (costume1 v)\nend\n\nwhen I receive [die v]\nif <(costume [number v]) < [9]> then\n    switch costume to (walk1 v)\nend\n\nwhen I receive [next level v]\nhide\nwait (0.2) seconds\nshow\n\nwhen I receive [done v]\nhide\n\nwhen flag clicked\nforever\n    go to (hitbox v)\nend\n\nhide\n\nhide\n\n@hitbox\n\nwhen flag clicked\nforever\n    if  then\n        broadcast (NEXT LEVEL v)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-242) y: (-50)\n        wait (.2) seconds\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nset [die? v] to [No]\npoint in direction (90)\nset [yv v] to [0]\nset [xv v] to [0]\nset [level v] to [1]\nswitch costume to (costume1 v)\nshow\ngo to x: (-200) y: (-50)\nforever\n    if <(Stop?) = [No]> then\n        set size to (50) %\n        go to [front v] layer\n        if <touching color (#000000)?> then\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n                set [yv v] to [10.5]\n            end\n        end\n        change y by (1)\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            change [xv v] by (1)\n        end\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n            change [xv v] by (-1)\n        end\n        set [xv v] to ((xv) * (0.88))\n        change x by (xv)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change x by ((xv) * (-1))\n                                change y by (-5)\n                                if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n                                    if <(xv) > [0]> then\n                                        set [xv v] to [-2]\n                                    else\n                                        set [xv v] to [-2]\n                                    end\n                                    set [yv v] to [-2]\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 color (#000000)?> then\n            change y by ((yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <key (r v) pressed?> then\n            go to x: (-242) y: (-50)\n            set [xv v] to [0]\n            set [yv v] to [0]\n        end\n    end\n    if <<(Ink) < [0]> or <(Ink) = [0]>> then\n        set [ink v] to [0]\n    end\n    if <(Level) = [41]> then\n        broadcast (Done v)\n    end\n    if <<touching (eraser v)?> or <(y position) < [-168]>> then\n        set [die? v] to [Yes]\n        wait (0.5) seconds\n        broadcast (Die v)\n        go to x: (-242) y: (-50)\n        set [die? v] to [No]\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\nend\n\nwhen I receive [restart v]\ngo to x: (-242) y: (-50)\nset [xv v] to [0]\nset [yv v] to [0]\n\n@Level\n\nwhen flag clicked\nset [beginning of level ink v] to [100]\nswitch costume to (costume1 v)\ngo to [back v] layer\nshow\ngo to x: (36) y: (28)\n\nwhen I receive [next level v]\nerase all\nnext costume\nchange [level v] by (1)\nset [beginning of level ink v] to (Ink)\n\nwhen I receive [next level v]\nhide\nwait (0.2) seconds\nshow\n\n@Eraser\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\nwhen I receive [next level v]\nhide\nwait (0.2) seconds\nshow\n\n@Restart Button\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    if <not <(Stop?) = [Yes]>> then\n        go to x: (30) y: (-13)\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (30)\n            if <mouse down?> then\n                wait until <not <mouse down?>>\n                broadcast (restart v)\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwhen I receive [done v]\nhide\n\n@Draw Button\n\nwhen flag clicked\nset pen color to (#000000)\nset pen size to (10)\nswitch costume to (costume1 v)\nset [stop? v] to [No]\nset [pen mode? v] to [No]\nshow\ngo to x: (-182) y: (-184)\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    if <(Ink) > [0]> then\n        if <not <(costume [number v]) = [2]>> then\n            if <touching (mouse-pointer v)?> then\n                set [brightness v] effect to (30)\n                if <mouse down?> then\n                    switch costume to (costume2 v)\n                end\n            else\n                set [brightness v] effect to (0)\n            end\n        else\n            if <(Stop?) = [no]> then\n                if <touching (mouse-pointer v)?> then\n                    set [brightness v] effect to (30)\n                    if <mouse down?> then\n                        wait until <not <mouse down?>>\n                        switch costume to (costume1 v)\n                    end\n                else\n                    set [brightness v] effect to (0)\n                end\n            end\n        end\n    end\n    if <<mouse down?> and <(costume [number v]) = [2]>> then\n        set [stop? v] to [yes]\n        go to (mouse-pointer v)\n        pen down\n    else\n        pen up\n        go to x: (-182) y: (-184)\n        set [stop? v] to [no]\n    end\n    if <<(Ink) > [100]> or <(Ink) = [100]>> then\n        set [ink v] to [100]\n    else\n        set [ink v] to (Ink)\n    end\n    if <<(Ink) < [0]> or <(Ink) = [0]>> then\n        pen up\n        switch costume to (costume1 v)\n        set [ink v] to [0]\n        go to x: (-182) y: (-184)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<mouse down?> and <(costume [number v]) = [2]>> then\n        wait (0.5) seconds\n        change [ink v] by (-1)\n    else\n        change [ink v] by (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Ink) = [100]> then\n        if <<mouse down?> and <touching (mouse-pointer v)?>> then\n            wait (0.5) seconds\n            change [ink v] by (-1)\n        else\n            change [ink v] by (0)\n        end\n    end\nend\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\nhide\n\n@Erase Button\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nforever\n    go to x: (-380) y: (-15)\n    if <not <(Stop?) = [Yes]>> then\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (30)\n            if <mouse down?> then\n                set [stop? v] to [Yes]\n                wait until <not <mouse down?>>\n                erase all\n                set [stop? v] to [No]\n                set [ink v] to (round ((Ink) + (((Beginning of Level Ink) - (Ink)) / (4))))\n                set [beginning of level ink v] to (Ink)\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nset [ghost v] effect to (100)\n\nwhen I receive [done v]\nswitch costume to (costume2 v)\nshow\nrepeat (100)\n    change [ghost v] effect by (-1)\nend\n\n@Ink\n\nwhen flag clicked\nshow\nset [ink v] to [100]\nforever\n    switch costume to (letter (1) of (Ink))\n    if <(Ink) < [100]> then\n        hide\n    end\n    if <(Ink) = [100]> then\n        if <(NEXT LEVEL) = [No]> then\n            show\n        end\n    end\nend\n\nwhen I receive [next level v]\nif <(Ink) = [100]> then\n    set [next level v] to [Yes]\n    hide\n    wait (0.2) seconds\n    set [next level v] to [No]\n    show\nend\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\nhide\n\n@Ink2\n\nwhen flag clicked\nswitch costume to (0 v)\nshow\nforever\n    if <(NEXT LEVEL) = [No]> then\n        if <(Ink) = [100]> then\n            switch costume to (letter (2) of (Ink))\n            show\n        end\n        if <<(Ink) < [100]> and <(Ink) > [9]>> then\n            if <not <(Ink) = [0]>> then\n                show\n                switch costume to (letter (1) of (Ink))\n            end\n        end\n        if <(Ink) < [10]> then\n            if <not <(Ink) = [0]>> then\n                hide\n            end\n        end\n    end\n    if <(Ink) = [0]> then\n        repeat until <(Ink) > [0]>\n            hide\n        end\n    end\nend\n\nwhen I receive [next level v]\nset [next level v] to [Yes]\nif <(Ink) > [0]> then\n    hide\n    wait (0.2) seconds\n    set [next level v] to [No]\n    show\nend\n\nwhen flag clicked\nif <(Ink) = [0]> then\n    hide\n    stop [this script v]\nend\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\nhide\n\n@Ink3\n\nwhen flag clicked\nshow\nforever\n    if <(Ink) = [100]> then\n        switch costume to (letter (3) of (Ink))\n    end\n    if <<(Ink) < [100]> and <(Ink) > [9]>> then\n        switch costume to (letter (2) of (Ink))\n    end\n    if <<(Ink) < [10]> and <(Ink) > [0]>> then\n        switch costume to (letter (1) of (Ink))\n    end\n    if <(Ink) = [0]> then\n        switch costume to (0 v)\n    end\nend\n\nwhen I receive [next level v]\nhide\nwait (0.2) seconds\nshow\n\nwhen I receive [done v]\nstop [other scripts in sprite v]\nhide\n\n@Pen\n\nwhen flag clicked\nerase all\ngo to x: (195) y: (180)\nforever\n    if <(Level) = [22]> then\n        set pen size to (50)\n        set pen color to (#000000)\n        pen down\n        show\n        glide (2) secs to x: (195) y: (-109)\n        glide (0.2) secs to x: (225) y: (-109)\n        hide\n        stop [this script v]\n    else\n        pen up\n        set pen size to (20)\n        hide\n    end\nend\n\n@Ink bottle2\n\nwhen flag clicked\nforever\n    go to x: (-95) y: (25)\n    if <(Level) = [18]> then\n        show\n        if <touching (hitbox v)?> then\n            \n                hide\n                if <(Ink) < [90]> then\n                    change [ink v] by (10)\n                    stop [this script v]\n                end\n                if <(Ink) > [90]> then\n                    set [ink v] to [100]\n                    stop [this script v]\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\nset [level v] to [18]\n\n@Ink bottle3\n\nwhen flag clicked\nforever\n    go to x: (-50) y: (26)\n    if <(Level) = [18]> then\n        show\n        if <touching (hitbox v)?> then\n            \n                hide\n                if <(Ink) < [81]> then\n                    change [ink v] by (20)\n                    stop [this script v]\n                end\n                if <(Ink) > [80]> then\n                    set [ink v] to [100]\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Fake ink bottle\n\nwhen flag clicked\nforever\n    go to x: (150) y: (-35)\n    if <(Level) = [18]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            repeat until \n                hide\n            end\n        end\n    else\n        if <not <(Level) = [18]>> then\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to x: (150) y: (-35)\n    if <(Level) = [34]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n        end\n    else\n        if <not <(Level) = [18]>> then\n            hide\n        end\n    end\nend\n\n@Ink bottle4\n\nwhen flag clicked\nforever\n    go to x: (-50) y: (20)\n    if <(Level) = [25]> then\n        show\n        if <touching (hitbox v)?> then\n            \n                hide\n                if <(Ink) < [81]> then\n                    change [ink v] by (20)\n                    stop [this script v]\n                end\n                if <(Ink) > [80]> then\n                    set [ink v] to [100]\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Ink bottle5\n\nwhen flag clicked\nforever\n    go to x: (-95) y: (25)\n    if <(Level) = [29]> then\n        show\n        if <touching (hitbox v)?> then\n            \n                hide\n                if <(Ink) < [86]> then\n                    change [ink v] by (15)\n                    stop [this script v]\n                end\n                if <(Ink) > [85]> then\n                    set [ink v] to [100]\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Ink bottle\n\nwhen flag clicked\nforever\n    if <(Level) = [12]> then\n        show\n        if <touching (hitbox v)?> then\n            \n                hide\n                if <(Ink) < [90]> then\n                    change [ink v] by (10)\n                    stop [this script v]\n                end\n                if <(Ink) > [90]> then\n                    set [ink v] to [100]\n                end\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Fake ink bottle2\n\nwhen flag clicked\nforever\n    go to x: (150) y: (-30)\n    if <(Level) = [25]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Fake ink bottle3\n\nwhen flag clicked\nforever\n    go to x: (150) y: (215)\n    if <(Level) = [26]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Fake ink bottle4\n\nwhen flag clicked\nforever\n    go to x: (16) y: (240)\n    if <(Level) = [30]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Pen2\n\nwhen flag clicked\nerase all\ngo to x: (-95) y: (163)\nforever\n    if <(Level) = [32]> then\n        set pen size to (50)\n        set pen color to (#000000)\n        pen down\n        show\n        glide (2) secs to x: (152) y: (-111)\n        pen up\n        glide (2) secs to x: (152) y: (163)\n        pen down\n        glide (2) secs to x: (-95) y: (-111)\n        pen up\n        glide (0.5) secs to x: (225) y: (-111)\n        hide\n        stop [this script v]\n    else\n        pen up\n        set pen size to (20)\n        hide\n    end\nend\n\n@Fake ink bottle5\n\nwhen flag clicked\nforever\n    go to x: (200) y: (-20)\n    if <(Level) = [32]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Fake ink bottle6\n\nwhen flag clicked\ngo to x: (-55) y: (240)\nforever\n    if <(Level) = [33]> then\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n            stop [this script v]\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [35]> then\n        go to x: (130) y: (200)\n        show\n        if <touching (hitbox v)?> then\n            change [ink v] by (-20)\n            \n                hide\n            end\n        end\n    else\n        if <not <(Level) = [33]>> then\n            hide\n        end\n    end\nend\n\n