Lost— A Mobile Friendly Platformer

Instructions: Part 1: https://scratch.mit.edu/projects/590261836/\nPart 2: https://scratch.mit.edu/projects/624411056/\nPart 4: https://scratch.mit.edu/projects/627607932/\nPart 5: https://scratch.mit.edu/projects/630352670/\nWASD or arrow keys to move.\nIt is mobile friendly.\nI've added 2 types of enemies, arrow and bow.\nSpace to swing sword.\nSword can swing away enemy's weapon and kill them.\nSword can also reflect arrows.\nSpikes have a new look.\n200 loves for part 4.\nFollow me --@Tao196\n\n\nGame contest\nhttps://scratch.mit.edu/projects/629319208/

@Stage\n\n@Player\n\nwhen flag clicked\nshow\ngo to x: (-216) y: (-150)\nswitch costume to (player right v)\ngo to [front v] layer\nforever\n    if <(y position) = [-180]> then\n        switch costume to (player v)\n        broadcast (Respawn v)\n        go to x: (-216) y: (-150)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        switch costume to (player right v)\n        change [x v] by (1)\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        switch costume to (player left v)\n        change [x v] by (-1)\n    end\n    set [x v] to ((X) * (0.9))\n    change x by (X)\n    if <touching (levels v)?> then\n        change y by (1)\n        if <touching (levels v)?> then\n            change y by (1)\n            if <touching (levels v)?> then\n                change y by (1)\n                if <touching (levels v)?> then\n                    change y by (1)\n                    if <touching (levels v)?> then\n                        change y by (1)\n                        if <touching (levels v)?> then\n                            change x by ((X) * (-1))\n                            change y by (-5)\n                            if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                                if <(X) > [0]> then\n                                    set [x v] to [-5]\n                                else\n                                    set [x v] to [5]\n                                end\n                                set [y v] to [10]\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (Y)\n    if <touching (levels v)?> then\n        change y by ((Y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <touching (levels v)?> then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [y v] to [15]\n            start sound [Jump v]\n        end\n    end\n    change y by (1)\n    if <touching (obstacles v)?> then\n        broadcast (Respawn v)\n        go to x: (-210) y: (-110)\n        switch costume to (player v)\n        start sound [Bonk v]\n    end\n    if <(x position) > [227]> then\n        go to x: (-216) y: (-148)\n        change [level v] by (1)\n        switch costume to (player right v)\n        start sound [Next Level v]\n    end\n    if <touching (trampoline v)?> then\n        set [y v] to [20]\n        start sound [Big Boing v]\n    end\nend\n\n@Levels\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [level v] to [1]\nshow\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@Background\n\nwhen flag clicked\ngo to [back v] layer\ngo to x: (0) y: (0)\nswitch costume to (sky v)\nshow\n\nwhen flag clicked\nforever\n    if <(Level) = [8]> then\n        switch costume to (sun v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [14]> then\n        switch costume to (sky v)\n    end\nend\n\nwhen I receive [restart v]\nswitch costume to (sky v)\n\n@Text\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Obstacles\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Trampoline\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Shadows\n\nwhen flag clicked\nshow\ngo [backward v] (100) layers\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Thumbnail\n\nwhen flag clicked\nhide\n\n@Restart Button\n\nwhen flag clicked\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\nforever\n    if <mouse down?> then\n        set [level v] to [1]\n        broadcast (Restart v)\n    end\nend\n\n@clouds\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (2.5) to (3.5)) seconds\nend\n\nwhen I start as a clone\nshow\ngo [backward v] (1) layers\nset size to (pick random (50) to (70)) %\nswitch costume to (pick random (1) to (3))\nset [ghost v] effect to (pick random (30) to (45))\nset [cloud side v] to (pick random (1) to (2))\nif <(Cloud side) = [1]> then\n    go to x: (246) y: (pick random (140) to (80))\n    repeat until <(x position) < [-243]>\n        change x by ((0) - (pick random (0.5) to (2)))\n    end\nelse\n    go to x: (-246) y: (pick random (140) to (80))\n    repeat until <(x position) > [243]>\n        change x by (pick random (0.5) to (2))\n    end\nend\ndelete this clone\n\nwhen flag clicked\nhide\n\n@Grass\n\nwhen flag clicked\nshow\ngo [backward v] (100) layers\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Trees\n\nwhen flag clicked\nshow\ngo [backward v] (200) layers\ngo to x: (0) y: (0)\nforever\n    switch costume to (Level)\nend\n\n@Music Button\n\nwhen flag clicked\nshow\ngo to x: (-88) y: (1)\ngo to [front v] layer\nswitch costume to (music button v)\nset [music on? v] to [no]\nset size to (100) %\n\nwhen this sprite clicked\nif <(Music On?) = [no]> then\n    broadcast (Start Music v)\nelse\n    stop [other scripts in sprite v]\n    stop all sounds\n    set [music on? v] to [no]\nend\n\nwhen I receive [start music v]\nset [music on? v] to [yes]\nforever\n    play sound [mbb-beach v] until done\nend\n\n