Terrain (A platformer)
@Stage\n\n@Tiles\n\ndefine Render\nshow\ngo to x: (-232) y: (-172)\nerase all\nset [h v] to (pick random (7) to (9))\nrepeat (30)\n    switch costume to (stone v)\n    repeat (h)\n        switch costume to (pick random (2) to (pick random (2) to (pick random (2) to (pick random (3) to (6)))))\n        stamp\n        change y by (16)\n    end\n    switch costume to (dirt v)\n    repeat (3)\n        stamp\n        change y by (16)\n    end\n    switch costume to (grass v)\n    stamp\n    change y by (16)\n    if <(pick random (1) to (25)) = [1]> then\n        switch costume to (wood v)\n        stamp\n    else\n        if <(pick random (1) to (10)) = [1]> then\n            switch costume to (spike v)\n            stamp\n        else\n        end\n    end\n    change x by (16)\n    set y to (-172)\n    set [h v] to ((h) + (pick random (-1) to (1)))\n    if <(h) > [15]> then\n        set [h v] to [15]\n    end\nend\nhide\n\nwhen I receive [message1 v]\nset size to (105) %\nRender\n\n@Player\n\nwhen flag clicked\nbroadcast (message1 v)\n\nwhen I receive [message1 v]\nset [speed x v] to [0]\nshow\nset size to (100) %\ngo to x: (-231) y: (170)\nset [speed y v] to [0]\nforever\n    switch costume to (costume2 v)\n    if <key (right arrow v) pressed?> then\n        switch costume to (costume3 v)\n        set [speed x v] to [5]\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (costume4 v)\n        set [speed x v] to [-5]\n    end\n    set [speed x v] to ((speed x) * (0.9))\n    change x by (speed x)\n    if <touching color (#55c055)?> then\n        change y by (1)\n        if <touching color (#55c055)?> then\n            change y by (1)\n            if <touching color (#55c055)?> then\n                change y by (1)\n                if <touching color (#55c055)?> then\n                    change x by ((speed x) * (-1))\n                    change y by (-3)\n                end\n            end\n        end\n    end\n    Gravity <>\n    if <key (up arrow v) pressed?> then\n        if <(falling?) < [3]> then\n            set [speed y v] to [10]\n            set [falling? v] to [6]\n            set [jumping? v] to [1]\n        end\n    end\n    if <touching color (#7c7c7c)?> then\n        go to x: (-231) y: (170)\n    end\n    if <(x position) > [240]> then\n        broadcast (message1 v)\n    end\nend\n\ndefine Gravity <up?>\nchange [falling? v] by (1)\nif <<(speed y) < [4]> or <key (up arrow v) pressed?>> then\n    change [speed y v] by (-1)\nelse\n    change [speed y v] by (-2)\nend\nchange y by (speed y)\nrepeat until <not <touching color (#55c055)?>>\n    change y by (1)\n    set [speed y v] to [0]\n    set [falling? v] to [0]\nend\n\n@Untitled drawing\n\nwhen flag clicked\nhide\n\n
Arrow keys to move\nDon't touch the spikes\n\nInspired by @-Handle-\n