Platformer Creator

Instructions: <---- Click for help ;-;\nBuild your own Platformer!\n\nIn this game, blocks that you place snap to a grid allowing you to create your own platformer.\n\n1. Click on the 'i' for help at the top right-hand corner.\n2. Use the numbers 1 - 9 to select different blocks to place.\n3. Use the arrow keys <- and -> to rotate the ramps.\n4. You can press z to undo your last block placement!\n5. In the game, pressing R will respawn your character.\n\nAlso, the player spawns near the bottom left-hand corner\n\nYour objective is to reach the coin then you WIN THE GAME!!! (Don't fall off or touch the red!)\n\n 

@Stage\n\n@Blocks\n\nwhen flag clicked\nforever\n    if <key (1 v) pressed?> then\n        set [costume v] to [1]\n    end\n    if <key (2 v) pressed?> then\n        set [costume v] to [2]\n    end\n    if <key (3 v) pressed?> then\n        set [costume v] to [3]\n    end\n    if <key (4 v) pressed?> then\n        set [costume v] to [4]\n    end\n    if <key (5 v) pressed?> then\n        set [costume v] to [5]\n    end\n    if <key (6 v) pressed?> then\n        set [costume v] to [6]\n    end\n    if <key (7 v) pressed?> then\n        set [costume v] to [7]\n    end\n    if <key (8 v) pressed?> then\n        set [costume v] to [8]\n    end\n    if <key (9 v) pressed?> then\n        set [costume v] to [9]\n    end\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nerase all\nforever\n    if <(mouse y) > [-100]> then\n        go to (mouse-pointer v)\n        Snap To Grid\n    end\nend\n\ndefine Snap To Grid\nset x to ((round ((x position) / (18))) * (18))\nset y to ((round ((y position) / (18))) * (18))\n\nwhen flag clicked\ndelete all of [recent v]\npoint in direction (90)\nset size to (600) %\nwait (0.5) seconds\nforever\n    if <<<<<mouse down?> and <(y position) > [-100]>> and <(Mode) = [Build]>> and <not <touching (info v)?>>> and <not <<(x position) = [-180]> and <(y position) = [-72]>>>> then\n        if <not <touching (info v)?>> then\n            show\n            create clone of (_myself_ v)\n            insert (x position) at (1) of [recent v] \n            insert (y position) at (1) of [recent v] \n            wait (0.2) seconds\n        end\n    end\n    if <(Costume) < [9]> then\n        if <key (left arrow v) pressed?> then\n            point in direction (90)\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (-90)\n        end\n    end\nend\n\nadd [thing] to [recent v]\nadd [thing] to [recent v]\n\nwhen flag clicked\nset [costume v] to [1]\nforever\n    switch costume to (Costume)\nend\n\nwhen I start as a clone\nSnap To Grid\n\nwhen I start as a clone\nif <(Costume) = [6]> then\n    forever\n        wait (0.5) seconds\n        turn right (90) degrees\n    end\nend\n\nwhen I start as a clone\nif <(Costume) = [7]> then\n    forever\n        if <touching (player v)?> then\n            switch costume to (10 v)\n            wait (0.1) seconds\n            switch costume to (7 v)\n        end\n    end\nend\n\nchange y by (3)\nwait (0.1) seconds\n\nchange y by (-3)\n\nwhen I start as a clone\nif <(Costume) = [9]> then\n    forever\n        point in direction (90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Costume) = [9]> then\n        point in direction (90)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Mode) = [Build]> then\n        show\n    end\n    if <(Mode) = [Play]> then\n        hide\n    end\nend\n\nset y to (144)\n\ngo [forward v] (1) layers\ngo to [front v] layer\n\nwhen I start as a clone\nforever\n    if <touching (delete v)?> then\n        delete this clone\n    end\nend\n\ngo to [front v] layer\n\nstamp\n\n\n\ngo to [front v] layer\n\n@Player\n\nwhen flag clicked\nforever\n    if <key (1 v) pressed?> then\n        broadcast (grass v)\n        set [costume v] to [1]\n    end\n    if <key (2 v) pressed?> then\n        broadcast (dirt v)\n        set [costume v] to [2]\n    end\n    if <key (3 v) pressed?> then\n        broadcast (stone v)\n        set [costume v] to [3]\n    end\n    if <key (4 v) pressed?> then\n        broadcast (brigde v)\n        set [costume v] to [4]\n    end\n    if <key (5 v) pressed?> then\n        broadcast (lava v)\n        set [costume v] to [5]\n    end\n    if <key (6 v) pressed?> then\n        broadcast (water v)\n        set [costume v] to [6]\n    end\n    if <key (7 v) pressed?> then\n        broadcast (finish v)\n        set [costume v] to [7]\n    end\nend\n\nwhen flag clicked\nset [mode v] to [Build]\ngo to x: (-180) y: (-72)\nset size to (600) %\nshow\nshow\nset [x v] to [0]\nset [y v] to [0]\nforever\n    change [y v] by (-1)\n    if <key (right arrow v) pressed?> then\n        change [x v] by (1)\n        point in direction (-90)\n    end\n    if <key (left arrow v) pressed?> 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 (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> then\n        change y by (1)\n    end\n    if <<<touching color (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> then\n        change y by (1)\n    end\n    if <<<touching color (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> then\n        change y by (1)\n    end\n    if <<<touching color (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> then\n        change y by (1)\n    end\n    if <<<touching color (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <key (up arrow v) pressed?> then\n            set [y v] to [12]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-8]\n            else\n                set [x v] to [13]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <<<touching color (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<touching color (#999999)?> or <<touching color (#878787)?> or <touching color (#949494)?>>> or <<<touching color (#a67033)?> or <<touching color (#ac793e)?> or <touching color (#b57f41)?>>> or <<touching color (#65b340)?> or <touching color (#60ab3e)?>>>> and <key (up arrow v) pressed?>> then\n        set [y v] to [10.7]\n    end\n    change y by (1)\n    if <touching color (#d900ff)?> then\n        set [y v] to [12.5]\n        show\n    end\nend\n\nwhen flag clicked\nset [ghost v] effect to (0)\nhide\nforever\n    if <<<(y position) < [-178]> or <touching color (#ffb000)?>> and <(Mode) = [play]>> then\n        repeat (5)\n            change [ghost v] effect by (20)\n        end\n        wait (0.2) seconds\n        hide\n        if <(Mode) = [play]> then\n            set [ghost v] effect to (0)\n            show\n            go to x: (-180) y: (-72)\n            set [y v] to [0]\n            show\n        end\n    end\n    show\nend\n\nwhen I receive [build v]\ngo to [front v] layer\nhide\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Mode) = [Build]> then\n        hide\n    end\nend\n\nhide\n\nwhen I receive [play v]\ngo to x: (-180) y: (-72)\nset [y v] to [0]\nset [x v] to [0]\n\nwhen [r v] key pressed\nrepeat (5)\n    change [ghost v] effect by (20)\nend\nwait (0.2) seconds\nhide\ngo to x: (-180) y: (-72)\nset [y v] to [0]\nset [x v] to [0]\nset [ghost v] effect to (0)\nshow\n\nwhen I start as a clone\n\nwhen flag clicked\nforever\n    if <touching color (#ffdf4e)?> then\n        broadcast (Win v)\n        set [x v] to [0]\n        set [y v] to [0]\n        wait (2) seconds\n        go to x: (-180) y: (-72)\n    end\nend\n\ngo to x: (-180) y: (-72)\nset [y v] to [0]\nshow\n\n@Selection\n\nwhen flag clicked\nhide\ngo to x: (-200) y: (-130)\npoint in direction (90)\nset size to (600) %\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nrepeat (9)\n    create clone of (_myself_ v)\n    change x by (50)\n    next costume\nend\n\nwhen I start as a clone\nshow\n\nwhen [space v] key pressed\nif <(Mode) = [Play]> then\n    hide\n    go to x: (-200) y: (-130)\n    point in direction (90)\n    set size to (600) %\n    switch costume to (1 v)\n    create clone of (_myself_ v)\n    repeat (9)\n        create clone of (_myself_ v)\n        change x by (50)\n        next costume\n    end\nend\n\nwhen [space v] key pressed\nif <(Mode) = [Build]> then\n    delete this clone\nend\n\ngo to [front v] layer\n\nwhen flag clicked\n\n@Numbers\n\nwhen flag clicked\nwait (0.3) seconds\nhide\ngo to x: (-204) y: (-157)\npoint in direction (90)\nset size to (600) %\nswitch costume to (1 v)\ncreate clone of (_myself_ v)\nrepeat (9)\n    create clone of (_myself_ v)\n    change x by (50)\n    next costume\nend\n\nwhen I start as a clone\nshow\n\nwhen [space v] key pressed\nif <(Mode) = [Build]> then\n    delete this clone\nend\n\nwhen [space v] key pressed\nif <(Mode) = [Play]> then\n    wait (0.3) seconds\n    hide\n    go to x: (-204) y: (-157)\n    point in direction (90)\n    set size to (600) %\n    switch costume to (1 v)\n    create clone of (_myself_ v)\n    repeat (9)\n        create clone of (_myself_ v)\n        change x by (50)\n        next costume\n    end\nend\n\nif <(Mode) = [Play]> then\nend\n\nwhen flag clicked\n\nif <(Mode) = [Build]> then\n    show\nend\n\n@Mode\n\nwhen flag clicked\nhide\nforever\n    if <(load) = [no]> then\n        wait (3.5) seconds\n        show\n        go to [front v] layer\n        go to x: (0) y: (0)\n        set size to (600) %\n        set [ghost v] effect to (30)\n    end\nend\n\nwhen flag clicked\nforever\n    switch costume to (Mode)\nend\n\nwhen [space v] key pressed\nif <(Mode) = [Play]> then\n    wait (.1) seconds\n    set [mode v] to [Build]\n    broadcast (Build v)\nend\n\nwhen [space v] key pressed\nif <(Mode) = [Build]> then\n    wait (.1) seconds\n    set [mode v] to [Play]\n    broadcast (Play v)\nend\n\n@Delete\n\nwhen [z v] key pressed\nif <(Mode) = [build]> then\n    if <(length of [recent v]) > [0]> then\n        set y to (item (1) of [recent v])\n        delete (1) of [recent v]\n        set x to (item (1) of [recent v])\n        delete (1) of [recent v]\n        go to [front v] layer\n        show\n        stamp\n        wait (0.1) seconds\n        go to x: (400) y: (-200)\n    else\n        hide\n        go to x: (400) y: (-200)\n    end\nend\n\nwhen flag clicked\ndelete this clone\n\nif <(Mode) = [Build]> then\n    show\nend\nif <(Mode) = [Play]> then\n    hide\nend\n\n@Info\n\nwhen flag clicked\nset size to (600) %\nset [ghost v] effect to (30)\ngo to x: (220) y: (160)\n\nwhen this sprite clicked\nif <(x position) = [220]> then\n    repeat until <(x position) = [100]>\n        change x by (-10)\n    end\n    broadcast (Messages v)\nend\n\nwhen this sprite clicked\nif <(x position) = [100]> then\n    broadcast (Hide v)\n    repeat until <(x position) = [220]>\n        change x by (10)\n    end\nend\n\nwhen flag clicked\nforever\n    show\nend\n\nwhen I receive [start v]\nwait (3) seconds\ngo to [front v] layer\n\n@Messages\n\nwhen flag clicked\ngo to [front v] layer\nset size to (600) %\nset [ghost v] effect to (30)\ngo to x: (148) y: (162)\n\nwhen this sprite clicked\nif <(x position) = [120]> then\n    repeat until <(x position) = [220]>\n        change x by (10)\n    end\n    broadcast (Hide v)\nend\n\nwhen flag clicked\nhide\n\nforever\n    if <(Mode) = [Build]> then\n    if <(Mode) = [Play]> then\nend\n\nwhen I receive [messages v]\nwait (0.1) seconds\ngo to x: (148) y: (162)\nshow\ngo to [front v] layer\n\nwhen I receive [hide v]\ngo to x: (1000) y: (-1000)\nhide\n\n@Win\n\nwhen flag clicked\ngo to x: (0) y: (6)\nhide\nforever\n    go [forward v] (10) layers\nend\n\nwhen I receive [win v]\nwait (0.5) seconds\nswitch costume to (costume4 v)\nshow\ngo to [front v] layer\nwait (0.5) seconds\nnext costume\nwait (0.5) seconds\nnext costume\nwait (0.5) seconds\nnext costume\nwait (3) seconds\nhide\nclear sound effects\nset volume to (0) %\n\nforever\n\nwhen I receive [win v]\nset volume to (100) %\nplay sound [Hooray Children Cheer SOUND EFFECT v] until done\n\n@Lava effect\n\n@Start\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to [front v] layer\nwait (0.1) seconds\ngo to [front v] layer\nforever\n    if <(load) = [yes]> then\n        set size to (600) %\n        if <(load) = [yes]> then\n            go to x: (0) y: (0)\n            wait (0.1) seconds\n            if <(load) = [yes]> then\n                switch costume to (1 v)\n                if <(load) = [yes]> then\n                    wait (0.1) seconds\n                    if <(load) = [yes]> then\n                        switch costume to (2 v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nswitch costume to (2 v)\nwait (1) seconds\nswitch costume to (3 v)\nwait (1) seconds\nswitch costume to (4 v)\nwait (0.02) seconds\nswitch costume to (5 v)\nwait (0.02) seconds\nswitch costume to (6 v)\nrepeat (8)\n    change y by (5)\nend\nswitch costume to (3 v)\nrepeat (5)\n    change y by (4)\nend\nrepeat (5)\n    change y by (1)\nend\nswitch costume to (3 v)\nrepeat (10)\n    change y by (-5)\nend\nrepeat (10)\n    change y by (-15)\nend\nrepeat (10)\n    change y by (-20)\nend\nhide\n\nwhen I receive [start v]\n\n@Bunny\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (1 v)\nforever\n    go to [front v] layer\n    set size to (600) %\n    go to x: (0) y: (0)\nend\n\nset [ghost v] effect to (0)\n\nswitch costume to (1 v)\nforever\n    go to [front v] layer\n    set size to (600) %\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nset [load v] to [yes]\nshow\nswitch costume to (1 v)\nwait (0.5) seconds\nrepeat until <<(costume [number v]) = [53]> or <(costume [number v]) = [54]>>\n    wait (pick random (0) to (0.2)) seconds\n    switch costume to ((costume [number v]) + (pick random (1) to (2)))\nend\nwait (pick random (0) to (0.2)) seconds\nswitch costume to (54 v)\nset [load v] to [no]\nbroadcast (Start v)\nwait (0.5) seconds\nswitch costume to (1 v)\nwait (0.05) seconds\nswitch costume to (54 v)\nwait (0.2) seconds\nswitch costume to (1 v)\nwait (0.05) seconds\nswitch costume to (54 v)\nhide\n\n\n\nset size to (600) %\ngo to x: (0) y: (0)\n\nwait (0.5) seconds\nbroadcast (Start v)\n\n