Darkside || A Platformer


@Stage\n\nwhen I receive [end v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (3) seconds\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nswitch backdrop to (out v)\nwait (2) seconds\nbroadcast (endend v)\n\nwhen I receive [start v]\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (1) seconds\nswitch backdrop to (in1 v)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (4) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (1) seconds\nswitch backdrop to (in2 v)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (4) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (1) seconds\nswitch backdrop to (in3 v)\nrepeat (10)\n    change [brightness v] effect by (10)\nend\nwait (4) seconds\nrepeat (10)\n    change [brightness v] effect by (-10)\nend\nwait (2) seconds\nbroadcast (play v)\nclear graphic effects\nswitch backdrop to (2 v)\n\n@player\n\ndefine touching ground <g>\nrepeat until <not <touching color (#999999)?>>\n    change y by (1)\n    set [y v] to [1]\nend\n\nwhen I receive [tick v]\nchange [y v] by (-1)\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [x v] by (-0.6)\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [x v] by (0.6)\nend\nset [x v] to ((x) * (0.9))\nchange x by (x)\nif <touching color (#999999)?> then\n    change y by (1)\nend\nif <touching color (#999999)?> then\n    change y by (1)\nend\nif <touching color (#999999)?> then\n    change y by (1)\nend\nif <touching color (#999999)?> then\n    change y by (1)\nend\nif <<touching color (#fffa91)?> or <touching color (#ffe091)?>> then\n    set [y v] to [20]\nend\nset [touching wall v] to [0]\nif <touching color (#999999)?> then\n    set [touching wall v] to [1]\n    change y by (-4)\n    change x by ((x) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [y v] to [10]\n        if <([abs v] of (x) ) = (x)> then\n            set [x v] to [-5]\n        else\n            set [x v] to [5]\n        end\n    else\n        set [x v] to [0]\n    end\nend\nchange y by (y)\nif <touching color (#999999)?> then\n    change y by ((0) - (y))\n    set [y v] to [1]\nend\nchange y by (-1)\nif <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching color (#999999)?>> then\n    set [y v] to [13]\nend\nchange y by (1)\nif <(y position) > [180]> then\n    set [y v] to [0]\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nerase all\n\nwhen I receive [tick v]\nif <<touching color (#ff8d8d)?> or <touching color (#ffba8c)?>> then\n    go to x: (-215) y: (-50)\nend\nif <<touching color (#92f2ff)?> or <touching color (#91d4ff)?>> then\n    change x by (10)\nend\nif <touching (figur4 v)?> then\n    change [level v] by (1)\n    next backdrop\n    go to x: (-215) y: (-50)\nend\nif <(Level) = [21]> then\n    hide\n    broadcast (end v)\n    stop [other scripts in sprite v]\nend\n\nwhen I receive [play v]\nswitch costume to (kostüm2 v)\nset [ghost v] effect to (0)\nshow\ngo to x: (-215) y: (-50)\nset [level v] to [1]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nforever\n    broadcast (TICK v)\nend\n\nif <(y) = (([abs v] of (y) ) * (-1))> then\n    change y by (-1)\n    set [y v] to [-1]\nend\n\n@loading\n\nwhen flag clicked\nforever\n    turn right (10) degrees\nend\n\nwhen flag clicked\nset size to (50) %\nrepeat (10)\n    change size by (5)\nend\n\nwhen flag clicked\nwait (5) seconds\nswitch backdrop to (bühnenbild2 v)\nset [ghost v] effect to (50)\nrepeat (10)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nswitch backdrop to (bühnenbild2 v)\nset [ghost v] effect to (50)\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\n\n@Figur2\n\nwhen flag clicked\nset volume to (100) %\nswitch costume to (kostüm1 v)\n\nwhen this sprite clicked\nnext costume\nchange volume by (-49)\nwait (1) seconds\nif <(volume) < [1]> then\n    set volume to (100) %\nend\n\nwhen flag clicked\nforever\n    play sound [Main Title v] until done\nend\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\nhide\nwait (6.5) seconds\nshow\nset size to (90) %\nrepeat (10)\n    change size by (1)\nend\nrepeat (10)\n    change size by (1)\nend\nrepeat (10)\n    change size by (-1)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (10)\n            change size by (2)\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n        repeat (10)\n            change size by (-2)\n        end\n        repeat (5)\n            change size by (2)\n        end\n        repeat (5)\n            change size by (-2)\n        end\n    end\nend\n\nwhen flag clicked\nwait (6.5) seconds\nswitch backdrop to (bühnenbild2 v)\nset [ghost v] effect to (50)\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\n\n@Figur3\n\nwhen this sprite clicked\nrepeat (7)\n    change y by (3)\nend\nrepeat (4)\n    change y by (1)\nend\nrepeat (30)\n    change y by (-8)\nend\nset y to (-108)\nwait (1) seconds\nbroadcast (start v)\n\nwhen flag clicked\nforever\n    if <(y position) < [-200]> then\n        hide\n    end\nend\n\nwhen flag clicked\nwait (6) seconds\nswitch backdrop to (bühnenbild2 v)\nset [ghost v] effect to (50)\nrepeat (10)\n    change [ghost v] effect by (-5)\nend\n\nwhen flag clicked\ngo to x: (62) y: (-124)\nhide\nwait (6) seconds\nshow\nset size to (130) %\nrepeat (10)\n    change size by (-1)\nend\nrepeat (10)\n    change size by (-1)\nend\nrepeat (10)\n    change size by (1)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        repeat (10)\n            change size by (-2)\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n        repeat (10)\n            change size by (2)\n        end\n        repeat (5)\n            change size by (-2)\n        end\n        repeat (5)\n            change size by (2)\n        end\n    end\nend\n\n@Figur4\n\nwhen flag clicked\ngo to x: (220) y: (-54)\npoint in direction (90)\nhide\nforever\n    repeat (20)\n        turn right (-2.5) degrees\n    end\n    repeat (20)\n        turn right (2.5) degrees\n    end\n    repeat (20)\n        turn right (2.5) degrees\n    end\n    repeat (20)\n        turn right (-2.5) degrees\n    end\nend\n\nwhen flag clicked\nset size to (100) %\nforever\n    repeat (10)\n        change size by (1)\n    end\n    repeat (10)\n        change size by (-1)\n    end\n    repeat (10)\n        change size by (-1)\n    end\n    repeat (10)\n        change size by (1)\n    end\nend\n\nwhen I receive [play v]\nshow\nwait until <(Level) = [6]>\ngo to x: (221) y: (114)\nwait until <(Level) = [7]>\ngo to x: (221) y: (146)\nwait until <(Level) = [8]>\ngo to x: (220) y: (-54)\n\nwhen I receive [end v]\nhide\n\n@Figur5\n\n@Figur6\n\nwhen flag clicked\nset [level v] to [0]\nhide\nwait until <(Level) = [17]>\nswitch costume to (kostüm1 v)\nshow\nrepeat until <(Level) = [18]>\n    go to x: (36) y: (28)\n    repeat (40)\n        if <(Level) = [17]> then\n            change y by (5)\n        else\n            hide\n            stop [this script v]\n        end\n    end\n    repeat (40)\n        if <(Level) = [17]> then\n            change y by (-5)\n        else\n            hide\n            stop [this script v]\n        end\n    end\nend\nhide\nstop [this script v]\n\nwhen flag clicked\nset [level v] to [0]\nhide\nwait until <(Level) = [18]>\nswitch costume to (kostüm2 v)\nshow\nrepeat until <(Level) = [19]>\n    go to x: (36) y: (28)\n    repeat (20)\n        if <(Level) = [18]> then\n            change y by (2.5)\n        else\n            hide\n            stop [this script v]\n        end\n    end\n    wait (1) seconds\n    repeat (20)\n        if <(Level) = [18]> then\n            change y by (-2.5)\n        else\n            hide\n            stop [this script v]\n        end\n    end\n    wait (1) seconds\nend\nhide\nstop [this script v]\n\nwhen backdrop switches to [19 v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\n@Figur7\n\nwhen flag clicked\nhide\nwait until <(Level) = [18]>\nshow\nwait until <(Level) = [19]>\nhide\n\n@Figur8\n\nwhen flag clicked\nhide\n\nwhen I receive [endend v]\nswitch costume to (kostüm1 v)\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (3) seconds\nstamp\nset [ghost v] effect to (100)\nswitch costume to (kostüm2 v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nstop [all v]\n\n@Figur1\n\nwhen flag clicked\nwait (5) seconds\nswitch backdrop to (bühnenbild2 v)\nset [ghost v] effect to (50)\nrepeat (10)\n    change [ghost v] effect by (5)\nend\nhide\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nswitch backdrop to (bühnenbild2 v)\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-8)\nend\n\n@TimMcCool2\n\nwhen flag clicked\nset [ghost v] effect to (80)\nhide\n\n@//📊 Scratch Analytics by @TimMcCool3\n\ndefine Send Data (payload)\nset [☁ to_host v] to (payload)\n\ndefine Encode (input)\nset [//output v] to []\nset [//i v] to [0]\nrepeat (length of (input))\n    change [//i v] by (1)\n    switch costume to (join [=] (letter (//i) of (input)))\n    set [//output v] to (join (//output) (costume [number v]))\nend\n\nwhen flag clicked\nwait (0.6) seconds\nEncode (join (username) (join [,] (join (current [hour v]) (join [,] []))))\nSend Data (//output)\n\n