Platformer Maker V1.3
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    if <<key (space v) pressed?> and <(start/stop) = [0]>> then\n        next backdrop\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\n@player\n\ndefine platform (jump height) (friction) (running speed)\nset rotation style [left-right v]\nswitch costume to (hitbox v)\nif <<key (right arrow v) pressed?> or <(D-pad direction) = [Right]>> then\n    point in direction (90)\n    if <touching color (#098e00)?> then\n        change [x velocity v] by ((running speed) / (3))\n    else\n        change [x velocity v] by (running speed)\n    end\nend\nif <<key (left arrow v) pressed?> or <(D-pad direction) = [Left]>> then\n    point in direction (-90)\n    if <touching color (#098e00)?> then\n        change [x velocity v] by (((running speed) * (-1)) / (3))\n    else\n        change [x velocity v] by ((running speed) * (-1))\n    end\nend\nset [x velocity v] to ((x velocity) * (friction))\nchange x by (x velocity)\nif <<<<<<<touching (level v)?> or <touching (sprite2 v)?>> or <touching (sprite25 v)?>> or <touching (sprite27 v)?>> or <touching (sprite28 v)?>> or <touching (sprite31 v)?>> or <touching (sprite33 v)?>> then\n    set [slope v] to [0]\n    repeat until <<(slope) = [8]> or <not <<<<<<<touching (level v)?> or <touching (sprite2 v)?>> or <touching (sprite25 v)?>> or <touching (sprite27 v)?>> or <touching (sprite28 v)?>> or <touching (sprite31 v)?>> or <touching (sprite33 v)?>>>>\n        change [slope v] by (1)\n        change y by (1)\n    end\n    if <<<<<<<touching (level v)?> or <touching (sprite2 v)?>> or <touching (sprite25 v)?>> or <touching (sprite27 v)?>> or <touching (sprite28 v)?>> or <touching (sprite31 v)?>> or <touching (sprite33 v)?>> then\n        change y by ((slope) * (-1))\n        repeat ([ceiling v] of ([abs v] of (x velocity) ) )\n            if <<<<<<<touching (level v)?> or <touching (sprite2 v)?>> or <touching (sprite25 v)?>> or <touching (sprite27 v)?>> or <touching (sprite28 v)?>> or <touching (sprite31 v)?>> or <touching (sprite33 v)?>> then\n                change x by ((([abs v] of (x velocity) ) / (x velocity)) * (-1))\n            end\n        end\n        set [x velocity v] to [0]\n    end\nend\nchange y by ((y velocity) * (gravity))\nif <<<<<<<touching (level v)?> or <touching (sprite2 v)?>> or <touching (sprite25 v)?>> or <touching (sprite27 v)?>> or <touching (sprite28 v)?>> or <touching (sprite31 v)?>> or <touching (sprite33 v)?>> then\n    repeat ([ceiling v] of ([abs v] of (y velocity) ) )\n        if <<<<<<<touching (level v)?> or <touching (sprite2 v)?>> or <touching (sprite25 v)?>> or <touching (sprite27 v)?>> or <touching (sprite28 v)?>> or <touching (sprite31 v)?>> or <touching (sprite33 v)?>> then\n            change y by (((([abs v] of (y velocity) ) / (y velocity)) * (-1)) * (gravity))\n        end\n    end\n    if <<(([abs v] of (y velocity) ) / (y velocity)) = [-1]> and <<key (up arrow v) pressed?> or <(D-pad direction) = [Up]>>> then\n        if <touching color (#098e00)?> then\n            set [y velocity v] to (((jump height) / (2)) + (3))\n        else\n            set [y velocity v] to (jump height)\n        end\n    else\n        set [y velocity v] to [0]\n    end\nelse\n    change [y velocity v] by (-1)\nend\nswitch costume to (idle v)\nif <<<key (right arrow v) pressed?> or <(D-pad direction) = [Right]>> or <<key (left arrow v) pressed?> or <(D-pad direction) = [Left]>>> then\n    switch costume to (walk)\nend\nif <(y velocity) > [2]> then\n    switch costume to (jump v)\nend\nif <(y velocity) < [-4]> then\n    switch costume to (fall v)\nend\nif <touching color (#ff00a8)?> then\n    set [y velocity v] to [15]\nend\nif <<<(y position) < [-180]> or <touching color (#ff0000)?>> and <(gravity) = [1]>> then\n    go to x: (-210) y: (-40)\n    start sound [Lose v]\n    broadcast (stop v)\nend\nif <<<(y position) > [180]> or <touching color (#ff0000)?>> and <(gravity) = [-1]>> then\n    go to x: (-210) y: (-40)\n    start sound [Lose v]\n    broadcast (stop v)\nend\nif <touching (sprite13 v)?> then\n    play sound [Win v] until done\n    broadcast (stop v)\nend\n\nwhen I receive [start v]\nset [y velocity v] to [0]\nset [x velocity v] to [0]\ngo to x: (-210) y: (-40)\nforever\n    platform [11.5] [0.7] [3]\nend\n\nwhen I receive [start v]\nset [walk v] to [5]\nforever\n    change [walk v] by (1)\n    if <(walk) > [8]> then\n        set [walk v] to [5]\n    end\n    wait (0.01) seconds\nend\n\nwhen I receive [stop v]\nstop [other scripts in sprite v]\n\n@level\n\nwhen flag clicked\nforever\n    go to x: (-23) y: (-20)\nend\n\n@Sprite1\n\nwhen flag clicked\nset [start/stop v] to [0]\nbroadcast (stop v)\n\nwhen I receive [stop v]\ngo to x: (198) y: (-146)\nset [start/stop v] to [0]\nrepeat until <(start/stop) = [1]>\n    switch costume to (costume1 v)\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            if <(flag placed?) = [1]> then\n                broadcast (start v)\n            else\n                broadcast (place flag v)\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\ngo to x: (198) y: (-146)\nset [start/stop v] to [1]\nrepeat until <(start/stop) = [0]>\n    switch costume to (costume2 v)\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            if <(flag placed?) = [1]> then\n                broadcast (stop v)\n            else\n                broadcast (place flag v)\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [black]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <not <touching (sprite23 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@1316503\n\nwhen I receive [stop v]\nrepeat until <(start/stop) = [1]>\n    go to [back v] layer\n    set [ghost v] effect to (30)\nend\n\nwhen I receive [start v]\nrepeat until <(start/stop) = [0]>\n    go to [back v] layer\n    set [ghost v] effect to (100)\nend\n\n@Sprite3\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (30)\nend\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (30)\nend\n\nwhen flag clicked\nbroadcast (open v)\n\nwhen I receive [open v]\nset [open v] to [1]\ngo to x: (0) y: (-18)\n\nwhen I receive [close v]\nset [open v] to [0]\ngo to x: (0) y: (5)\n\nwhen I receive [start v]\nhide\n\nwhen I receive [stop v]\nshow\n\n@Sprite4\n\nwhen I receive [open v]\nforever\n    point in direction (-90)\n    go to x: (-6) y: (147)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            broadcast (close v)\n            stop [this script v]\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [close v]\nforever\n    point in direction (90)\n    go to x: (-6) y: (170)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (20)\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            broadcast (open v)\n            stop [this script v]\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\nhide\n\nwhen I receive [stop v]\nshow\n\n@Sprite5\n\nwhen flag clicked\nforever\n    go to x: (-212) y: (151)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n        set [thing open v] to [0]\n    else\n        show\n    end\n    if <touching (mouse-pointer v)?> then\n        set [toutching black v] to [1]\n        set [thing open v] to [1]\n        if <(texture) = [1]> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume4 v)\n        end\n        if <mouse down?> then\n            set [block selected v] to [black]\n        end\n    else\n        if <(toutching halv) = [0]> then\n            set [toutching black v] to [0]\n        else\n            set [toutching black v] to [1]\n        end\n        if <(texture) = [1]> then\n            switch costume to (costume1 v)\n        else\n            switch costume to (costume3 v)\n        end\n    end\nend\n\n@Sprite6\n\nwhen flag clicked\nforever\n    go to x: (-160) y: (151)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            set [toutching pink v] to [1]\n            if <(texture) = [1]> then\n                switch costume to (costume2 v)\n            else\n                switch costume to (costume4 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [pink]\n            end\n        else\n            if <(toutching blue) = [0]> then\n                set [toutching pink v] to [0]\n            else\n                set [toutching pink v] to [1]\n            end\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    end\nend\n\n@Sprite7\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [pink]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite8\n\nwhen flag clicked\nforever\n    go to x: (-114) y: (151)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume2 v)\n            else\n                switch costume to (costume4 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [red]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    end\nend\n\n@Sprite9\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [red]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite10\n\nwhen flag clicked\nforever\n    go to x: (-68) y: (151)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume2 v)\n            else\n                switch costume to (costume4 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [green]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    end\nend\n\n@Sprite11\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [green]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite12\n\nwhen flag clicked\nforever\n    go to x: (52) y: (158)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            switch costume to (2 v)\n            if <mouse down?> then\n                set [block selected v] to [flag]\n            end\n        else\n            switch costume to (1 v)\n        end\n    end\nend\n\n@Sprite13\n\nwhen flag clicked\nset [flag placed? v] to [0]\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    if <(block selected) = [flag]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <(flag placed?) = [0]>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n            set [flag placed? v] to [1]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        set [flag placed? v] to [0]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\nset [flag placed? v] to [0]\ndelete this clone\n\n@Sprite14\n\nwhen flag clicked\nset [error v] to [0]\nset [ghost v] effect to (100)\n\nwhen I receive [place flag v]\nset [error v] to [1]\nrepeat (10)\n    change [ghost v] effect by (-10)\n    go to [front v] layer\nend\n\nwhen I receive [stop v]\nset [error v] to [0]\nrepeat (10)\n    change [ghost v] effect by (10)\n    go to [front v] layer\nend\n\n@Sprite15\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (118) y: (59)\n\nwhen I receive [place flag v]\nrepeat (10)\n    change [ghost v] effect by (-10)\n    go to [front v] layer\nend\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (20)\n        if <mouse down?> then\n            broadcast (stop v)\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [stop v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\n    go to [front v] layer\nend\n\n@Sprite16\n\nwhen flag clicked\nforever\n    go to x: (92) y: (151)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            switch costume to (coin2-2 v)\n            if <mouse down?> then\n                set [block selected v] to [coin]\n            end\n        else\n            switch costume to (coin2-6 v)\n        end\n    end\nend\n\n@Sprite17\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    if <(block selected) = [coin]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    if <(start/stop) = [0]> then\n        if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n            delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n            delete this clone\n        end\n    else\n        if <touching (player v)?> then\n            start sound [Coin v]\n            hide\n            change [coins v] by (1)\n            wait until <(start/stop) = [0]>\n            show\n        end\n    end\nend\n\nwhen I receive [start v]\nset [coins v] to [0]\nshow variable [coins v]\n\nwhen I receive [stop v]\nhide variable [coins v]\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite18\n\nwhen flag clicked\nforever\n    go to x: (135) y: (151)\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            switch costume to (costume3 v)\n            if <mouse down?> then\n                set [block selected v] to [gravity]\n            end\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\n\n@Sprite19\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    if <(block selected) = [gravity]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    if <(start/stop) = [0]> then\n        if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n            delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n            delete this clone\n        end\n    else\n        if <touching (player v)?> then\n            if <(gravity) = [1]> then\n                set [gravity v] to [-1]\n            else\n                set [gravity v] to [1]\n            end\n            start sound [Connect v]\n            set [y velocity v] to [0]\n            wait until <not <touching (player v)?>>\n        end\n        if <touching (player2 v)?> then\n            if <(gravity2) = [1]> then\n                set [gravity2 v] to [-1]\n            else\n                set [gravity2 v] to [1]\n            end\n            start sound [Connect v]\n            set [yvel2 v] to [0]\n            wait until <not <touching (player2 v)?>>\n        end\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\nwhen I receive [start v]\nset [gravity v] to [1]\n\n@Sprite20\n\nwhen flag clicked\nset [texture v] to [1]\ngo to x: (198) y: (159)\nforever\n    if <<(open) = [0]> or <(start/stop) = [1]>> then\n        hide\n    else\n        show\n        if <touching (mouse-pointer v)?> then\n            set [brightness v] effect to (-10)\n            if <mouse down?> then\n                if <(texture) = [1]> then\n                    set [texture v] to [2]\n                else\n                    set [texture v] to [1]\n                end\n                wait until <not <mouse down?>>\n            end\n        else\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\n@Sprite21\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n@Sprite22\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    go [forward v] (99) layers\nend\n\n@Sprite23\n\nwhen flag clicked\nforever\n    go to x: (-212) y: (132)\n    set [ghost v] effect to (30)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(toutching black) = [1]>> then\n        set [hidden v] to [0]\n        show\n    else\n        set [hidden v] to [1]\n        hide\n    end\n    if <<touching (mouse-pointer v)?> and <(hidden) = [0]>> then\n        set [toutching halv v] to [1]\n    else\n        set [toutching halv v] to [0]\n    end\nend\n\n@Sprite25\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [halve black]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: ((((round ((mouse y) / (10.5))) * (10.5)) + (2)) - ())\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <not <touching (sprite23 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite26\n\nwhen flag clicked\nforever\n    go to x: (-175) y: (125)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(toutching black) = [1]>> then\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume5 v)\n            else\n                switch costume to (costume3 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [gentle slope]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume2 v)\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Sprite27\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [gentle slope]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: ((((round ((mouse y) / (10.5))) * (10.5)) + (2)) - ())\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <not <touching (sprite23 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite28\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [gentle slope right]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: ((((round ((mouse y) / (10.5))) * (10.5)) + (2)) - ())\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <not <touching (sprite23 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite29\n\nwhen flag clicked\nforever\n    go to x: (-135) y: (125)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(toutching black) = [1]>> then\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume5 v)\n            else\n                switch costume to (costume3 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [gentle slope right]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume2 v)\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Sprite30\n\nwhen flag clicked\nforever\n    go to x: (-100) y: (115)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(toutching black) = [1]>> then\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume2 v)\n            else\n                switch costume to (costume4 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [steep slope]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Sprite31\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [steep slope]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <not <touching (sprite23 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@Sprite32\n\nwhen flag clicked\nforever\n    go to x: (-55) y: (115)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(toutching black) = [1]>> then\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume2 v)\n            else\n                switch costume to (costume4 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [steep slope right]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    else\n        hide\n    end\nend\n\n@Sprite33\n\nwhen flag clicked\nset [block selected v] to [NaN]\ndelete all of [position v]\nforever\n    switch costume to (texture)\n    if <(block selected) = [steep slope right]> then\n        set [ghost v] effect to (0)\n        go to x: (((round ((mouse x) / (21))) * (21)) + (2)) y: (((round ((mouse y) / (21))) * (21)) + (2))\n        if <<<<<mouse down?> and <not <[position v] contains (join (join (x position) [,]) (y position))?>>> and <(showed?) = [1]>> and <not <touching (sprite3 v)?>>> and <not <touching (sprite23 v)?>>> then\n            create clone of (_myself_ v)\n            add (join (join (x position) [,]) (y position)) to [position v]\n        end\n        if <(start/stop) = [0]> then\n            if <key (e v) pressed?> then\n                hide\n                set [showed? v] to [0]\n            else\n                show\n                set [showed? v] to [1]\n            end\n        else\n            hide\n            set [showed? v] to [0]\n        end\n    else\n        set [ghost v] effect to (100)\n    end\nend\n\nwhen I start as a clone\nif <(showed?) = [0]> then\n    delete this clone\nend\nforever\n    switch costume to (texture)\n    if <<<<key (e v) pressed?> or <(erase mode) = [1]>> and <<touching (mouse-pointer v)?> and <mouse down?>>> or <key (c v) pressed?>> then\n        delete (item # of (join (join (x position) [,]) (y position)) in [position v]) of [position v]\n        delete this clone\n    end\nend\n\nwhen I receive [clear v]\ndelete this clone\n\n@D-Pad\n\nwhen flag clicked\nhide\ngo to x: (-35) y: (-35)\ngo to [front v] layer\nset [ghost v] effect to (20)\nset [controller shown v] to [yes]\nset [controler v] to [D-Pad]\nbroadcast (Turn on D-Pad v)\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    change y by (39)\nend\nrepeat until <(Controller shown) = [No]>\n    go to [front v] layer\n    if <(start/stop) = [0]> then\n        set [arrow pressed? v] to [0]\n        hide\n    else\n        if <<<<key (left arrow v) pressed?> or <key (up arrow v) pressed?>> or <key (right arrow v) pressed?>> or <(arrow pressed?) = [1]>> then\n            hide\n            set [arrow pressed? v] to [1]\n        else\n            show\n            set [arrow pressed? v] to [0]\n        end\n    end\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (0)\n        if <mouse down?> then\n            if <<touching (mouse-pointer v)?> and <(costume [name v]) = [Up]>> then\n                set [d-pad direction v] to [Up]\n                wait until <not <mouse down?>>\n                set [d-pad direction v] to [none]\n            end\n            if <<touching (mouse-pointer v)?> and <(costume [name v]) = [Down]>> then\n                set [d-pad direction v] to [Down]\n                wait until <not <mouse down?>>\n                set [d-pad direction v] to [none]\n            end\n            if <<touching (mouse-pointer v)?> and <(costume [name v]) = [Left]>> then\n                set [d-pad direction v] to [Left]\n                wait until <not <mouse down?>>\n                set [d-pad direction v] to [none]\n            end\n            if <<touching (mouse-pointer v)?> and <(costume [name v]) = [Right]>> then\n                set [d-pad direction v] to [Right]\n                wait until <not <mouse down?>>\n                set [d-pad direction v] to [none]\n            end\n            if <<touching (mouse-pointer v)?> and <(costume [name v]) = [Action1]>> then\n                set [d-pad direction v] to [Action1]\n                wait until <not <mouse down?>>\n                set [d-pad direction v] to [none]\n            end\n            set [ghost v] effect to (0)\n        end\n    else\n        set [ghost v] effect to (20)\n    end\nend\n\nwhen I start as a clone\nwait until <(Controller shown) = [No]>\ndelete this clone\n\nwhen I receive [turn on d-pad v]\ngo to x: (-35) y: (-35)\ngo to [front v] layer\nset [ghost v] effect to (20)\nset [controler v] to [D-Pad]\nset [controller shown v] to [yes]\nif <(Controler) = [D-Pad]> then\n    switch costume to (up v)\n    set size to (100) %\n    show\n    go to x: (-170) y: (-160)\n    go to [front v] layer\n    set [ghost v] effect to (20)\n    create clone of (_myself_ v)\n    repeat (3)\n        next costume\n        create clone of (_myself_ v)\n    end\nend\nhide\n\nwhen I receive [turn off d-pad v]\nset [controller shown v] to [no]\n\nwhen I receive [turn on d-pad v]\n\nbroadcast (Turn on D-Pad v)\n\n@Sprite34\n\nwhen flag clicked\nset [erase mode v] to [0]\nforever\n    if <(start/stop) = [0]> then\n        show\n    else\n        hide\n    end\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (-20)\n        if <mouse down?> then\n            if <(erase mode) = [0]> then\n                broadcast (erase mode v)\n                set [erase mode v] to [1]\n                set [block selected v] to [N/A]\n                wait until <not <mouse down?>>\n            else\n                broadcast (stop erase mode v)\n                set [erase mode v] to [0]\n                wait until <not <mouse down?>>\n            end\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\n@Sprite35\n\nwhen flag clicked\nhide\ngo to [front v] layer\n\nwhen I receive [erase mode v]\nshow\ngo to [front v] layer\n\nwhen I receive [stop erase mode v]\nhide\ngo to [front v] layer\n\n@Sprite36\n\nwhen flag clicked\nforever\n    go to x: (-160) y: (132)\n    set [ghost v] effect to (30)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(Toutching pink) = [1]>> then\n        set [hidden pink v] to [0]\n        show\n    else\n        set [hidden pink v] to [1]\n        hide\n    end\n    if <<touching (mouse-pointer v)?> and <(hidden pink) = [0]>> then\n        set [toutching pink v] to [1]\n    else\n        set [toutching pink v] to [0]\n    end\nend\n\n@Sprite38\n\nwhen flag clicked\nforever\n    go to x: (-212) y: (125)\n    if <<<(open) = [1]> or <(start/stop) = [0]>> and <(toutching black) = [1]>> then\n        show\n        if <touching (mouse-pointer v)?> then\n            if <(texture) = [1]> then\n                switch costume to (costume2 v)\n            else\n                switch costume to (costume4 v)\n            end\n            if <mouse down?> then\n                set [block selected v] to [halve black]\n            end\n        else\n            if <(texture) = [1]> then\n                switch costume to (costume1 v)\n            else\n                switch costume to (costume3 v)\n            end\n        end\n    else\n        hide\n    end\nend\n\n
Welcome to platformer maker! In platformer maker, you can make your own platformer without the trouble of writing code!\n=============================================\nInstructions: At the bar at the top click on the item you want to place and then click somewhere else to place it.\nPress space to change the background.\n\nBlack = Ground\nPink = Bouncey\nRed = Lava\nGreen = Slow Down\nFlag = Goal\nCoin = Coin\nTwo arrows and circle = gravity switcher\n\nHover over the black to get the drop-down menu with the halve block and slopes. Click on a placed block while pressing e to erase.\n\nOnce you finish making your level you can press start to play it.\nYou can also press the "Change texture" button to change the look of the blocks.\n