~ Eraser ~ A Platformer


@Stage\n\nwhen flag clicked\nforever\n    play sound [Alan Walker - Fade \[NCS Release\].mp2 v] until done\nend\n\n@Character\n\nwhen flag clicked\ngo to [front v] layer\nset [level v] to [1]\ngo to x: (-180) y: (80)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    Reset Mode\n    Controls Mode\n    Boost - Stapler\n    Boost - Pencil\nend\n\ndefine Controls Mode\nif <key (left arrow v) pressed?> then\n    change [xv v] by (-1)\nend\nif <key (right arrow v) pressed?> then\n    change [xv v] by (1)\nend\nset [xv v] to ((xv) * (0.85))\nchange x by (xv)\nif <touching (ground v)?> then\n    change y by (-2)\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 y by (-5)\n                            change x by ((-1) * (xv))\n                            if <<key (up arrow v) pressed?> and <not <(xv) = [0]>>> then\n                                set [mode v] to [walljump]\n                                set [yv v] to [8]\n                                set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                            else\n                                set [mode v] to [wallslide]\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\nend\nchange y by (-3)\nif <touching (ground v)?> then\n    if <(yv) = [-3]> then\n        if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n            set [mode v] to [run]\n        else\n            if <([abs v] of (xv) ) > [.1]> then\n                set [mode v] to [skid]\n            else\n                set [mode v] to [stand]\n            end\n        end\n    end\n    if <key (up arrow v) pressed?> then\n        set [mode v] to [jump]\n        set [yv v] to [9]\n    end\nend\nif <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n    set [mode v] to [fall]\nend\nchange y by (3)\nif <(yv) > [-15]> then\n    change [yv v] by (-0.5)\nend\nchange y by (-2)\nif <not <touching (ground v)?>> then\n    change y by (-1)\n    if <not <touching (ground v)?>> then\n        change y by (-1)\n        if <not <touching (ground v)?>> then\n            change y by (-1)\n            if <not <touching (ground v)?>> then\n                change y by (-1)\n                if <not <touching (ground v)?>> then\n                    change y by (-1)\n                    if <not <touching (ground v)?>> then\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (2)\nchange y by (yv)\nif <touching (ground v)?> then\n    change y by (-2)\n    if <touching (ground v)?> then\n        change y by ((-1) * (yv))\n        set [yv v] to [-3]\n    end\n    change y by (2)\nend\n\ndefine Reset Mode\nif <<(y position) < [-175]> or <touching (obstacle v)?>> then\n    go to x: (-180) y: (80)\n    set [xv v] to [0]\n    set [yv v] to [0]\nend\nif <(x position) > [247]> then\n    go to x: (-180) y: (80)\n    set [xv v] to [0]\n    set [yv v] to [0]\n    broadcast (Next lvl v)\n    change [level v] by (1)\nend\n\ndefine Boost - Stapler\nif <<touching (stapler v)?> or <touching (stapler_2 v)?>> then\n    set [yv v] to [12]\nend\n\ndefine Boost - Pencil\nif <<touching (pencil v)?> and <key (right arrow v) pressed?>> then\n    set [xv v] to ((xv) * (2.3))\nend\n\n@Ground\n\nwhen I receive [next lvl v]\nnext costume\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\ngo to [front v] layer\ngo [backward v] (1) layers\n\n@Obstacle\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\nwhen I receive [next lvl v]\nnext costume\n\n@Backgrounds\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\nwhen I receive [next lvl v]\nnext costume\n\n@Stapler\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [5]> then\n        show\n        go to x: (-183) y: (-42)\n    else\n        if <(level) = [8]> then\n            show\n            go to x: (-83) y: (-38)\n        else\n            hide\n        end\n    end\nend\n\n@Stapler_2\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [5]> then\n        show\n        go to x: (33) y: (-42)\n    else\n        if <(level) = [8]> then\n            show\n            go to x: (32) y: (-38)\n        else\n            if <(level) = [10]> then\n                show\n                go to x: (-93) y: (-35)\n            else\n                hide\n            end\n        end\n    end\nend\n\n@Stapler_3\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [8]> then\n        show\n        go to x: (149) y: (-38)\n    else\n        hide\n    end\nend\n\n@Pencil\n\nwhen flag clicked\nhide\nforever\n    if <(level) = [6]> then\n        show\n        go to x: (-98) y: (-44)\n    else\n        if <(level) = [9]> then\n            show\n            go to x: (17) y: (-47)\n        else\n            hide\n        end\n    end\nend\n\n@Doorway\n\nwhen flag clicked\nhide\ngo to [front v] layer\ngo [backward v] (2) layers\nforever\n    if <(level) = [10]> then\n        show\n        go to x: (0) y: (0)\n    else\n        hide\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\n    go to x: (0) y: (0)\nend\n\n