Scrolling Platformer Creator [beta]
@Stage\n\nwhen I receive [load v]\nhide list [save v]\ndelete all of [save v]\nadd (Code) to [save v]\nadd [Triple Click the code to copy all] to [save v]\nadd [https://scratch.mit.edu/discuss/topic/407624/] to [save v]\nadd [Post your code there!] to [save v]\nadd [] to [save v]\nadd [To leave this page, type anything to the answer.] to [save v]\nask [Type anything here to leave] and wait\nbroadcast (BACK v)\n\nwhen I receive [back v]\nshow list [save v]\n\nwhen flag clicked\nforever\n    play sound [TheFatRat - Unity \(Instrumental\) v] until done\nend\n\n@Sprite1\n\n@Clone Base\n\nwhen flag clicked\nQuick setup\n\nwhen I start as a clone\nshow\nforever\n    if <touching (mouse-pointer v)?> then\n        if <(Status) = [Editor]> then\n            set [ghost v] effect to (30)\n        end\n        if <mouse down?> then\n            change y by (2)\n            if <not <touching (bottommenu v)?>> then\n                if <(Status) = [Editor]> then\n                    switch costume to (@Menu)\n                    if <(costume [number v]) = [4]> then\n                        set [4? v] to [1]\n                        set [@menu v] to [6]\n                    end\n                    if <(costume [number v]) = [5]> then\n                        set [5? v] to [1]\n                        set [@menu v] to [6]\n                    end\n                end\n            end\n            change y by (-2)\n            wait until <not <mouse down?>>\n        end\n        if <key (i v) pressed?> then\n            think (costume [name v])\n        end\n    else\n        clear graphic effects\n        think []\n    end\n    replace item (Clone Number) of [position v] with (costume [number v])\n    if <(item # of [4] in [position v]) = [0]> then\n        set [4? v] to [0]\n    else\n        set [4? v] to [1]\n    end\n    if <(item # of [5] in [position v]) = [0]> then\n        set [5? v] to [0]\n    else\n        set [5? v] to [1]\n    end\n    if <(costume [number v]) = [4]> then\n        set [player pos v] to (join ((x position) + (2000)) ((y position) + (2000)))\n    end\nend\n\ndefine Quick setup\nset [clone number v] to [0]\ndelete all of [position v]\nrepeat (176)\n    add [] to [position v]\nend\nhide\nswitch costume to (sky v)\ngo to x: (-225) y: (165)\nrepeat (11)\n    change [clone number v] by (1)\n    create clone of (_myself_ v)\n    repeat (15)\n        change [clone number v] by (1)\n        change x by (30)\n        create clone of (_myself_ v)\n    end\n    change y by (-30)\n    set x to (-225)\nend\n\nwhen flag clicked\ndelete this clone\n\nwhen flag clicked\nforever\n    Code count\nend\n\ndefine Code count\nset [count number v] to [0]\nset [code v] to []\nrepeat (176)\n    change [count number v] by (1)\n    set [code v] to (join (Code) (item (Count Number) of [position v]))\nend\n\nset [player pos v] to [0]\n\nwhen I receive [play v]\nif <(costume [number v]) = [4]> then\n    hide\nend\n\nwhen I receive [back v]\nif <(costume [number v]) = [4]> then\n    show\nend\n\nwhen I receive [read code v]\nask [Paste your code below] and wait\nif <not <(length of (answer)) = [176]>> then\n    broadcast (BACK v)\nend\nrepeat (2)\n    broadcast (Delete all clones v)\n    Quick load (answer)\nend\n\nwhen I receive [delete all clones v]\ndelete this clone\n\ndefine Quick load (answer)\nset [clone number v] to [0]\ndelete all of [position v]\nrepeat (176)\n    add [] to [position v]\nend\nhide\nswitch costume to (sky v)\ngo to x: (-225) y: (165)\nrepeat (11)\n    change [clone number v] by (1)\n    switch costume to (letter (Clone Number) of (answer))\n    create clone of (_myself_ v)\n    repeat (15)\n        change [clone number v] by (1)\n        switch costume to (letter (Clone Number) of (answer))\n        change x by (30)\n        create clone of (_myself_ v)\n    end\n    change y by (-30)\n    set x to (-225)\nend\n\n@BottomMenu\n\nwhen flag clicked\nswitch costume to (costume2 v)\nshow\nforever\n    clear graphic effects\nend\n\nif <(costume [number v]) = [1]> then\n    clear graphic effects\nend\n\nwait until <not <<mouse down?> and <touching (mouse-pointer v)?>>>\n\nwhen this sprite clicked\nnext costume\n\nwhen I receive [play v]\nswitch costume to (costume2 v)\nhide\n\nwhen I receive [back v]\nswitch costume to (costume2 v)\nshow\n\n@Menu Tiles\n\nwhen flag clicked\nhide\ngo to x: (-220) y: (-160)\nswitch costume to (ground v)\nSetup Clones\n\ndefine Setup Clones\nset [4? v] to [0]\nset [5? v] to [0]\nrepeat (3)\n    create clone of (_myself_ v)\n    change x by (35)\n    next costume\nend\nchange x by (10)\nrepeat (3)\n    create clone of (_myself_ v)\n    change x by (35)\n    next costume\nend\nchange x by (10)\nrepeat (2)\n    create clone of (_myself_ v)\n    change x by (35)\n    next costume\nend\nchange x by (10)\nrepeat (3)\n    change x by (35)\nend\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\nshow\nforever\n    if <([costume # v] of [bottommenu v]) = [1]> then\n        if <<not <(costume [number v]) = [4]>> and <not <(costume [number v]) = [5]>>> then\n            show\n        end\n    else\n        hide\n    end\n    if <touching (mouse-pointer v)?> then\n        if <(Status) = [Editor]> then\n            set size to (120) %\n            set [brightness v] effect to (10)\n            think (costume [name v])\n            if <mouse down?> then\n                set [@menu v] to (costume [number v])\n            end\n        end\n    else\n        set size to (100) %\n        clear graphic effects\n        think []\n    end\n    if <(costume [number v]) = [4]> then\n        if <(4?) = [0]> then\n            if <([costume # v] of [bottommenu v]) = [1]> then\n                show\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\n    if <(costume [number v]) = [5]> then\n        if <(5?) = [0]> then\n            if <([costume # v] of [bottommenu v]) = [1]> then\n                if <(Status) = [Editor]> then\n                    show\n                end\n            else\n                hide\n            end\n        else\n            hide\n        end\n    end\nend\n\nset [4? v] to [0]\n\nset [5? v] to [0]\n\nwhen I receive [back v]\nif <(costume [number v]) = [4]> then\n    show\nend\n\nwhen I receive [play v]\nif <(costume [number v]) = [4]> then\n    hide\nend\n\n@Menu Options\n\nwhen flag clicked\nhide\ngo to x: (90) y: (-160)\nswitch costume to (save v)\nSetup Clones\n\ndefine Setup Clones\nrepeat (3)\n    create clone of (_myself_ v)\n    change x by (35)\n    next costume\nend\n\nwhen I start as a clone\ngo to [front v] layer\nclear graphic effects\nshow\nforever\n    if <([costume # v] of [bottommenu v]) = [1]> then\n        show\n    else\n        hide\n    end\n    if <touching (mouse-pointer v)?> then\n        set size to (120) %\n        set [brightness v] effect to (10)\n        think (costume [name v])\n    else\n        set size to (100) %\n        clear graphic effects\n        think []\n    end\nend\n\nwhen this sprite clicked\nif <(costume [number v]) = [3]> then\n    broadcast (Play v)\nend\nif <(costume [number v]) = [1]> then\n    broadcast (Load v)\nend\nif <(costume [number v]) = [2]> then\n    broadcast (READ CODE v)\nend\n\nwhen I receive [play v]\nhide\n\nrepeat (176)\n    set [count number v] to [0]\n    show\n    change [count number v] by (1)\n    if <(letter (Count Number) of (Code)) = (item (Count Number) of [position v])> then\n        say [111]\n    else\n        say [No]\n        stop [this script v]\n    end\nend\n\n@Player\n\nwhen flag clicked\nbroadcast (Restart v)\nswitch costume to (costume1 v)\nset [x v] to [0]\nset [y v] to [0]\nforever\n    go to [front v] layer\n    change [y v] by (-1)\n    if <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1)\n        point in direction (-90)\n    end\n    if <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n        change [x v] by (1)\n        point in direction (90)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>> then\n        change y by (1)\n    end\n    if <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>> then\n        change y by (1)\n    end\n    if <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>> then\n        change y by (1)\n    end\n    if <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>> then\n        change y by (1)\n    end\n    if <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [15]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> and <<touching color (#2eff35)?> or <<touching color (#27d82d)?> or <<touching color (#1fad24)?> or <<touching color (#f4af48)?> or <touching color (#cc8925)?>>>>>> then\n        set [y v] to [15]\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nbroadcast (BACK v)\nhide\nforever\n    if <<touching color (#ffcc00)?> or <touching color (#eaae00)?>> then\n        set [y v] to [17]\n    end\n    if <<touching color (#5ba153)?> or <touching color (#17d800)?>> then\n        if <(Status) = [Play]> then\n            broadcast (Next level v)\n        end\n    end\n    if <touching color (#ff00b4)?> then\n        set [x v] to [15]\n    end\n    if <touching color (#b100ff)?> then\n        set [x v] to [-15]\n    end\n    if <<<touching color (#dc0000)?> or <touching color (#ff0000)?>> or <<(y position) < [-170]> and <touching (_edge_ v)?>>> then\n        broadcast (Restart v)\n    end\nend\n\nwhen [r v] key pressed\nbroadcast (Restart v)\n\nwhen I receive [next level v]\nbroadcast (Restart v)\n\nwhen I receive [restart v]\ngo to x: ((join (letter (1) of (Player Pos)) (join (letter (2) of (Player Pos)) (join (letter (3) of (Player Pos)) (letter (4) of (Player Pos))))) - (2000)) y: ((join (letter (5) of (Player Pos)) (join (letter (6) of (Player Pos)) (join (letter (7) of (Player Pos)) (letter (8) of (Player Pos))))) - (2000))\npoint in direction (90)\nset [y v] to [0]\nset [x v] to [0]\n\nwhen I receive [play v]\nshow\nbroadcast (Restart v)\nset [status v] to [Play]\n\nbroadcast (Next level v)\n\nwhen I receive [back v]\nset [status v] to [Editor]\n\nwhen I receive [next level v]\nrepeat until <(Status) = [Editor]>\n    hide\nend\n\n@           \n\nwhen I receive [next level v]\nshow\ngo to x: (0) y: (500)\nset [ghost v] effect to (20)\ngo to [front v] layer\nrepeat until <(round (y position)) = [0]>\n    change y by (((0) - (y position)) / (10))\n    clear graphic effects\nend\nwait until <<mouse down?> and <touching (mouse-pointer v)?>>\nbroadcast (BACK v)\n\nwhen flag clicked\nhide\n\nwhen I receive [back v]\nrepeat until <(round (y position)) = [260]>\n    change y by (((260) - (y position)) / (10))\n    change [ghost v] effect by (7)\nend\nhide\n\nglide (1) secs to x: (0) y: (0)\n\n@Sprite2\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    go to [front v] layer\nend\n\n