Stranded | Platformer | Collab!

Instructions: Collab between @Jbone_for_president and @Jranknom  \n\nw-a-d or arrow keys to move | avoid spikes | avoid lava | can climb walls | get to the end | press "R" to reset/restart |\n\nIt's been a while since I have made a game so I thought it would be great to make a game with one of my great friends on scratch. This is what we made!\n

@Stage\n\nwhen flag clicked\nwait (13) seconds\nforever\n    play sound [Alan Walker - Force v] until done\nend\n\n@Blank\n\n@Player\n\ndefine Position\ngo to x: (x) y: (y)\n\ndefine Game On\nset [sx v] to [0]\nset [x v] to [-222]\nset [y v] to [-104]\nset [sy v] to [0]\nset [in air v] to [0]\nset [finish v] to []\npoint in direction (90)\nshow\n\ndefine Movement\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    point in direction (-90)\n    change [sx v] by (-1.2)\n    switch costume to (Walk)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    point in direction (90)\n    change [sx v] by (1.2)\n    switch costume to (Walk)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [13]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nDie\nPosition\nif <<touching (flag v)?> and <not <(Level) = [21]>>> then\n    start sound [Connect v]\n    set [finish v] to [Yes]\nend\nif <not <key (any v) pressed?>> then\n    switch costume to (stand v)\nend\n\nwhen I receive [start v]\ngo to [front v] layer\nset [level v] to [1]\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game On\n    repeat until <(Finish) > []>\n        Movement\n    end\n    if <(Finish) = [Yes]> then\n        Game Con\n    else\n        Game End\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game End\nset [finish v] to []\nswitch costume to (die v)\nrepeat (5)\n    next costume\n    wait (0.05) seconds\nend\nwait (0.5) seconds\n\ndefine Die\nif <touching (danger v)?> then\n    set [finish v] to [No]\nend\nif <touching (danger2 v)?> then\n    set [finish v] to [No]\nend\nif <key (r v) pressed?> then\n    set [finish v] to [No]\nend\n\ndefine Game Con\nchange [level v] by (1)\nbroadcast (Text v)\n\nwhen I receive [start v]\nset [walk v] to [1]\nforever\n    if <key (any v) pressed?> then\n        change [walk v] by (1)\n    end\n    if <(Walk) > [8]> then\n        set [walk v] to [1]\n    end\nend\n\nwhen I receive [start v]\n\ngo to [front v] layer\n\nwhen flag clicked\nbroadcast (Text v)\nforever\n    if <(x) < [-239]> then\n        set [x v] to [-239]\n    end\n    if <(x) > [234]> then\n        set [finish v] to [Yes]\n    end\nend\n\n@Platform\n\nwhen I receive [start v]\nshow\nforever\n    if <(Level) = [20]> then\n        stop [other scripts in sprite v]\n    else\n        go to x: (0) y: (0)\n        switch costume to (Level)\n    end\nend\n\nwhen flag clicked\nbroadcast (Start v)\nswitch costume to (1 v)\n\n@Danger\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Background\n\nwhen I receive [start v]\nshow\nforever\n    go to [back v] layer\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Danger2\n\nwhen I receive [start v]\nshow\nset y to (-26)\nforever\n    repeat (50)\n        change y by (0.3)\n    end\n    wait (.2) seconds\n    repeat (50)\n        change y by (-0.3)\n    end\n    wait (.2) seconds\nend\n\nwhen I receive [start v]\n\nforever\n\nwhen flag clicked\nforever\n    if <(Level) = [12]> then\n        show\n    else\n        hide\n    end\n    if <(Level) = [14]> then\n        show\n    else\n        if <(Level) = [12]> then\n            show\n        else\n            hide\n        end\n    end\nend\n\n@Helper\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen I receive [text v]\nhide\nset [ghost v] effect to (100)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nhide\n\n@Sprite1\n\nwhen flag clicked\nshow\nwait (2) seconds\nhide\n\n@Intro by derpmii\n\nwhen I start as a clone\nif <(IntroSprite) = [Square]> then\n    go [backward v] (8) layers\n    set size to (100) %\n    show\n    if <(y position) > [0]> then\n        set y to (1000)\n        repeat (30)\n            change y by (((125) - (y position)) / (5))\n        end\n    else\n        set y to (-1000)\n        repeat (30)\n            change y by (((-125) - (y position)) / (5))\n        end\n    end\n    repeat (20)\n        change size by (((size) - (101)) / (5))\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen I receive [intro v]\nstart sound [yugi boi - want you w DILIP & KEV v]\nwait until <(IntroEnd) = [1]>\nrepeat (100)\n    change volume by (-1)\nend\n\nwhen flag clicked\nset volume to (100) %\nset [introdrop v] to [0]\nset [introend v] to [0]\nhide\nbroadcast (Intro v)\n\nwhen I start as a clone\nswitch costume to (IntroSprite)\n\nwhen I receive [intro v]\nset [introspritetype v] to [Background]\nset [introsprite v] to [Background1]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [Background2]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [Background3]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introspritetype v] to [Logo]\nset [introsprite v] to [LogoBack1]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [LogoBack2]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [LogoBack3]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [LogoBack4]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [LogoBack5]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [LogoBack6]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [Shadow]\ncreate clone of (_myself_ v)\nwait (1) seconds\n\nwhen I start as a clone\nif <(IntroSprite) = [Background1]> then\n    go to x: (0) y: (1000)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Background2]> then\n    go to x: (0) y: (-1000)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Background3]> then\n    go to x: (0) y: (-1000)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif < (IntroSprite) contains [LogoBack]?> then\n    go to x: (0) y: (-1000)\n    point in direction (90)\n    set [ghost v] effect to (100)\n    set size to (80) %\n    show\n    repeat (30)\n        change [ghost v] effect by (-10)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Shadow]> then\n    go [backward v] (6) layers\n    go to x: (0) y: (0)\n    point in direction (90)\n    set [brightness v] effect to (-100)\n    set [ghost v] effect to (50)\n    set size to (80) %\n    show\n    repeat (30)\n        change y by (((-20) - (y position)) / (5))\n        change x by (((-20) - (x position)) / (5))\n    end\nend\n\nwhen I receive [intro v]\nwait (4.5) seconds\nset [introdrop v] to [1]\nset [introsprite v] to [LogoJ]\ncreate clone of (_myself_ v)\nwait (0.01) seconds\nset [introspritetype v] to [Square]\nset [introsprite v] to [Square]\ngo to x: (-180) y: (125)\nrepeat (5)\n    create clone of (_myself_ v)\n    change x by (90)\n    wait (0.01) seconds\nend\ngo to x: (-180) y: (-125)\nrepeat (5)\n    create clone of (_myself_ v)\n    change x by (90)\n    wait (0.01) seconds\nend\nwait (2) seconds\nset [introspritetype v] to [Top/Bottom]\nset [introsprite v] to [Top]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [Bottom]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [Name]\ncreate clone of (_myself_ v)\nwait (0.4) seconds\nset [introsprite v] to [Presents]\ncreate clone of (_myself_ v)\nwait (1) seconds\nset [introspritetype v] to [End]\nset [introsprite v] to [End]\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(IntroSprite) = [LogoJ]> then\n    go to x: (0) y: (0)\n    point in direction (0)\n    set [ghost v] effect to (0)\n    set size to (10000) %\n    show\n    repeat (40)\n        set [introsize1 v] to (((IntroSize1) * (0.6)) + (((80) - (size)) / (8)))\n        change size by (IntroSize1)\n        set [introsize2 v] to (((IntroSize2) * (0.6)) + (((90) - (direction)) / (8)))\n        turn right (IntroSize2) degrees\n    end\nend\n\nwhen I start as a clone\nif <(IntroSpriteType) = [Logo]> then\n    if <(IntroSprite) = [Shadow]> then\n        wait until <(IntroDrop) = [1]>\n        forever\n            set y to ((-20) + (([sin v] of ((timer) * (200)) ) * (-10)))\n        end\n    else\n        wait until <(IntroDrop) = [1]>\n        forever\n            set y to ((0) + (([sin v] of ((timer) * (200)) ) * (-10)))\n        end\n    end\nend\n\nwhen I start as a clone\nif <not <(IntroSpriteType) = [End]>> then\n    wait until <(IntroEnd) = [1]>\n    delete this clone\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [End]> then\n    go to x: (-1000) y: (-1000)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (50)\n        change y by (((0) - (y position)) / (5))\n        change x by (((0) - (x position)) / (5))\n    end\n    set [introend v] to [1]\n    wait (1) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(IntroSpriteType) = [Background]> then\n    wait until <(IntroDrop) = [1]>\n    set [brightness v] effect to (50)\n    repeat (25)\n        change [brightness v] effect by (-2)\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Top]> then\n    go to x: (0) y: (1000)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Bottom]> then\n    go to x: (0) y: (-1000)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change y by (((0) - (y position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Name]> then\n    go to x: (-1000) y: (100)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change x by (((0) - (x position)) / (5))\n    end\nend\n\nwhen I start as a clone\nif <(IntroSprite) = [Presents]> then\n    go to x: (1000) y: (-100)\n    point in direction (90)\n    set [ghost v] effect to (0)\n    set size to (100) %\n    show\n    repeat (30)\n        change x by (((0) - (x position)) / (5))\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\n