||#8 ☆ごく普通のPLATFORMER☆/☆Very ordinary platformer


@Stage\n\nwhen I receive [start v]\nif <(level) = [2]> then\n    wait (1) seconds\n    wait until <(scroll x) > [6140]>\n    broadcast (levelfin v)\nend\n\nwhen flag clicked\nswitch backdrop to (desert v)\nforever\n    play sound [10000 Pounds of Sunshine \(by EternalSushi\) v] until done\nend\n\nwhen I receive [play v]\nstop [other scripts in sprite v]\nstop all sounds\nforever\n    play sound [the piano moosic v] until done\nend\n\nwhen I receive [levelfin v]\nstop [other scripts in sprite v]\nstop all sounds\nplay sound [YOU WON! v] until done\n\n@cacti\n\nwhen I receive [start v]\nhide\n\nwhen I start as a clone\ngo to [back v] layer\ngo to [back v] layer\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [2]> then\n    switch costume to (level 0 0 v)\n    New platform at ((470) * (3)) [0]\n    New platform at ((470) * (3)) [0]\n    New platform at ((470) * (4)) [0]\n    New platform at ((470) * (6)) [0]\n    New platform at ((470) * (7)) [0]\n    New platform at ((470) * (8)) [400]\n    New platform at ((470) * (11)) [400]\n    New platform at ((470) * (12)) [800]\n    New platform at ((470) * (13)) [800]\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine New platform at (x) (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [green flag v]\nhide\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [lag v]\nstop [other scripts in sprite v]\n\n@Danger\n\nNew platform at ((470) * (10)) [0]\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I start as a clone\ngo to [back v] layer\ngo to [back v] layer\n\nwhen I receive [start v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [2]> then\n    switch costume to (level 0 0 v)\n    New platform at [-470] [0]\n    New platform at [-470] [0]\n    New platform at [0] [0]\n    New platform at [470] [0]\n    New platform at ((470) * (2)) [0]\n    New platform at ((470) * (4)) [0]\n    New platform at ((470) * (5)) [0]\n    New platform at ((470) * (6)) [0]\n    New platform at ((470) * (7)) [0]\n    New platform at ((470) * (8)) [0]\n    New platform at ((470) * (9)) [0]\n    New platform at ((470) * (8)) [400]\n    New platform at ((470) * (10)) [400]\n    New platform at ((470) * (11)) [400]\n    New platform at ((470) * (12)) [400]\n    New platform at ((470) * (13)) [400]\n    New platform at ((470) * (13)) [800]\n    New platform at ((470) * (17)) [800]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine New platform at (x) (y)\ncreate clone of (_myself_ v)\nnext costume\nset [x v] to (x)\nset [y v] to (y)\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen flag clicked\nhide\n\nwhen I receive [lag v]\nstop [other scripts in sprite v]\n\n@Platforms\n\nwhen I start as a clone\ngo to [front v] layer\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [start v]\nhide\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [2]> then\n    switch costume to (level 0 0 v)\n    New platform at [-470] [0]\n    New platform at [0] [0]\n    New platform at [470] [0]\n    New platform at ((470) * (2)) [0]\n    New platform at ((470) * (3)) [0]\n    New platform at ((470) * (4)) [0]\n    New platform at ((470) * (5)) [0]\n    New platform at ((470) * (6)) [0]\n    New platform at ((470) * (7)) [0]\n    New platform at ((470) * (8)) [0]\n    New platform at ((470) * (9)) [0]\n    New platform at ((470) * (10)) [0]\n    New platform at ((470) * (8)) [400]\n    New platform at ((470) * (9)) [400]\n    New platform at ((470) * (10)) [400]\n    New platform at ((470) * (12)) [400]\n    New platform at ((470) * (12)) [800]\n    New platform at ((470) * (13)) [800]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine New platform at (x) (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen flag clicked\nhide\n\nwhen I receive [lag v]\nstop [other scripts in sprite v]\n\n@Super jump\n\nwhen I receive [start v]\nhide\nset [jump y v] to [0]\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        repeat (10)\n            change [jump y v] by (1)\n        end\n        repeat (10)\n            change [jump y v] by (-1)\n        end\n    end\nend\n\nif <touching (super jump v)?> then\nend\n\nwhen I start as a clone\ngo to [back v] layer\ngo to [back v] layer\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen I receive [green flag v]\nhide\n\nwhen I receive [tick v]\nposition ((x) - (scroll x)) ((y) - (scroll y))\n\nwhen I receive [setup v]\nhide\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [2]> then\n    switch costume to (level 0 0 v)\n    New platform at ((470) * (5)) [0]\n    New platform at ((470) * (6)) [0]\n    New platform at ((470) * (7)) [0]\n    New platform at ((470) * (8)) [0]\n    New platform at ((470) * (8)) [400]\n    New platform at ((470) * (10)) [400]\n    New platform at ((470) * (11)) [400]\n    New platform at ((470) * (12)) [400]\nend\n\ndefine position (x) (y)\ngo to x: (x) y: ((y) - (jump y))\nif <<(x) = (x position)> and <((y) - (jump y)) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine New platform at (x) (y)\ncreate clone of (_myself_ v)\nset [x v] to (x)\nset [y v] to (y)\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [lag v]\nstop [other scripts in sprite v]\n\n@Figur1\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen [space v] key pressed\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [other scripts in sprite v]\n\nwhen [space v] key pressed\nrepeat (10)\n    change y by (-10)\nend\n\nwhen flag clicked\nwait until <mouse down?>\nbroadcast (play v)\nrepeat (10)\n    change y by (-10)\nend\n\nwhen flag clicked\nwait until <mouse down?>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [other scripts in sprite v]\n\n@images2\n\nwhen flag clicked\nswitch costume to (images2 v)\nset size to (100) %\ngo to x: (0) y: (0)\nforever\n    point in direction ((90) + (([sin v] of ((timer) * (100)) ) * (10)))\n    set [title size change vel v] to ((((title size change vel) * (1.6)) + ((((500) + ((100) * <touching (mouse-pointer v)?>)) - (size)) + ([cos v] of ((timer) * (100)) ))) / (2))\n    change size by (title size change vel)\nend\n\nwhen [space v] key pressed\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [other scripts in sprite v]\n\nwhen flag clicked\nwait until <mouse down?>\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nstop [other scripts in sprite v]\n\nwhen flag clicked\nwait until <mouse down?>\nbroadcast (play v)\nrepeat (10)\n    change y by (-10)\nend\n\nwhen [space v] key pressed\nbroadcast (play v)\nrepeat (10)\n    change y by (-10)\nend\n\n@images3\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nset [ghost v] effect to (40)\nswitch costume to (dot v)\nset size to (20) %\nset [brightness v] effect to (0)\nset [cy2 v] to (pick random (10) to (20))\nset [cx1 v] to (pick random (-5) to (5))\nrepeat until <touching (_edge_ v)?>\n    change x by (cx1)\n    change y by (cy2)\n    change [cy2 v] by (-2)\nend\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    wait (0.5) seconds\n    create clone of (_myself_ v)\nend\n\nwhen [space v] key pressed\nhide\nstop [other scripts in sprite v]\n\nwhen I receive [play v]\nstop [other scripts in sprite v]\ndelete this clone\n\n@Player\n\nwhen I receive [levelfin v]\nstop [other scripts in sprite v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nwait (0.5) seconds\ngo to x: (0) y: (0)\nswitch costume to (levelfin v)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nset [sx v] to [0]\nset [x v] to [0]\nset [y v] to [0]\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [sy v] to [0]\nset [in air v] to [0]\nset [exit v] to []\nset size to (100) %\nset [ghost v] effect to (0)\nshow\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    repeat until <(exit) > []>\n        Tick\n        broadcast (Tick v) and wait\n    end\n    if <(exit) = [win]> then\n        Game - Win\n    else\n        Game - Die\n    end\nend\n\ndefine Tick\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    switch costume to (player2 v)\n    set [sx v] to [-8]\nend\nif <<key (right arrow v) pressed?> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    switch costume to (player v)\n    set [sx v] to [8]\nend\nif <touching (cacti v)?> then\n    set [sx v] to ((sx) * (-1))\n    set [sx v] to ((sx) * (3))\nend\nChange Player x by (sx)\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [11]\n    end\nend\nif <touching (super jump v)?> then\n    set [sy v] to [20]\nend\nif <(sx) = [0]> then\n    switch costume to (player4 v)\nend\nchange [sy v] by (-1)\nChange Player y by (sy)\nPosition\nTest - Die\nset [scroll x v] to (x)\nchange [scroll y v] by (round (((y) - (scroll y)) / (10)))\nPosition\nif <(y) < [-180]> then\n    set [exit v] to [die]\nend\nif <touching (portal v)?> then\n    set [exit v] to [win]\nend\nif <not <(sx) = [0]>> then\n    if <([abs v] of (sx) ) = (sx)> then\n        change [sx v] by (-1)\n    else\n        change [sx v] by (1)\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 (platforms 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 Position\ngo to x: ((x) - (scroll x)) y: ((y) - (scroll y))\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platforms v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n    end\n    change [y v] by (-12)\n    repeat until <not <touching (platforms v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n            set [sx v] to [0]\n        else\n            change [x v] by (1)\n            set [sx v] to [0]\n        end\n        Position\n    end\nend\n\ndefine Game - Die\nrepeat (3)\n    hide\n    wait (0.1) seconds\n    show\n    wait (0.1) seconds\nend\nhide\nwait (0.5) seconds\nbroadcast (Start v)\n\ndefine Test - Die\nif <touching (danger v)?> then\n    set [exit v] to [die]\nend\n\ndefine Game - Win\nbroadcast (end v)\nwait (0.1) seconds\nstop [other scripts in sprite v]\n\nwhen flag clicked\n\nwhen I receive [play v]\nwait (2) seconds\nset [level v] to [2]\nbroadcast (Start v)\n\n@Ashampoo_Snap_2020\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\n\nwhen I receive [main menu v]\ngo to [front v] layer\n\nwhen I receive [tick v]\ngo to [front v] layer\n\nwhen [space v] key pressed\nshow\nset [ghost v] effect to (100)\n\n@//📊 Scratch Analytics by @TimMcCool2\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