Underwater | Platformer #games

Instructions: #10 games trending!\n★How To Play★\nUse arrow keys/WAD to move.\nCollect coins.\nQ to skip a level, but you will lose 20 oxygen\nAvoid dangers\nGet back to your submarine!\nHave fun!\non the shark level, the strategy is to wait until he stops for a bit, then quickly get past\n★To Show Support★\nmy best platformer yet!\nLeave a love, fave, follow, and tell others!\n@killuaxlikesgon for some small things, changed by me a lot, check out the original\nthx to @legendscroll for player and bubbles, as well as inspiration\npirate ship drawn by @eh7meow\n@mikeono102 for submarine art\ncooltext.com for thumbnail font\nmusic by @bubblebee3\n#all

@Stage\n\nwhen flag clicked\nswitch backdrop to (1 v)\nforever\n    play sound [Rain Drop by bubblebee3 v] until done\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\nswitch costume to (1 v)\nshow\nforever\n    switch costume to (Level)\nend\n\nwhen backdrop switches to [4 v]\nswitch costume to (2 v)\n\nwhen backdrop switches to [5 v]\nswitch costume to (3 v)\n\nwhen backdrop switches to [1 v]\nswitch costume to (1 v)\n\nwhen backdrop switches to [2 v]\nswitch costume to (1 v)\n\nwhen backdrop switches to [3 v]\nswitch costume to (1 v)\n\nwhen backdrop switches to [6 v]\nswitch costume to (4 v)\n\nwhen backdrop switches to [7 v]\nswitch costume to (5 v)\n\nwhen backdrop switches to [8 v]\nswitch costume to (6 v)\n\nwhen backdrop switches to [9 v]\nswitch costume to (7 v)\n\nwhen backdrop switches to [10 v]\nswitch costume to (8 v)\n\nwhen backdrop switches to [11 v]\nswitch costume to (9 v)\n\n@Coins\n\nwhen flag clicked\nshow\ngo to x: (-31) y: (-74)\nswitch costume to (1 v)\nforever\n    if <touching (player v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [2 v]\nshow\ngo to x: (125) y: (-71)\n\nwhen backdrop switches to [3 v]\nshow\ngo to x: (-84) y: (-72)\n\nwhen backdrop switches to [4 v]\nshow\ngo to x: (-173) y: (-71)\n\nwhen backdrop switches to [5 v]\nshow\ngo to x: (-125) y: (42)\n\nwhen backdrop switches to [6 v]\nshow\ngo to x: (-60) y: (39)\n\nwhen backdrop switches to [7 v]\nshow\ngo to x: (115) y: (-1)\n\nwhen backdrop switches to [8 v]\nshow\ngo to x: (-14) y: (-94)\n\nwhen backdrop switches to [9 v]\nshow\ngo to x: (111) y: (60)\n\nwhen backdrop switches to [9 v]\nshow\ngo to x: (111) y: (60)\n\nwhen backdrop switches to [10 v]\nshow\ngo to x: (114) y: (25)\n\nwhen backdrop switches to [11 v]\nshow\ngo to x: (107) y: (-67)\n\n@Exit\n\nwhen flag clicked\ngo to x: (36) y: (28)\nforever\n    go to [back v] layer\n    show\nend\n\nswitch costume to (1 v)\n\nwhen backdrop switches to [12 v]\nhide\n\n@Spikes\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [4 v]\nshow\nswitch costume to (1 v)\n\nwhen backdrop switches to [5 v]\nswitch costume to (2 v)\n\nwhen backdrop switches to [1 v]\nhide\n\nwhen backdrop switches to [2 v]\nhide\n\nwhen backdrop switches to [3 v]\nhide\n\nwhen backdrop switches to [6 v]\nswitch costume to (3 v)\n\nwhen backdrop switches to [7 v]\nswitch costume to (4 v)\n\nwhen backdrop switches to [8 v]\nswitch costume to (5 v)\n\nwhen backdrop switches to [9 v]\nswitch costume to (6 v)\n\nwhen backdrop switches to [10 v]\nswitch costume to (7 v)\n\nwhen backdrop switches to [11 v]\nhide\n\n@TB\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\n\n@Player\n\ndefine Run Game\nchange [speed y v] by (-0.2)\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [speed x v] by (-2)\n    switch costume to (costume3 v)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [speed x v] by (2)\n    switch costume to (costume2 v)\nend\nset [speed x v] to ((Speed X) * (0.7))\nchange x by (Speed X)\nif <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                    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                        end\n                    end\n                end\n            end\n        end\n    end\nend\nif <touching (level v)?> then\n    change y by (-8)\n    repeat until <not <touching (level v)?>>\n        change x by ((Speed X) * (-1))\n    end\n    if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n        set [speed y v] to [4]\n        if <(Speed X) < [0]> then\n            set [speed x v] to [16]\n        else\n            set [speed x v] to [-16]\n        end\n    else\n        set [speed x v] to [0]\n    end\nend\nchange y by (Speed Y)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((Speed Y) * (-1))\n    end\n    set [speed y v] to [0]\nend\nchange y by (-1)\nif <<<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> and <touching (level v)?>> then\n    set [speed y v] to [6]\nend\nchange y by (1)\nif <not <(Level) = [12]>> then\n    if <touching (exit v)?> then\n        go to x: (-213) y: (-28)\n        change [level v] by (1)\n        next backdrop\n    end\nend\nif <<touching (shark v)?> or <<<touching (spikes v)?> or <touching (lava v)?>> or <touching (volcanolava v)?>>> then\n    broadcast (die v)\nend\nif <(y position) < [-178]> then\n    broadcast (die v)\nend\nif <not <<<key (right arrow v) pressed?> or <key (left arrow v) pressed?>> or <key (up arrow v) pressed?>>> then\n    switch costume to (costume1 v)\nend\n\nwhen flag clicked\nshow\ngo to x: (-213) y: (-28)\nset [speed x v] to [0]\nset [speed y v] to [0]\nforever\n    Run Game\nend\n\nwhen I receive [die v]\ngo to x: (-213) y: (-28)\n\nwhen flag clicked\nforever\n    if <key (up arrow v) pressed?> then\n        switch costume to (costume4 v)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-175]> then\n        broadcast (die v)\n    end\nend\n\nwhen flag clicked\nshow variable [o2 v]\nset [o2 v] to [200]\nforever\n    wait (1) seconds\n    change [o2 v] by (-1)\nend\n\nwhen flag clicked\nforever\n    if <touching (bubbles v)?> then\n        change [speed y v] by (0.8)\n    end\n    if <<touching color (#141d2c)?> and <key (space v) pressed?>> then\n        switch backdrop to (13 v)\n        hide\n        stop [other scripts in sprite v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <key (q v) pressed?> then\n        if <(Level) < [12]> then\n            go to x: (-213) y: (-28)\n            change [level v] by (1)\n            change [o2 v] by (-20)\n            next backdrop\n            wait (2) seconds\n        end\n    end\nend\n\n@Trail\n\nwhen flag clicked\nshow\nforever\n    go to [back v] layer\n    go to (player v)\n    if <<(backdrop [number v]) = [13]> and <key (space v) pressed?>> then\n        stop [other scripts in sprite v]\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    wait (pick random (0.3) to (0.4)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset size to (pick random (70) to (100)) %\nrepeat (100)\n    change y by (1)\n    change [ghost v] effect by (5)\nend\n\n@volcanolava\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [7 v]\nshow\nforever\n    switch costume to (costume1 v)\n    repeat (4)\n        next costume\n        wait (0.05) seconds\n    end\n    switch costume to (costume4 v)\n    repeat (3)\n        switch costume to ((costume [number v]) - (1))\n        wait (0.05) seconds\n    end\n    wait (1) seconds\nend\n\nwhen backdrop switches to [8 v]\nhide\n\n@Particle\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\ngo to [back v] layer\nforever\n    wait (pick random (0.5) to (1.5)) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nset y to (pick random (-150) to (200))\nswitch costume to (pick random (1) to (3))\ngo to [back v] layer\nset [ghost v] effect to (pick random (20) to (50))\nshow\nset x to (400)\nset [bubble speed v] to (pick random (-5) to (-0.5))\nset size to (pick random (50) to (60)) %\nrepeat until <(x position) < [-245]>\n    change x by (Bubble speed)\nend\ndelete this clone\n\n@bubbles\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [9 v]\nset [clones v] to [0]\nforever\n    go to x: (-130) y: (-171)\n    create clone of (_myself_ v)\n    change [clones v] by (1)\n    go to x: (2) y: (-169)\n    create clone of (_myself_ v)\n    change [clones v] by (1)\n    go to x: (194) y: (-170)\n    create clone of (_myself_ v)\n    change [clones v] by (1)\n    go to x: (-200) y: (-170)\n    create clone of (_myself_ v)\n    change [clones v] by (1)\n    wait (0.2) seconds\nend\n\nwhen I start as a clone\nshow\nclear graphic effects\nrepeat (30)\n    change y by (5)\nend\nchange [clones v] by (-1)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nshow\nrepeat (5)\n    change x by (2)\nend\nrepeat (5)\n    change x by (-2)\nend\nrepeat (5)\n    change x by (-2)\nend\nrepeat (5)\n    change x by (2)\nend\n\nwhen backdrop switches to [10 v]\nstop [other scripts in sprite v]\nhide\n\nwhen backdrop switches to [9 v]\n\n@Shark\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [9 v]\nshow\ngo to x: (179) y: (37)\nrepeat until <(backdrop [number v]) = [10]>\n    point towards (player v)\n    if <(pick random (1) to (25)) = (pick random (1) to (50))> then\n        move (0) steps\n        wait (2) seconds\n    else\n        move (3) steps\n    end\nend\nhide\n\nwhen I receive [die v]\ngo to x: (179) y: (37)\n\n@o2\n\nwhen flag clicked\nhide\ngo to [back v] layer\ngo [forward v] (1) layers\n\nwhen backdrop switches to [11 v]\nhide\n\nwhen backdrop switches to [10 v]\nshow\nforever\n    if <<touching (player v)?> and <(O2) < [200]>> then\n        change [o2 v] by (1)\n    end\nend\n\nwhen backdrop switches to [12 v]\nhide\nhide variable [o2 v]\n\n@lose\n\nwhen flag clicked\nhide\nforever\n    if <(O2) < [1]> then\n        show\n        hide variable [o2 v]\n        go to [front v] layer\n        stop [all v]\n    end\nend\n\nwhen backdrop switches to [12 v]\nstop [other scripts in sprite v]\nhide\n\n