My First Platformer

Instructions: 5300 VIEWS+?! THANK EVERYONE!\ndont play on fullsceen because it lagy\nuse arrows or w a d to movement\ndont touch lava\nteleport to next level by touch right edge\ncollect keys to open doors\nNow it is mobile friendly (bit)\nBugs: on mobile you cant open doors, sometimes you stuck in ground and sometines it bit laggy, when you beet score record it didnt set cloud variable (i think)\n\n\n\nTRY MY NEW SCROLLING PLATFORMER!\nhttps://scratch.mit.edu/projects/459890795/5

@Stage\n\nwhen flag clicked\nswitch backdrop to (pozadí1 v)\nforever\n    if <(Level) < [7]> then\n        switch backdrop to (pozadí1 v)\n    end\n    if <(Level) > [6]> then\n        switch backdrop to (pozadí2 v)\n    end\n    if <(Level) > [11]> then\n        switch backdrop to (pozadí1 v)\n    end\n    if <(Level) = [17]> then\n        forever\n            if <(score) > (☁ score record)> then\n                set [☁ score record v] to (score)\n            end\n            show variable [score v]\n            show variable [☁ score record v]\n            broadcast (game end v)\n            stop [other scripts in sprite v]\n            stop [this script v]\n        end\n    end\nend\n\nwhen flag clicked\nhide variable [score v]\nhide variable [☁ score record v]\nset [score v] to [1000000]\nforever\n    set [score v] to ((score) - ((deaths) * (10)))\n    set [score v] to ((score) - ((time) / (2)))\nend\n\n@player\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (kostým1 v)\nshow\nshow variable [keys v]\nshow variable [level v]\nhide variable [time v]\nhide variable [deaths v]\nset [time v] to [0]\nset [deaths v] to [0]\nset [y velocity v] to [0]\nset [x velocity v] to [0]\ngo to x: (-214) y: (-100)\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <<(mouse x) > [0]> or <(mouse x) = [0]>>>> then\n        change [x velocity v] by (1)\n        switch costume to (kostým1 v)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <<(mouse x) < [0]> or <(mouse x) = [0]>>>> then\n        change [x velocity v] by (-1)\n        switch costume to (kostým2 v)\n    end\n    set [x velocity v] to ((X velocity) * (.9))\n    change x by (X velocity)\n    change [y velocity v] by (-1)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                    end\n                    if <touching (level v)?> then\n                        change x by ((X velocity) * (-1))\n                        change y by (-5)\n                        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n                            if <(X velocity) > [0]> then\n                                set [x velocity v] to [-5]\n                            else\n                                set [x velocity v] to [5]\n                            end\n                            set [y velocity v] to [10]\n                        else\n                            set [x velocity v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Y velocity)\n    if <touching (level v)?> then\n        change y by ((Y velocity) * (-1))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <touching (level v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n            change [y velocity v] by (10)\n        end\n    end\n    change y by (1)\n    if <(x position) > [210]> then\n        go to x: (-214) y: (-100)\n        change [level v] by (1)\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n    end\n    if <touching (lava! v)?> then\n        go to x: (-214) y: (-100)\n        change [deaths v] by (1)\n    end\n    if <<touching (doors v)?> and <<(keys) > [1]> or <(keys) = [1]>>> then\n        if <key (space v) pressed?> then\n            broadcast (door opened v)\n            go to x: (-214) y: (-81)\n        end\n    end\n    if <(Level) = [17]> then\n        hide variable [keys v]\n        hide variable [level v]\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\n@level\n\nwhen flag clicked\nshow\ngo to x: (0) y: (0)\nset [level v] to [1]\nforever\n    switch costume to (Level)\n    if <(Level) = [17]> then\n        hide\n        broadcast (outro v)\n        stop [this script v]\n    end\nend\n\n@lava!\n\nwhen flag clicked\ngo to [front v] layer\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\ngo to x: (56) y: (-59)\n\nwhen flag clicked\nforever\n    if <(Level) > [15]> then\n        hide\n    end\nend\n\n@key\n\nwhen flag clicked\nset [keys v] to [0]\n\nwhen flag clicked\nforever\n    if <touching (player v)?> then\n        change [keys v] by (1)\n        hide\n    end\n    if <<(keys) = [0]> and <(Level) = [1]>> then\n        show\n        go to x: (90) y: (16)\n        if <touching (player v)?> then\n            change [keys v] by (1)\n            hide\n        end\n    end\n    if <<(keys) = [1]> and <(Level) = [4]>> then\n        show\n        go to x: (161) y: (-30)\n        if <touching (player v)?> then\n            change [keys v] by (1)\n            hide\n        end\n    end\n    if <<(keys) = [1]> and <(Level) = [10]>> then\n        show\n        go to x: (247) y: (-22)\n        if <touching (player v)?> then\n            change [keys v] by (1)\n            hide\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<<(keys) = [0]> and <(Level) = [1]>> or <<<(keys) = [1]> and <(Level) = [4]>> or <<(keys) = [1]> and <(Level) = [10]>>>>> then\n        hide\n    end\nend\n\n@doors\n\nwhen flag clicked\ngo to x: (231) y: (92)\nhide\ngo to [back v] layer\nforever\n    if <touching (player v)?> then\n        think [you need a key to unlock this door. Press space to unlock] for (1) seconds\n    end\n    if <(Level) = [6]> then\n        show\n    end\n    if <(Level) = [11]> then\n        show\n    end\n    if <(Level) = [16]> then\n        show\n        go to x: (225) y: (6)\n    end\n    if <(Level) = [17]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen I receive [door opened v]\nhide\nchange [keys v] by (-1)\nchange [level v] by (1)\n\nwhen [k v] key pressed\nset [keys v] to [2]\n\n@Arrow1\n\nwhen flag clicked\ngo to x: (-187) y: (-140)\nhide\n\nwhen I receive [game end v]\ngo to [front v] layer\nshow\nforever\n    repeat (10)\n        change y by (1)\n    end\n    repeat (10)\n        change y by (-1)\n    end\nend\n\n@outro\n\nwhen flag clicked\nhide\n\nwhen I receive [outro v]\ngo to x: (0) y: (0)\nshow\nforever\n    change x by ((((mouse x) / (-5)) - (x position)) * (0.3))\n    change y by ((((mouse y) / (-2.1)) - (y position)) * (0.3))\nend\n\n@sounds\n\nwhen flag clicked\nforever\n    wait (1) seconds\n    repeat (2)\n        play sound [Guitar Chords2 v] until done\n    end\n    wait (1) seconds\n    repeat (2)\n        play sound [Video Game 2 v] until done\n    end\n    wait (1) seconds\n    repeat (2)\n        play sound [Dance Around v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [17]> then\n        stop all sounds\n        stop [other scripts in sprite v]\n        play sound [Cheer v] until done\n    end\nend\n\n