Blocks - A Platformer
@Stage\n\nwhen flag clicked\nforever\n    play sound [bensound-creativeminds v] until done\nend\n\n@Player\n\nwhen flag clicked\nRespawn\nset [level v] to [1]\nbroadcast (New level v) and wait\nforever\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.5)\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.5)\n    end\n    set [xv v] to ((xv) * (0.78))\n    change x by (xv)\n    if <<touching color (#3fb01c)?> or <touching color (#55ef26)?>> then\n        change y by (1)\n        if <<touching color (#3fb01c)?> or <touching color (#55ef26)?>> then\n            change y by (1)\n            if <<touching color (#3fb01c)?> or <touching color (#55ef26)?>> then\n                change y by (1)\n                if <<touching color (#3fb01c)?> or <touching color (#55ef26)?>> then\n                    change y by (1)\n                    if <<touching color (#3fb01c)?> or <touching color (#55ef26)?>> then\n                        change x by (() - (xv))\n                        change y by (-4)\n                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                            if <(xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [10]\n                        else\n                            set [xv v] to [0]\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 (#3fb01c)?> or <touching color (#55ef26)?>> then\n        change y by (() - (yv))\n        set [yv v] to [0]\n    end\n    change y by (-2)\n    if <<touching color (#3fb01c)?> or <touching color (#55ef26)?>> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [12.5]\n        end\n    end\n    change y by (2)\n    if <<touching color (#a6b01c)?> or <touching color (#e3f026)?>> then\n        set [yv v] to [19]\n    end\n    if <<touching color (#b01c1c)?> or <touching color (#f02626)?>> then\n        Respawn\n    end\n    if <(x position) > [235]> then\n        if <(Level) < (length of [levels v])> then\n            change [level v] by (1)\n            Respawn\n            broadcast (Clear level v) and wait\n            broadcast (New level v) and wait\n        end\n    end\nend\n\ndefine Respawn\ngo to x: (-210) y: (-104)\nset [xv v] to [0]\nset [yv v] to [0]\n\n@Blocks\n\nwhen I receive [new level v]\nGenerate level\n\ndefine Generate level\nset [i v] to [0]\ngo to x: (-215) y: (151)\nrepeat (8)\n    repeat (11)\n        change [i v] by (1)\n        if <not <(letter (i) of (item (Level) of [levels v])) = [0]>> then\n            switch costume to (letter (i) of (item (Level) of [levels v]))\n            create clone of (_myself_ v)\n        end\n        change x by (43)\n    end\n    change y by (-43)\n    set x to (-215)\nend\n\nwhen flag clicked\nhide\ndelete all of [levels v]\nadd [0000000000000000000000000000000000000000000000000000000000000000000000000000011111111111] to [levels v]\nadd [0000000000000000000000000000000000000000000000000000000000000000000000000000011112221111] to [levels v]\nadd [0000000000000000000000000000000000000000000000100000000001000000000010020000011122212111] to [levels v]\nadd [0000000000000000000000000000000000000000000000000000000000000000000000000000011222122211] to [levels v]\nadd [0022222220000200200200002200022000020000020002200200220220002000220000020000011133111111] to [levels v]\nadd [0000000000000000000000000000000000000000000000000000000000000000000020020020011111111111] to [levels v]\nadd [0000002000000000020000000000200000001202000000002000000000020000000000202000011311111111] to [levels v]\nadd [000000000000000000000000000100001010000000000000000000000000000000000100000001222222222] to [levels v]\nadd [0000000000000000000000000000000000000000000000020202000000101010000001000100011311131111] to [levels v]\nadd [0020000000000200000000002000002000020111120000200000200002111102000000000020011111111111] to [levels v]\nadd [1111111111111111111111111111111111111111111100002000200000000000000020002000011111111111] to [levels v]\nadd [0000000000000000000000000000000000000000000000000000000000202020000002020200011323232111] to [levels v]\nadd [0000000000000000000001000000100020000020000200001000002000200000020010000000211111111111] to [levels v]\nadd [1111111111111111111111111111111112222222222200000000000000000000000000000000011333133311] to [levels v]\nadd [2000020000020010200000200202000002102022222220020200000200202000000002000000011311113331] to [levels v]\nadd [0000000000100000000001000000000010000000000100000000001000000000010000000000111111111111] to [levels v]\n\nwhen I start as a clone\nshow\n\nwhen I receive [clear level v]\ndelete this clone\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nset [ghost v] effect to (100)\nshow\n\n
Arrow keys or WASD to move.\nGreen - ground.\nRed - lava.\nYellow - bounce.