Underwater- A Scrolling Platformer

Instructions: Hi, Welcome to my second platformer- Underwater.\n\nPlay and explore the world Underwater in this platformer.\n\nI made it for "Wonderful World of Water" SDS. Do check it out- https://scratch.mit.edu/studios/30636997/\n\n☆Instructions☆\n➽ Use arrow keys or wasd to move\n➽ Try to go to end and win.\n\n☆Remix Ideas☆\n➽ Make it mobile friendly\n➽ Make it multiplayer\n➽ Add more levels\n➽ Make it time based\n\nThese are just suggestions, possibilities are endless.. So do remix this project. :)\n

@Stage\n\n@Player\n\nwhen I receive [engine_tick v]\nswitch costume to (PlayerLastC)\nif <(PlayerY) > [0]> then\n    switch costume to (jump v)\nelse\n    if <(PlayerY) < [0]> then\n        switch costume to (fall v)\n    else\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<key (right arrow v) pressed?> or <key (d v) pressed?>>> then\n            if <<[1] < (costume [number v])> and <[10] > (costume [number v])>> then\n                next costume\n            else\n                switch costume to (walk1 v)\n            end\n        else\n            switch costume to (stand v)\n        end\n    end\nend\nset [playerlastc v] to (costume [number v])\n\nwhen I receive [engine_start v]\nshow\npoint in direction (90)\ngo to x: (0) y: (180)\nset rotation style [left-right v]\ngo to [front v] layer\nset size to (80) %\nset [playerx v] to [0]\nset [playery v] to [-3]\nforever\n    switch costume to (hitbox v)\n    change [playery v] by (-1)\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (-90)\n        change [playerx v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (90)\n        change [playerx v] by (1)\n    end\n    set [playerx v] to ((PlayerX) * (0.9))\n    if <touching (ground v)?> then\n        set [playery v] to [0]\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        set [playery v] to [0]\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        set [playery v] to [0]\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        set [playery v] to [0]\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((PlayerX) * (-1))\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [playery v] to [15]\n            if <([abs v] of (PlayerX) ) = (PlayerX)> then\n                set [playerx v] to [-10]\n            else\n                set [playerx v] to [10]\n            end\n        else\n            set [playerx v] to [0]\n        end\n    end\n    change y by (PlayerY)\n    if <touching (ground v)?> then\n        change y by ((PlayerY) - ((PlayerY) * (2)))\n        set [playery v] to [0]\n    end\n    change y by (-1)\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (ground v)?>> then\n        set [playery v] to [15]\n    end\n    change y by (1)\n    set x to (0)\n    set [all_sprite v] to (PlayerX)\n    if <<<touching (_edge_ v)?> and <[-10] > (y position)>> or <key (r v) pressed?>> then\n        switch costume to (stand v)\n        wait until <not <key (r v) pressed?>>\n        set [playerx v] to [0]\n        set [playery v] to [-3]\n        set [all_sprite v] to [-300]\n        point in direction (90)\n        set y to (180)\n    end\n    broadcast (Engine_Tick v) and wait\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen flag clicked\nbroadcast (engine_start v)\n\n@Border\n\nwhen I receive [engine_start v]\nwait (0.01) seconds\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\n@Ground\n\nwhen I receive [engine_tick v]\nset [scrollx v] to ((ScrollX) + (ALL_SPRITE))\nif <(ScrollX) < [0]> then\n    set [scrollx v] to [0]\nend\ngo to x: ((PositionX) - (ScrollX)) y: (0)\n\nwhen I receive [engine_start v]\nset [positionx v] to [0]\nset [scrollx v] to [0]\nswitch costume to (part1 v)\nset [numberofparts v] to [19]\nrepeat ((NumberOfParts) - (1))\n    create clone of (_myself_ v)\n    next costume\n    change [positionx v] by (479)\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    play sound [music 1 v] until done\nend\n\n@Effect\n\nwhen flag clicked\nset [ghost v] effect to (100)\nwait (0.7) seconds\nforever\n    create clone of (_myself_ v)\n    wait (0.01) seconds\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-2)\nend\nwait (pick random (1) to (3)) seconds\n\nwhen I start as a clone\nset size to (pick random (50) to (75)) %\nswitch costume to (pick random (1) to (8))\ngo to x: (pick random (240) to (-240)) y: (pick random (180) to (-180))\nglide (pick random (15) to (20)) secs to x: (pick random (240) to (-240)) y: (pick random (0) to (180))\n\nwhen I start as a clone\nrepeat (pick random (1) to (2))\n    repeat (15)\n        change size by (1.5)\n        change [ghost v] effect by (-5)\n    end\n    wait (0.1) seconds\n    repeat (10)\n        change size by (-5)\n        change [ghost v] effect by (1)\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\nend\ndelete this clone\n\n@Sprite3\n\nwhen flag clicked\ngo to [back v] layer\nwait (0.7) seconds\nforever\n    go to x: (pick random (-240) to (240)) y: (-180)\n    create clone of (_myself_ v)\n    wait (pick random (0.5) to (1.2)) seconds\nend\n\nwhen I start as a clone\ngo to [back v] layer\nrepeat (10)\n    change [ghost v] effect by (-8)\nend\nforever\n    repeat (pick random (20) to (30))\n        change x by (0.3)\n        turn right (1.2) degrees\n    end\n    repeat (5)\n        change x by (0.1)\n    end\n    repeat (pick random (20) to (30))\n        change x by (-0.3)\n        turn right (-1.2) degrees\n    end\n    repeat (5)\n        change x by (-0.1)\n    end\nend\n\nwhen I start as a clone\ngo to [back v] layer\nshow\nset [ghost v] effect to (100)\nset [brightness v] effect to (pick random (-5) to (5))\nset size to (pick random (50) to (120)) %\nrepeat until <touching (sprite2 v)?>\n    change y by (1)\nend\nrepeat (10)\n    change [ghost v] effect by (8)\n    change y by (pick random (1) to (1.2))\nend\ndelete this clone\n\nwhen I receive [fish clicked v]\n\n@Sprite2\n\n