Split Screen | Platformer | 2.0


@Stage\n\nwhen I receive [next level v]\nset [done? v] to [no]\nnext backdrop\n\nwhen I receive [button pressed v]\nif <not <(letter (1) of (backdrop [name v])) = [2]>> then\n    next costume\nend\n\nwhen I receive [death v]\nrepeat until <(letter (1) of (backdrop [name v])) = [L]>\n    switch backdrop to ((backdrop [number v]) - (1))\nend\n\nwhen I receive [full v]\nswitch backdrop to (blank v)\n\nwhen flag clicked\nset volume to (50) %\nswitch backdrop to (level1 v)\nforever\n    play sound [bensound-photoalbum.mp3 v] until done\n    wait (0.2) seconds\nend\n\nwhen [m v] key pressed\nif <(volume) = [0]> then\n    set volume to (50) %\nelse\n    set volume to (0) %\nend\n\n@Intro\n\nwhen I start as a clone\nset [ghost v] effect to (0)\ngo to [front v] layer\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nwait (2) seconds\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nwait (0.5) seconds\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [go v] to [yes]\nwait until <key (space v) pressed?>\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (1) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nwait (1) seconds\ndelete this clone\n\nwhen flag clicked\nset [switch v] to [no]\nset [go v] to [0]\nshow\nswitch costume to (black v)\ncreate clone of (_myself_ v)\nswitch costume to (ssthumbnail v)\nwait (5) seconds\nswitch costume to (logo v)\nwait (1) seconds\nrepeat (10)\n    next costume\nend\nwait (1.8) seconds\nswitch costume to (intro v)\nwait until <(go) = [yes]>\nwait until <key (space v) pressed?>\nwait (1) seconds\nhide\nwait (2) seconds\nset [switch v] to [yes]\nswitch costume to (black v)\nreset timer\nbroadcast (start v)\n\n@Player1\n\ndefine Fall down\nchange y by (yVelocity)\nset [canjump v] to [no]\nif <touching (ground v)?> then\n    if <(yVelocity) > [0]> then\n        repeat until <not <touching (ground v)?>>\n            change y by (-1)\n        end\n        set [yvelocity v] to (join [-] (yVelocity))\n    else\n        repeat until <not <touching (ground v)?>>\n            change y by (1)\n        end\n        change y by (-1)\n        set [yvelocity v] to [0]\n        set [canjump v] to [yes]\n    end\nend\n\ndefine None\npoint in direction (dirrection)\nmove (5) steps\nset [slopesteepness v] to [0]\nrepeat until <<not <touching (ground v)?>> or <(slopeSteepness) = [8]>>\n    change y by (1)\n    change [slopesteepness v] by (1)\nend\nif <[8] = (slopeSteepness)> then\n    move (-5) steps\n    change y by (join [-] (slopeSteepness))\nend\n\nwhen flag clicked\nforever\n    if <(whatDoing) = [Walking]> then\n        set [costume v] to [3]\n    else\n        if <(whatDoing) = [Jumping]> then\n            set [costume v] to [4]\n        end\n    end\n    if <(whatDoing) = [Standing]> then\n        set [costume v] to [2]\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-206) y: (-171)\n\nwhen I receive [death v]\ngo to x: (-206) y: (-171)\n\nwhen I receive [end v]\ngo to x: ([x position v] of [player2 v]) y: (-171)\nswitch costume to (still v)\nstop [other scripts in sprite v]\nwait (3.5) seconds\nhide\n\nwhen I receive [start v]\nset size to (75) %\nwait (0.3) seconds\ngo to x: (-206) y: (-171)\nshow\nwait (0.1) seconds\nset [yvelocity v] to [0]\nforever\n    switch costume to (hitbox v)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        Walk | Dirrection (90)\n        set [whatdoing v] to [Walking]\n    else\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            Walk | Dirrection (-90)\n            set [whatdoing v] to [Walking]\n        else\n            if <touching (ground v)?> then\n                set [whatdoing v] to [Standing]\n            else\n                set [whatdoing v] to [Jumping]\n            end\n        end\n    end\n    if <not <touching (ground v)?>> then\n        if <(yVelocity) = [0]> then\n            set [yvelocity v] to [-2]\n        end\n        if <not <(yVelocity) = [0]>> then\n            change [yvelocity v] by (-1)\n            Fall down\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(canJump) = [yes]>> then\n        if <(yVelocity) = [0]> then\n            change y by (1)\n            set [yvelocity v] to [12]\n        end\n        if <not <(yVelocity) = [0]>> then\n            change [yvelocity v] by (-1)\n            Fall down\n        end\n    end\n    if <touching color (#ff0000)?> then\n        if <(done?) = [White]> then\n            broadcast (next level v)\n        else\n            set [done? v] to [Black]\n        end\n    end\n    if <touching color (#870101)?> then\n        broadcast (button pressed v)\n        switch costume to (still v)\n        wait (0.01) seconds\n    end\n    if <touching color (#003fff)?> then\n        broadcast (death v)\n    end\n    switch costume to (costume)\nend\n\nwhen flag clicked\nhide\n\n@Player2\n\ndefine Walk | Dirrection (dirrection)\npoint in direction (dirrection)\nmove (5) steps\nset [slopesteepness v] to [0]\nrepeat until <<not <touching (ground v)?>> or <(slopeSteepness) = [8]>>\n    change y by (1)\n    change [slopesteepness v] by (1)\nend\nif <[8] = (slopeSteepness)> then\n    move (-5) steps\n    change y by (join [-] (slopeSteepness))\nend\n\nwhen flag clicked\nforever\n    if <(whatDoing) = [Walking]> then\n        set [costume v] to [3]\n    else\n        if <(whatDoing) = [Jumping]> then\n            set [costume v] to [4]\n        end\n    end\n    if <(whatDoing) = [Standing]> then\n        set [costume v] to [2]\n    end\nend\n\ndefine Fall down\nchange y by (yVelocity)\nif <touching (ground v)?> then\n    if <touching color (#001966)?> then\n        broadcast (button pressed v)\n        switch costume to (still v)\n        wait (0.01) seconds\n    end\n    if <(yVelocity) > [0]> then\n        repeat until <not <touching (ground v)?>>\n            change y by (-1)\n        end\n        set [yvelocity v] to (join [-] (yVelocity))\n    else\n        repeat until <not <touching (ground v)?>>\n            change y by (1)\n        end\n        change y by (-1)\n        set [yvelocity v] to [0]\n        set [timer v] to (timer)\n        set [canjump v] to [yes]\n    end\nend\n\nwhen I receive [death v]\ngo to x: (-205) y: (10)\n\nwhen I receive [next level v]\ngo to x: (-205) y: (10)\n\ndefine slow fall\nstop [other scripts in sprite v]\n\nwhen flag clicked\nset [end v] to [no]\nhide\n\nwhen [space v] key pressed\nif <(end) = [yes]> then\n    set [end v] to [no]\n    next costume\n    broadcast (end2 v)\nend\n\nwhen I receive [start v]\nswitch costume to (still v)\nwait (0.3) seconds\ngo to x: (-205) y: (10)\nshow\nwait (0.1) seconds\nset [yvelocity v] to [0]\nset size to (75) %\nforever\n    switch costume to (hitbox v)\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        Walk | Dirrection (90)\n        set [whatdoing v] to [Walking]\n    else\n        if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n            Walk | Dirrection (-90)\n            set [whatdoing v] to [Walking]\n        else\n            if <touching (ground v)?> then\n                set [whatdoing v] to [Standing]\n            else\n                set [whatdoing v] to [Jumping]\n            end\n        end\n    end\n    if <not <touching (ground v)?>> then\n        if <(yVelocity) = [0]> then\n            set [yvelocity v] to [-2]\n        end\n        if <not <(yVelocity) = [0]>> then\n            change [yvelocity v] by (-1)\n            Fall down\n        end\n    end\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <(canJump) = [yes]>> then\n        reset timer\n        set [timer v] to [1]\n        set [canjump v] to [no]\n        if <(yVelocity) = [0]> then\n            change y by (1)\n            set [yvelocity v] to [12]\n        end\n        if <not <(yVelocity) = [0]>> then\n            change [yvelocity v] by (-1)\n            Fall down\n        end\n    end\n    if <touching color (#003fff)?> then\n        if <(done?) = [Black]> then\n            broadcast (next level v)\n        else\n            set [done? v] to [White]\n        end\n    end\n    if <touching color (#001966)?> then\n        broadcast (button pressed v)\n        switch costume to (still v)\n        wait (0.01) seconds\n    end\n    if <touching color (#ff0000)?> then\n        broadcast (death v)\n    end\n    if <(y position) < [8]> then\n        switch costume to (still v)\n        broadcast (end v)\n        set [yvelocity v] to [-9]\n        repeat until <touching (player1 v)?>\n            change y by (yVelocity)\n            set [yvelocity v] to ((yVelocity) * (0.943))\n        end\n        repeat until <(y position) < [-170]>\n            change y by (yVelocity)\n        end\n        wait (1) seconds\n        switch costume to (cloud v)\n        wait (2.5) seconds\n        switch costume to (still2 v)\n        set y to (-171)\n        wait (2) seconds\n        broadcast (full v)\n        point in direction (90)\n        set size to (1000) %\n        go to x: (0) y: (-275)\n        wait (2) seconds\n        repeat (2)\n            next costume\n            wait (0.5) seconds\n            switch costume to ((costume [number v]) - (1))\n            wait (2) seconds\n        end\n        switch costume to (still4 v)\n        wait (1) seconds\n        set size to (100) %\n        switch costume to (end v)\n        go to x: (0) y: (0)\n        set [end v] to [yes]\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\n    switch costume to (costume)\nend\n\n@Ground\n\nwhen flag clicked\nshow\nswitch costume to (level1 v)\nforever\n    switch costume to (backdrop [number v])\nend\n\nwhen I receive [full v]\nhide\n\nstop [other scripts in sprite v]\n\n@Letters\n\nwhen I start as a clone\nwait until <(done?) = [yes]>\ndelete this clone\n\ndefine None\nset size to (size) %\nshow\nset [ghost v] effect to (0)\nset [letter v] to (words)\nset [counter text v] to [1]\ngo to x: (-150) y: (ypos)\nrepeat (length of (letter))\n    switch costume to ( 2 v)\n    switch costume to (letter (counter text) of (letter))\n    if <(costume [number v]) = [1]> then\n        switch costume to (join (letter (counter text) of (letter)) [2])\n    end\n    create clone of (_myself_ v)\n    change [counter text v] by (1)\n    change x by ((size) * (1.4))\nend\nhide\n\ndefine None\nset [characterlist v] to [ abcdefghijklmnopqrstuvwxyz-_01234567890]\nset [counter v] to [1]\nset [smallcounter v] to [1]\nset [numbercode v] to []\nrepeat (length of (namex))\n    repeat until <(smallCounter) = [0]>\n        if <(letter (Counter) of (namex)) = (letter (smallCounter) of (characterList))> then\n            if <(smallCounter) < [10]> then\n                set [smallcounter v] to (join [0] (smallCounter))\n            end\n            set [numbercode v] to (join (NumberCode) (smallCounter))\n            set [smallcounter v] to [0]\n        else\n            change [smallcounter v] by (1)\n        end\n    end\n    change [counter v] by (1)\n    set [smallcounter v] to [1]\nend\n\ndefine Code to name1\nset [characterlist v] to [ abcdefghijklmnopqrstuvwxyz-_01234567890]\nset [counter v] to [1]\nset [name1 v] to []\nrepeat (length of ((☁ Name1) / (2)))\n    set [name1 v] to (join (Name1) (letter (join (letter (Counter) of (☁ Name1)) (letter ((Counter) + (1)) of (☁ Name1))) of (characterList)))\n    change [counter v] by (2)\nend\n\nwhen I receive [start v]\nset [time v] to [0]\nforever\n    wait (1) seconds\n    change [time v] by (1)\nend\n\nwhen I receive [end2 v]\nif <(stop) = [no]> then\n    set [stop v] to [yes]\n    set [username v] to (username)\n    if <(time) < (☁ Highscore1)> then\n        set [name3 v] to (Name2)\n        set [name2 v] to (Name1)\n        set [name1 v] to (username)\n        set [☁ highscore3 v] to (☁ Highscore2)\n        set [☁ highscore2 v] to (☁ Highscore1)\n        set [☁ highscore1 v] to (time)\n        Name to code (Name1)\n        set [☁ name1 v] to (NumberCode)\n        Name to code (Name2)\n        set [☁ name2 v] to (NumberCode)\n        Name to code (Name3)\n        set [☁ name3 v] to (NumberCode)\n    else\n        if <(time) < (☁ Highscore2)> then\n            set [name3 v] to (Name2)\n            set [name2 v] to (username)\n            set [☁ highscore3 v] to (☁ Highscore2)\n            set [☁ highscore2 v] to (time)\n            Name to code (Name2)\n            set [☁ name2 v] to (NumberCode)\n            Name to code (Name3)\n            set [☁ name3 v] to (NumberCode)\n        else\n            if <(time) < (☁ Highscore3)> then\n                set [name3 v] to (username)\n                set [☁ highscore3 v] to (time)\n                Name to code (Name3)\n                set [☁ name3 v] to (NumberCode)\n            end\n        end\n    end\n    Code to name1\n    Code to name2\n    Code to name3\n    set [done? v] to [yes]\n    wait (0.1) seconds\n    set [done? v] to [no]\n    Write (time) (60) (20)\n    Write (join (☁ Highscore1) (join [ by ] (Name1))) (-25) (10)\n    Write (join (☁ Highscore2) (join [ by ] (Name2))) (-55) (10)\n    Write (join (☁ Highscore3) (join [ by ] (Name3))) (-85) (10)\nend\n\ndefine Code to name2\nset [characterlist v] to [ abcdefghijklmnopqrstuvwxyz-_01234567890]\nset [counter v] to [1]\nset [name2 v] to []\nrepeat (length of ((☁ Name2) / (2)))\n    set [name2 v] to (join (Name2) (letter (join (letter (Counter) of (☁ Name2)) (letter ((Counter) + (1)) of (☁ Name2))) of (characterList)))\n    change [counter v] by (2)\nend\n\nset [name1 v] to [name]\nset [name2 v] to [name]\nset [name3 v] to [name]\nName to code (Name1)\nset [☁ name1 v] to (NumberCode)\nName to code (Name2)\nset [☁ name2 v] to (NumberCode)\nName to code (Name3)\nset [☁ name3 v] to (NumberCode)\nset [☁ highscore1 v] to [99999]\nset [☁ highscore2 v] to [99999]\nset [☁ highscore3 v] to [99999]\nCode to name1\nCode to name2\nCode to name3\n\ndefine Code to name3\nset [characterlist v] to [ abcdefghijklmnopqrstuvwxyz-_01234567890]\nset [counter v] to [1]\nset [name3 v] to []\nrepeat (length of ((☁ Name3) / (2)))\n    set [name3 v] to (join (Name3) (letter (join (letter (Counter) of (☁ Name3)) (letter ((Counter) + (1)) of (☁ Name3))) of (characterList)))\n    change [counter v] by (2)\nend\n\nset [time v] to [9999999]\n\nwhen flag clicked\nset [stop v] to [no]\n\nstop [all v]\n\n