UNDERWATER CITY(Platformer)
@Stage\n\nwhen flag clicked\nforever\n    broadcast (Update v)\nend\n\n@Blank\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@Player\n\nwhen flag clicked\nbroadcast (Start v)\nforever\n    Movement\nend\n\nwhen I receive [start v]\nset [agility v] to [15]\nset [speed v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nset [slope v] to [5]\nset [scrollx v] to [0]\nset [scrolly v] to [0]\nshow\nrepeat (4)\n    set [ghost v] effect to (100)\n    wait (0.02) seconds\n    clear graphic effects\n    wait (0.05) seconds\nend\n\ndefine Movement\nswitch costume to (hitbox v)\nset rotation style [don't rotate v]\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    change [xv v] by (Speed)\n    point in direction (90)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(x position) > (mouse x)> and <mouse down?>>> then\n    change [xv v] by (join [-] (Speed))\n    point in direction (-90)\nend\nif <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<(y position) > (mouse y)> and <mouse down?>>> then\n    change [yv v] by (-5)\nend\nset [xv v] to ((Xv) * (.9))\nX-Collision\nchange [yv v] by (-1)\nY-Collision <(Yv) > [0]>\nchange [scrollx v] by ((x position) * (-1))\nchange [scrolly v] by ((y position) * (-1))\ngo to x: (0) y: (0)\n\ndefine X-Collision\nchange x by (Xv)\nrepeat until <<(Slope) > [8]> or <not <touching (ground v)?>>>\n    change [slope v] by (1)\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by ((Slope) * (-1))\n    set [slope v] to [0]\n    change x by ((Xv) * (-1))\n    set [xv v] to [0]\nend\n\ndefine Y-Collision <going up?>\nchange y by (Yv)\nif <touching (ground v)?> then\n    set [yv v] to [0]\n    repeat until <not <touching (ground v)?>>\n        if <going up?> then\n            change y by (-1)\n        else\n            change y by (1)\n        end\n    end\n    if <<<key (w v) pressed?> or <<key (space v) pressed?> or <key (up arrow v) pressed?>>> or <<(mouse y) > (y position)> and <mouse down?>>> then\n        if <not <going up?>> then\n            set [yv v] to (Agility)\n        end\n    end\nend\nset rotation style [left-right v]\nswitch costume to (Animation #)\n\nwhen I receive [start v]\nforever\n    set [animation # v] to [2]\n    wait (pick random (3) to (5)) seconds\n    set [animation # v] to [3]\n    wait (0.04) seconds\n    set [animation # v] to [4]\n    wait (0.04) seconds\n    set [animation # v] to [5]\n    wait (0.08) seconds\n    set [animation # v] to [6]\n    wait (0.06) seconds\nend\n\nwhen flag clicked\nforever\n    if <(ScrollY) > [500]> then\n        broadcast (Start v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    broadcast (Bubble v)\n    wait (0.14) seconds\n    broadcast (Bubble v)\n    wait (0.14) seconds\n    broadcast (Bubble v)\n    wait (1.9) seconds\nend\n\nwhen I receive [start v]\nwait (1) seconds\nforever\n    if <touching (obstacles v)?> then\n        broadcast (Dead v)\n        switch costume to (death v)\n        set rotation style [all around v]\n        stop [other scripts in sprite v]\n        set [yv v] to [10]\n        repeat until <touching (_edge_ v)?>\n            go to [front v] layer\n            turn left (3) degrees\n            change y by (Yv)\n            change [yv v] by (-1)\n        end\n        hide\n        wait (1) seconds\n        broadcast (Start v)\n        stop [all v]\n    end\nend\n\nwhen flag clicked\nforever\n    set [mouse x v] to (mouse x)\n    set [mouse y v] to (mouse y)\nend\n\n@Ground\n\nwhen I receive [update v]\nif <(Ground Clone #) = [0]> then\n    go to x: (ScrollX) y: (ScrollY)\n    switch costume to (middle v)\nelse\n    if <(Ground Clone #) = [1]> then\n        go to x: ((ScrollX) + (475)) y: (ScrollY)\n        switch costume to (right v)\n    else\n        if <(Ground Clone #) = [2]> then\n            go to x: ((ScrollX) - (475)) y: (ScrollY)\n            switch costume to (left v)\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\ngo to [front v] layer\nswitch costume to (middle v)\nset [ground clone # v] to [0]\nrepeat (2)\n    change [ground clone # v] by (1)\n    create clone of (_myself_ v)\nend\nset [ground clone # v] to [0]\n\n@Bushes Mid\n\nwhen I receive [update v]\ngo to x: (ScrollX) y: (ScrollY)\ngo [backward v] (1) layers\n\n@Bushes Right\n\nwhen I receive [update v]\ngo to x: ((ScrollX) + (475)) y: (ScrollY)\ngo [backward v] (1) layers\n\n@Bushes Left\n\nwhen I receive [update v]\ngo to x: ((ScrollX) - (475)) y: (ScrollY)\ngo [backward v] (1) layers\n\n@Border\n\nwhen flag clicked\nshow\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nforever\n    play sound [Scandinavianz - Atlantis \(Out Now\) v] until done\nend\n\n@Bubble\n\nwhen flag clicked\nhide\ngo to [back v] layer\n\nwhen I receive [bubble v]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (bubble v)\nshow\nset size to (pick random (5) to (50)) %\ngo to (player v)\nmove (pick random (-1) to (1)) steps\nrepeat until <touching (border v)?>\n    change y by (3)\nend\nswitch costume to (blast v)\nwait (0.05) seconds\nswitch costume to (blast2 v)\ndelete this clone\n\n@Fishes\n\nwhen I receive [update v]\ngo to x: ((ScrollX) * (.5)) y: ((ScrollY) * (.5))\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\n@Obstacles\n\nwhen I receive [start v]\nhide\nrepeat (10)\n    delete this clone\nend\nset [obstacle type v] to [Spike Mid]\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nset [obstacle type v] to [Spike Right]\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nset [obstacle type v] to [Spike Left]\ncreate clone of (_myself_ v)\nwait (0.1) seconds\nset [obstacle type v] to [Saw]\ncreate clone of (_myself_ v)\n\nwhen I receive [update v]\nif <(Obstacle Type) = [Spike Mid]> then\n    switch costume to (spikes mid v)\n    go to x: (ScrollX) y: (ScrollY)\nelse\n    if <(Obstacle Type) = [Spike Right]> then\n        switch costume to (spikes right v)\n        go to x: ((ScrollX) + (475)) y: (ScrollY)\n    else\n        if <(Obstacle Type) = [Spike Left]> then\n            switch costume to (spikes left v)\n            go to x: ((ScrollX) - (475)) y: (ScrollY)\n        else\n            if <(Obstacle Type) = [Saw]> then\n                switch costume to (saw\(only left\) v)\n                go to x: ((ScrollX) - (360)) y: ((ScrollY) - (60))\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nshow\nif <(Obstacle Type) = [Saw]> then\n    forever\n        turn right (15) degrees\n    end\nend\n\n@Coins\n\ndefine Create Coin At : (x) (y)\nset [coin x v] to (x)\nset [coin y v] to (y)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nswitch costume to (coin1 v)\nset size to (100) %\nforever\n    if <not <(costume [number v]) = [10]>> then\n        next costume\n        if <(costume [number v]) > [8]> then\n            switch costume to (coin1 v)\n        end\n        go to x: ((ScrollX) + (Coin X)) y: ((ScrollY) + (Coin Y))\n    end\nend\n\nwhen I start as a clone\nforever\n    if <<touching (player v)?> or <touching (pet v)?>> then\n        switch costume to (sparkle v)\n        repeat (10)\n            change [ghost v] effect by (10)\n            change size by (4)\n        end\n        change [coins collected v] by (1)\n        change [coins v] by (1)\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nforever\n    repeat (10)\n        change [coin y v] by (.5)\n    end\n    repeat (10)\n        change [coin y v] by (-.5)\n    end\nend\n\nwhen I receive [start v]\nset [coins collected v] to [0]\nhide\nrepeat (10)\n    delete this clone\nend\nCreate Coin At : [40] [0]\nCreate Coin At : [-180] [60]\nCreate Coin At : [-550] [160]\nCreate Coin At : [600] [160]\nCreate Coin At : [270] [195]\nCreate Coin At : [-540] [-40]\n\n@Win\n\nwhen flag clicked\nset [coins collected v] to [0]\nset [win v] to [no]\nhide\ngo to x: (-465) y: (0)\nforever\n    if <(Win) = [yes]> then\n        show\n        glide (2) secs to x: (465) y: (0)\n        stop [all v]\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Coins Collected) = [6]> then\n        set [win v] to [yes]\n        wait (0.1) seconds\n        set [win v] to [no]\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    wait (1) seconds\n    change [timer v] by (1)\nend\n\n@Thumbnail\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\n\n@Coins Image\n\nwhen flag clicked\nset [ghost v] effect to (10)\nshow\nswitch costume to (coin1 v)\nset size to (125) %\nforever\n    go to [front v] layer\n    if <not <(costume [number v]) = [10]>> then\n        next costume\n        if <(costume [number v]) > [8]> then\n            switch costume to (coin1 v)\n        end\n    end\nend\n\n@Coins Collected\n\nwhen flag clicked\nshow\nforever\n    go to [front v] layer\n    if <(Coins Collected) = [1]> then\n        switch costume to (1 v)\n    end\n    if <(Coins Collected) = [2]> then\n        switch costume to (2 v)\n    end\n    if <(Coins Collected) = [3]> then\n        switch costume to (3 v)\n    end\n    if <(Coins Collected) = [4]> then\n        switch costume to (4 v)\n    end\n    if <(Coins Collected) = [5]> then\n        switch costume to (5 v)\n    end\n    if <(Coins Collected) = [6]> then\n        switch costume to (6 v)\n    end\n    if <(Coins Collected) = [0]> then\n        switch costume to (0 v)\n    end\nend\n\n@Egg\n\nwhen flag clicked\nshow\nswitch costume to (egg v)\npoint in direction (90)\nset size to (50) %\nset [pet on v] to [0]\ngo to x: (-200) y: (0)\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\nset [mode v] to [ Not Hatched]\nforever\n    Hatch Egg\nend\n\ndefine Hatch Egg\nif <<<touching (mouse-pointer v)?> and <mouse down?>> and <(Mode) = [ Not Hatched]>> then\n    set [mode v] to [Hatched]\n    glide (1) secs to x: (0) y: (0)\n    repeat until <(size) = [100]>\n        change size by (1)\n    end\n    turn right (20) degrees\n    wait (0.5) seconds\n    turn left (20) degrees\n    turn left (20) degrees\n    wait (0.5) seconds\n    turn right (20) degrees\n    turn right (20) degrees\n    wait (0.5) seconds\n    turn left (20) degrees\n    turn left (20) degrees\n    point in direction (90)\n    set [which pet? v] to (pick random (1) to (6))\n    if <(Which Pet?) = [1]> then\n        switch costume to (1 v)\n    end\n    if <(Which Pet?) = [2]> then\n        switch costume to (2 v)\n    end\n    if <(Which Pet?) = [3]> then\n        switch costume to (3 v)\n    end\n    if <(Which Pet?) = [4]> then\n        switch costume to (4 v)\n    end\n    if <(Which Pet?) = [5]> then\n        switch costume to (5 v)\n    end\n    if <(Which Pet?) = [6]> then\n        switch costume to (6 v)\n    end\n    broadcast (Pet Selected v)\n    repeat (10)\n        change size by (10)\n    end\n    wait (1) seconds\n    hide\n    set [pet on v] to [1]\nend\n\n@Pet\n\nwhen flag clicked\nforever\n    if <(Pet On) = [1]> then\n        show\n    else\n        hide\n    end\nend\n\nwhen I receive [pet selected v]\nif <(Which Pet?) = [1]> then\n    switch costume to (1 v)\n    set [agility v] to [16.5]\n    set [speed v] to [1.3]\nend\nif <(Which Pet?) = [2]> then\n    switch costume to (2 v)\n    set [agility v] to [16.5]\nend\nif <(Which Pet?) = [3]> then\n    switch costume to (3 v)\n    set [speed v] to [1.3]\nend\nif <(Which Pet?) = [4]> then\n    switch costume to (4 v)\n    set [agility v] to [18]\nend\nif <(Which Pet?) = [5]> then\n    switch costume to (5 v)\n    set [speed v] to [1.5]\nend\nif <(Which Pet?) = [6]> then\n    switch costume to (6 v)\n    set [agility v] to [18]\n    set [speed v] to [1.5]\nend\n\nwhen I receive [dead v]\nsay [Oh No My Owner I Will Miss You]\n\n
Computer Controls:-\nSpace Or W Or Up Arrow To Jump\nRight Arrow Or D To Move Right\nLeft Arrow Or A To Move Left\n\n Mobile Controls: -\nTap Above Of The Character To Jump\nTap Below And Right Of The Character To Move Right\nTap Below And Left Of The Character To Move Left\nTap Above And Right Of The Character To Jump The Character Towards Right Side\nTap Above And Left Of The Character To Jump The Character Towards Left Side\n\nTurbowrap link:-\nhttps://turbowarp.org/487582338\n\nUpdates:-\nPress Down Arrow Or S Key Or Under Player(Mobile Control) To Come Down Quick\nNew Op Pet Added To Game Find Out What It Is\nBrightness Effect Based On Player's Y Position\n\nCollect All The Coins In The Map To Win\nAnd Don't Forget To Like And Fav And Comment In The Game If You Liked It\nLeave The Amount Of Time In Which You Could Complete The Game\n\nThanks For Playing\n\nHashtags:-\n#all #games #platformer #underwatercity #underwater \n#marine #sea #ocean #mermaid #game #obby #music #art #trending\n\nbtw there is a glitch that I am not able to fix