Sea Captain - Platformer

Instructions: Hi everyone! I realized that I hadn't posted a new game in a while, so I decided to make this game for a few days.  I had alot of fun making it, especially designing the artwork and theme!\n\nInstructions:\n- Arrow keys to move\n- Avoid icebergs, sharks, and spikes\n- You can jump on some text, but some text is also deadly. \n\nHints:\n- Try jumping on some text to see which is safe\n- At the last level with the portals, try out each portal to see which is the right one\n- Good luck ;)\n\nI hope you enjoy! Let me know if you liked it or if you found any bugs! :)\n

@Stage\n\nwhen I receive [play v]\nforever\n    wait (0.5) seconds\n    repeat (10)\n        change [brightness v] effect by (0.33)\n    end\n    wait (0.01) seconds\n    repeat (10)\n        change [brightness v] effect by (-0.33)\n    end\nend\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nswitch backdrop to (backdrop1 v)\nset [color v] effect to (0)\nset [brightness v] effect to (0)\n\nchange [color v] effect by (0.5)\n\nchange [color v] effect by (-0.5)\n\nwhen I receive [start music v]\nforever\n    play sound [music v] until done\nend\n\nwhen flag clicked\nstart sound [Shire Girl3 v]\n\nwhen I receive [end intro v]\nbroadcast (start music v)\n\nwhen I receive [next level v]\nnext costume\n\n@ocean\n\nwhen flag clicked\ngo to x: (-14) y: (-53)\nswitch costume to (ocean2 v)\n\nbroadcast (start music v)\n\nwhen I receive [play v]\ngo to x: (-14) y: (-53)\nforever\n    if <(costume [number v]) < [6]> then\n        repeat (10)\n            change y by (0.8)\n        end\n        repeat (10)\n            change y by (-0.8)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [5]> then\n        set [shark level v] to [1]\n    else\n        set [shark level v] to [0]\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\n@boat\n\ndefine slide right\nset [slide v] to [4]\nrepeat (10)\n    change x by (slide)\n    change [slide v] by (-0.4)\nend\n\nwhen flag clicked\ngo to x: (-215) y: (-65)\n\nbroadcast (play v)\n\nwhen I receive [play v]\ngo to x: (-215) y: (-57)\ngo to [front v] layer\nshow\nfade in\nset [scroll y_ jumping v] to [0]\nset [jump v] to [0]\nforever\n    if <key (up arrow v) pressed?> then\n        set [jump v] to [1]\n        if <(mid-air) = [0]> then\n            set [scroll y_ jumping v] to [10]\n            repeat (20)\n                change y by (Scroll y_ jumping)\n                change [scroll y_ jumping v] by (-0.5)\n            end\n            repeat until <<<touching color (#88cbf5)?> or <touching color (#e3a643)?>> or <touching color (#406e9c)?>>\n                change y by (Scroll y_ jumping)\n                change [scroll y_ jumping v] by (-0.5)\n            end\n            set [jump v] to [0]\n        end\n    end\nend\n\nchange y by (-15)\n\ndefine fade out\nrepeat (4)\n    change [ghost v] effect by (25)\nend\n\nwhen I receive [play v]\nforever\n    if <<not <touching (ocean v)?>> and <not <touching (platform v)?>>> then\n        if <(Jump) = [0]> then\n            set [scroll y_ jumping v] to [0]\n            set [mid-air v] to [1]\n            repeat until <<<touching color (#88cbf5)?> or <touching color (#e3a643)?>> or <touching color (#406e9c)?>>\n                change y by (Scroll y_ jumping)\n                change [scroll y_ jumping v] by (-0.5)\n            end\n        end\n    else\n        set [mid-air v] to [0]\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <key (right arrow v) pressed?> then\n        if <(mid-air) = [0]> then\n            change x by (7)\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        if <(mid-air) = [0]> then\n            if <(x position) > [-212]> then\n                change x by (-7)\n            else\n                change x by (0)\n            end\n        end\n    end\nend\n\nwhen I receive [play v]\nforever\n    if <key (right arrow v) pressed?> then\n        if <(mid-air) = [0]> then\n            wait until <not <key (right arrow v) pressed?>>\n            if <not <key (right arrow v) pressed?>> then\n                slide right\n            end\n        end\n    end\n    if <key (left arrow v) pressed?> then\n        if <(mid-air) = [0]> then\n            if <(x position) > [-212]> then\n                wait until <not <key (left arrow v) pressed?>>\n                if <not <key (left arrow v) pressed?>> then\n                    slide left\n                end\n            end\n        end\n    end\nend\n\ndefine slide left\nset [slide v] to [-4]\nrepeat (10)\n    change x by (slide)\n    change [slide v] by (0.4)\nend\n\nwhen flag clicked\nforever\n    if <<(x position) > [245]> or <touching color (#406e9c)?>> then\n        broadcast (next level v)\n    end\n    if <<touching (obstacle v)?> or <touching (sharks v)?>> then\n        fade out\n        hide\n        broadcast (play v)\n    end\n    if <touching color (#002510)?> then\n        broadcast (win v)\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-215) y: (-57)\ngo to [front v] layer\nshow\n\nwhen flag clicked\nforever\n    set [boat x v] to (x position)\nend\n\nset [e v] to [1]\n\ndefine fade in\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\n\n@bird\n\nwhen flag clicked\nset [brightness v] effect to (0)\nhide\n\nstart sound [Seagulls v]\n\nwhen I receive [bird v]\nrepeat (5)\n    change y by (1)\nend\nrepeat until <(x position) > [257]>\n    repeat (10)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<(backdrop [number v]) = [7]> or <(backdrop [number v]) > [7]>>> then\n        wait (pick random (1) to (2)) seconds\n        show\n        set size to (pick random (80) to (100)) %\n        set [ghost v] effect to (pick random (40) to (60))\n        go to x: (-300) y: (pick random (25) to (120))\n        broadcast (bird v)\n        repeat until <(x position) > [257]>\n            next costume\n            change x by (3)\n        end\n        hide\n    end\nend\n\n@bird2\n\nwhen flag clicked\nset [brightness v] effect to (0)\nhide\n\nstart sound [Seagulls v]\n\nwhen I receive [bird v]\nrepeat (5)\n    change y by (1)\nend\nrepeat until <(x position) > [257]>\n    repeat (10)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <not <<(backdrop [number v]) = [7]> or <(backdrop [number v]) > [7]>>> then\n        wait (pick random (3) to (5)) seconds\n        show\n        set size to (pick random (80) to (100)) %\n        set [ghost v] effect to (pick random (50) to (60))\n        go to x: (-300) y: (pick random (100) to (140))\n        broadcast (bird v)\n        repeat until <(x position) > [257]>\n            next costume\n            change x by (3)\n        end\n        hide\n    end\nend\n\n@platform\n\nwhen flag clicked\ngo to x: (5) y: (2)\nshow\nswitch costume to (8 v)\n\nwhen I receive [next level v]\nnext costume\n\n@obstacle\n\nwhen flag clicked\ngo to x: (36) y: (-17)\nshow\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n@text\n\nwhen flag clicked\ngo to x: (36) y: (-17)\nshow\nswitch costume to (costume1 v)\n\ngo to [front v] layer\n\nwhen I receive [next level v]\nnext costume\n\n@sharks\n\nwhen flag clicked\ngo to [back v] layer\nhide\ngo to x: (-86) y: (-150)\npoint in direction (180)\nforever\n    if <(shark level) = [1]> then\n        wait (0.3) seconds\n        repeat until <(shark level) = [0]>\n            set [shark v. v] to [15]\n            set x to (boat X)\n            wait (0.3) seconds\n            show\n            repeat (30)\n                change y by (shark V.)\n                change [shark v. v] by (-1)\n            end\n            hide\n        end\n    else\n        hide\n    end\nend\n\n@fish\n\nwhen flag clicked\nset [brightness v] effect to (0)\nhide\n\nstart sound [Seagulls v]\n\nwhen I receive [fish v]\nrepeat (5)\n    change y by (1)\nend\nrepeat until <(x position) > [257]>\n    repeat (10)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(backdrop [number v]) = [7]> or <(backdrop [number v]) > [7]>> then\n        wait (pick random (1) to (2)) seconds\n        switch costume to (pick random (1) to (4))\n        show\n        set size to (pick random (50) to (70)) %\n        set [ghost v] effect to (pick random (40) to (60))\n        go to x: (-264) y: (pick random (25) to (120))\n        broadcast (fish v)\n        repeat until <(x position) > [250]>\n            change x by (3)\n        end\n        hide\n    end\nend\n\nnext costume\n\n@fish2\n\nwhen flag clicked\nset [brightness v] effect to (0)\nhide\n\nstart sound [Seagulls v]\n\nwhen I receive [fish v]\nrepeat (5)\n    change y by (1)\nend\nrepeat until <(x position) > [257]>\n    repeat (10)\n        change y by (-1)\n    end\n    repeat (10)\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(backdrop [number v]) = [7]> or <(backdrop [number v]) > [7]>> then\n        wait (pick random (1) to (2)) seconds\n        switch costume to (pick random (1) to (4))\n        show\n        set size to (pick random (50) to (70)) %\n        set [ghost v] effect to (pick random (40) to (60))\n        go to x: (260) y: (pick random (25) to (120))\n        broadcast (fish v)\n        repeat until <(x position) < [-250]>\n            change x by (-3)\n        end\n        hide\n    end\nend\n\nnext costume\n\n@cloud \n\nwhen flag clicked\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (330) y: (pick random (50) to (150))\nset [ghost v] effect to (pick random (40) to (70))\nswitch costume to (pick random (1) to (3))\nset size to (pick random (70) to (100)) %\nshow\nrepeat until <(x position) < [-225]>\n    change x by (-25)\nend\ndelete this clone\n\nwhen I receive [play v]\nhide\nforever\n    if <not <<(backdrop [number v]) = [7]> or <(backdrop [number v]) > [7]>>> then\n        wait (pick random (0.5) to (1)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\n@Sprite1\n\nwhen I receive [play v]\nhide\nforever\n    if <<(backdrop [number v]) = [7]> or <(backdrop [number v]) > [7]>> then\n        wait (pick random (0.2) to (0.9)) seconds\n        create clone of (_myself_ v)\n    end\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo to x: (pick random (-200) to (200)) y: (-196)\nset [ghost v] effect to (pick random (5) to (40))\nswitch costume to (pick random (1) to (3))\nset size to (pick random (90) to (110)) %\nshow\nbroadcast (bubble v)\nrepeat until <(y position) > [160]>\n    change y by (3)\nend\nhide\ndelete this clone\n\nwhen I receive [bubble v]\nrepeat (20)\n    change x by (0.5)\nend\nrepeat until <(y position) > [160]>\n    repeat (40)\n        change x by (-0.5)\n    end\n    repeat (40)\n        change x by (0.5)\n    end\nend\nhide\n\nchange y by (1)\n\nchange y by (-0.)\n\nchange y by (1)\n\n@Intro\n\ndefine GlideX (x) GlideY (y) Size: (size) Direction: (direction) Speed: (speed)\nrepeat until <<(round (x position)) = (x)> and <<(round (y position)) = (y)> and <<(round (size)) = (size)> and <(round (direction)) = (direction)>>>>\n    change x by (((x) - (x position)) / (speed))\n    change y by (((y) - (y position)) / (speed))\n    change size by (((size) - (size)) / (speed))\n    turn right (((direction) - (direction)) / (speed)) degrees\nend\n\nwhen I receive [start intro v]\nIntro\n\ndefine Intro\nReset\nwait (1) seconds\nset [clone id v] to [slide]\nrepeat (3)\n    create clone of (_myself_ v)\n    wait (.1) seconds\n    change [brightness v] effect by (5)\nend\nwait (.01) seconds\nset [clone id v] to [logo]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone id v] to [name]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone id v] to [shockwave1]\ncreate clone of (_myself_ v)\nset [clone id v] to [shockwave2]\ncreate clone of (_myself_ v)\nset [clone id v] to [shockwave3]\ncreate clone of (_myself_ v)\nset [clone id v] to [shockwave4]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [clone id v] to [square1]\ncreate clone of (_myself_ v)\nwait (.1) seconds\nset [clone id v] to [square2]\ncreate clone of (_myself_ v)\nwait (.1) seconds\nset [clone id v] to [square1]\ncreate clone of (_myself_ v)\nset [clone id v] to [Circle]\ncreate clone of (_myself_ v)\nwait (3) seconds\nbroadcast (end intro v)\n\nwhen I start as a clone\nif <(Clone ID) = [slide]> then\n    set [ghost v] effect to (0)\n    show\n    switch costume to (slide v)\n    go to x: (0) y: (-360)\n    repeat (18)\n        change x by ((x position) / (-4))\n        change y by ((y position) / (-4))\n    end\nend\n\ndefine Reset\nhide\nclear graphic effects\nset size to (100) %\npoint in direction (90)\ngo to x: (0) y: (0)\nset [i v] to [0]\nset [clone id v] to [0]\nset [direction vel. v] to [0]\nset [y vel. v] to [0]\n\nwhen I start as a clone\nif <(Clone ID) = [logo]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (logo | @rc_legend v)\n    set size to (250) %\n    point in direction (0)\n    set [direction vel. v] to [0]\n    set [y vel. v] to [0]\n    set y to (-500)\n    repeat (100)\n        set [y vel. v] to (((y Vel.) * (.8)) + (((0) - (y position)) / (9)))\n        set [direction vel. v] to (((Direction Vel.) * (.9)) + (((90) - (direction)) / (9)))\n        change y by (y Vel.)\n        turn right (Direction Vel.) degrees\n        change size by (((100) - (size)) / (9))\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [name]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (name | @rc_legend v)\n    set size to (100) %\n    go to x: (0) y: (-360)\n    GlideX [0] GlideY [0] Size: [100] Direction: [90] Speed: [5]\n    wait (1) seconds\n    GlideX [0] GlideY [-70] Size: [100] Direction: [90] Speed: [5]\n    wait (1) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [shockwave1]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (shockwave v)\n    go to x: (0) y: (160)\n    set [color v] effect to (0)\n    set size to (0) %\n    repeat (22)\n        next costume\n        change size by (((300) - (size)) / (9))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (((300) - (size)) / (9))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [shockwave2]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (shockwave v)\n    go to x: (0) y: (-160)\n    set [color v] effect to (0)\n    set size to (0) %\n    repeat (22)\n        next costume\n        change size by (((300) - (size)) / (9))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (((300) - (size)) / (9))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [shockwave3]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (shockwave v)\n    go to x: (160) y: (0)\n    set [color v] effect to (0)\n    set size to (0) %\n    repeat (22)\n        next costume\n        change size by (((300) - (size)) / (9))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (((300) - (size)) / (9))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [shockwave4]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (shockwave v)\n    go to x: (-160) y: (0)\n    set [color v] effect to (0)\n    set size to (0) %\n    repeat (22)\n        next costume\n        change size by (((300) - (size)) / (9))\n    end\n    repeat (10)\n        change [ghost v] effect by (10)\n        change size by (((300) - (size)) / (9))\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [square1]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (square1 v)\n    set size to (1) %\n    go to x: (-240) y: (0)\n    repeat (26)\n        turn right (5) degrees\n        switch costume to (blank v)\n        change size by ((size) / (3.5))\n        switch costume to (square1 v)\n        change x by (((0) - (x position)) / (6))\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [square2]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (square2 v)\n    set size to (1) %\n    go to x: (-240) y: (0)\n    repeat (26)\n        turn right (5) degrees\n        switch costume to (blank v)\n        change size by ((size) / (3.5))\n        switch costume to (square2 v)\n        change x by (((0) - (x position)) / (6))\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Circle]> then\n    set [brightness v] effect to (0)\n    show\n    switch costume to (circle v)\n    set size to (100) %\n    go to x: (0) y: (-300)\n    set [ball size v] to [20]\n    repeat (30)\n        change y by (Ball Size)\n        change [ball size v] by (-1)\n    end\n    set [ball size v] to [1200]\n    repeat (12)\n        switch costume to (blank v)\n        change size by (Ball Size)\n        change [ball size v] by (-100)\n        switch costume to (circle v)\n    end\nend\n\nwhen I receive [end intro v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (1) seconds\nforever\n    delete this clone\nend\n\nwhen flag clicked\nbroadcast (Start Intro v)\ngo to [front v] layer\n\nwhen I receive [end intro v]\nbroadcast (play v)\n\n@TN\n\nwhen flag clicked\nwait (1.5) seconds\ngo to x: (5) y: (-10)\nhide\n\ngo to [front v] layer\ngo to x: (5) y: (-10)\nshow\n\n@End\n\nwhen flag clicked\ngo to x: (4) y: (-45)\nset [ghost v] effect to (100)\nhide\n\nwhen I receive [win v]\nshow\ngo to [front v] layer\nfade in\nforever\n    go to [front v] layer\n    go to x: ((mouse x) / (30)) y: ((mouse y) / (30))\nend\n\ndefine fade in\nrepeat (4)\n    change [ghost v] effect by (-25)\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [end intro v]\nshow\n\nwhen this sprite clicked\nbroadcast (next level v)\n\n