Pixel ‖ Platformer

Instructions: 1. Double click the green flag\n2. Use arrow keys to move the player\n3. Wall jump to get over walls\n4. Avoid lava\n5. Pass through the levels\n6. Love ❤\n7. Favorite ⭐\n8. Remix\n9. Follow ➕\n10. Enjoy!\n-------------------------------------------------------------------------\n                                 Story:\nYou are a pixel\nOn a platform.\nYou are the only one\nTrying to get back.\nWill you return\nOr will you not?\n-------------------------------------------------------------------------

@Stage\n\nwhen flag clicked\nswitch backdrop to (level 1 v)\n\n@Player\n\nwhen I receive [return v]\nswitch costume to (player  v)\ngo to x: (-200) y: (-45)\n\nwhen flag clicked\nset [xvel v] to [0]\nswitch costume to (player  v)\ngo to x: (-200) y: (-45)\nwait (1.5) seconds\nPhysics\n\ndefine Physics\nshow\nset size to (300) %\nforever\n    if <touching color (#ff0000)?> then\n        broadcast (return v)\n    end\n    if <(x position) > [235]> then\n        broadcast (return v)\n        next backdrop\n    end\n    if <touching color (#000000)?> then\n        change y by (1)\n    end\n    if <not <touching color (#000000)?>> then\n        change y by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        switch costume to (player  v)\n        change [xvel v] by (1)\n        set [state v] to [1]\n        if <(Xvel) > [5]> then\n            set [xvel v] to [5]\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        switch costume to (player  v)\n        change [xvel v] by (-1)\n        set [state v] to [1]\n        if <(Xvel) < [-5]> then\n            set [xvel v] to [-5]\n        end\n    end\n    if <([abs v] of (Xvel) ) > [.1]> then\n        change x by ((Xvel) * (1))\n    end\n    if <(Xvel) > [0]> then\n        change [xvel v] by (-0.5)\n    else\n        if <(Xvel) < [0]> then\n            change [xvel v] by (0.5)\n        end\n    end\n    change [yvel v] by (-1)\n    change y by (Yvel)\n    if <touching color (#000000)?> then\n        change y by ((0) - (Yvel))\n        set [yvel v] to [1]\n    end\n    if <touching color (#000000)?> then\n        if <<key (space v) pressed?> or <key (up arrow v) pressed?>> then\n            change [yvel v] by (15)\n        end\n    end\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            Wall detection\n                        end\n                    end\n                end\n            end\n        end\n    end\nend\n\ndefine out\nif <(Xvel) > [0]> then\n    repeat until <not <touching color (#000000)?>>\n        change x by (-1)\n    end\nelse\n    if <(Xvel) < [0]> then\n        repeat until <not <touching color (#000000)?>>\n            change x by (1)\n        end\n    end\nend\n\ndefine Wall detection\nchange y by (-5)\nchange x by ((Xvel) * (-1.7))\nif <([abs v] of (Xvel) ) > [.2]> then\n    if <(Xvel) > [0]> then\n        set [xvel v] to [-6]\n    else\n        set [xvel v] to [6]\n    end\n    set [yvel v] to [14]\nelse\n    if <(Xvel) < [-.2]> then\n        set [yvel v] to [-3]\n        set [xvel v] to [0]\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [Take a Chance v] until done\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [front v] layer\nhide\n\n