⚠️SCARY⚠️mine- a platformer⚠️

Instructions: https://scratch.mit.edu/projects/400813174

@Stage\n\nwhen flag clicked\n\nforever\n\nwhen flag clicked\nset volume to (50) %\nshow\ngo to x: (1) y: (61)\nforever\n    set [brightness v] effect to (0)\n    wait (3) seconds\n    if <[1] = (pick random (1) to (2))> then\n        broadcast (lighting v)\n        repeat (2)\n            set [brightness v] effect to (10)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    play sound [heavy-rain-daniel_simon v] until done\nend\n\n@The Player\n\ndefine Do Player Tick\nset [speed x v] to [0]\nif <key (left arrow v) pressed?> then\n    set [speed x v] to [-4]\nend\nif <key (right arrow v) pressed?> then\n    set [speed x v] to [4]\nend\nif <(Can Jump?) > [0]> then\n    change [can jump? v] by (-1)\n    if <key (up arrow v) pressed?> then\n        set [speed y v] to [9]\n    end\nend\nMove Player (Speed X) (0)\nchange [speed y v] by (-1)\nMove Player (0) (Speed Y)\nset [scroll x v] to (round ((((Scroll X) * (7)) + (Player X)) / (8)))\nif <(Scroll X) < [0]> then\n    set [scroll x v] to [0]\nend\nPosition Player\n\ndefine Position Player\ngo to x: ((Player X) - (Scroll X)) y: (Player Y)\n\ndefine None\nchange [player x v] by (sx)\nchange [player y v] by (sy)\nPosition Player\nif <not <touching (level v)?>> then\n    stop [this script v]\nend\nif <(sx) = [0]> then\n    set [speed y v] to [0]\nend\nrepeat (8)\n    change [player y v] by (1)\n    Position Player\n    if <not <touching (level v)?>> then\n        set [can jump? v] to [7]\n        stop [this script v]\n    end\nend\nchange [player x v] by ((0) - (sx))\nchange [player y v] by ((-8) - (sy))\n\nwhen flag clicked\nset [scroll x v] to [0]\nset [player x v] to [0]\nset [player y v] to [-43]\nset [speed x v] to [0]\nset [speed y v] to [0]\nset [can jump? v] to [0]\nPosition Player\nforever\n    Do Player Tick\n    broadcast (tick v) and wait\nend\n\nwhen flag clicked\nforever\n    if <(y position) < [-180]> then\n        stop [all v]\n    end\nend\n\nwhen [timer v] > (0.3)\nhide\n\nwhen flag clicked\nshow\n\n@Level\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\nswitch costume to (costume1 v)\nset [offset x v] to [0]\nrepeat (20)\n    create clone of (_myself_ v)\n    change [offset x v] by (478)\n    next costume\nend\n\nwhen I receive [tick v]\nset x to ([floor v] of ((Offset X) - (Scroll X)) )\nif <(x position) = ([floor v] of ((Offset X) - (Scroll X)) )> then\n    show\nelse\n    hide\nend\n\n@Sprite3\n\nwhen flag clicked\nshow\ngo to x: (1) y: (61)\nforever\n    set [brightness v] effect to (0)\n    wait (0.1) seconds\n    set [brightness v] effect to (pick random (-10) to (20))\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nshow\ngo to x: (1) y: (61)\nforever\n    set [brightness v] effect to (0)\n    wait (0.1) seconds\n    set [brightness v] effect to (pick random (-3) to (0))\n    wait (0.1) seconds\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go to (the player v)\nend\n\nwhen flag clicked\nshow\ngo to x: (1) y: (61)\nforever\n    wait (3) seconds\n    if <[1] = (pick random (1) to (2))> then\n        repeat (10)\n            set [brightness v] effect to (0)\n        end\n    end\nend\n\nset [brightness v] effect to (0)\nwait (0.1) seconds\n\nwait (0.1) seconds\n\nwhen I receive [lighting v]\nstart sound [thunder_sound_FX-Grant_Evans-1523270250 v]\nrepeat (2)\n    set [brightness v] effect to (10)\nend\n\nwait (0.1) seconds\n\nwait (0.3) seconds\n\nwhen [timer v] > (0.3)\nhide\n\n@Screen Shot 2019-05-09 at 9\n\nwhen flag clicked\nhide\n\n@Sprite78\n\nwhen flag clicked\nwait (0.0000001) seconds\nshow\nset [ghost v] effect to (90)\nforever\n    go to [front v] layer\n    next costume\n    wait (0) seconds\nend\n\nhide\n\nwhen flag clicked\nforever\n    play sound [2019-05-01_-_Undercover_Spy_Agent_-_David_Fesliyan v] until done\nend\n\nwhen [timer v] > (0.3)\nhide\n\n@Outro\n\nwhen flag clicked\n\ndefine Set pen color to R (r) G (g) B (b) With opacity (a)\nset pen color to (((b) + (((g) * (256)) + ((r) * ((256) * (256))))) + ((a) * ((256) * ((256) * (256)))))\n\ndefine gen\ndelete (all) of [x v]\ndelete (all) of [y v]\ndelete (all) of [size v]\nset [i v] to [0]\nset [i2 v] to [0]\nrepeat (100)\n    add (pick random (-25) to (25)) to [x v]\n    add (pick random (-100) to (100)) to [y v]\n    add (pick random (0.1) to (1)) to [size v]\nend\n\nSet pen color to R (10) G (10) B (10) With opacity (1)\n\nwhen I receive [end v]\nset [i2 v] to [0]\nset [l v] to [1]\nset [loud v] to [0]\ngen\nforever\n    set size to (100) %\n    switch costume to (costume2 v)\n    point in direction (90)\n    set [ghost v] effect to (65)\n    go to x: (0) y: (0)\n    stamp\n    hide\n    change [loud v] by (((item ((l) mod (length of [loudness v])) of [loudness v]) - (loud)) / (10))\n    rend (loud)\n    change [i2 v] by ((loud) / (5))\n    change [l v] by (1)\n    go to x: (0) y: (0)\n    set size to ((([sin v] of ((i2) * (2)) ) * (10)) + (70)) %\n    clear graphic effects\n    set [ghost v] effect to (0)\n    switch costume to (screen shot 2018-12-14 at 4 v)\n    show\n    stamp\n    go to x: (0) y: (0)\n    set size to ((([sin v] of ((i2) * (2)) ) * (10)) + (75)) %\n    clear graphic effects\n    set [ghost v] effect to ((125) - (size))\n    switch costume to (screen shot 2018-12-14 at 4 v)\n    show\n    if <(pick random (1) to (10)) = [8]> then\n        create clone of (_myself_ v)\n    end\nend\n\nrend\n\npoint in direction (10)\n\nstamp\n\nwhen I start as a clone\nclear graphic effects\nswitch costume to (pick random (3) to (5))\nset size to (3500) %\ngo to x: (pick random (-240) to (240)) y: (-500)\nset [cv v] to (pick random (10) to (25))\nrepeat (((cv) * (2)) + (1))\n    go to [front v] layer\n    change y by (cv)\n    change [cv v] by (-1)\n    turn right (cv) degrees\n    stamp\nend\ndelete this clone\n\nwhen I receive [end v]\nforever\n    play sound [afterglow by reaktor productions vanoss new outro song - \[Mp3Truck.Net\] v] until done\nend\n\ndefine rend (number1)\nset pen size to (10)\nset [i v] to [0]\nset pen color to (#f6f6f6)\nrepeat ((360) / (5))\n    go to x: (([sin v] of ((i) + (i2)) ) * (100)) y: (([cos v] of ((i) + (i2)) ) * (100))\n    pen down\n    go to x: ((([sin v] of ((i) + (i2)) ) * ((number1) + (125))) * ([abs v] of ([sin v] of ([abs v] of ((i2) + (((x position) + (y position)) + (number1))) ) ) )) y: ((([cos v] of ((i) + (i2)) ) * ((number1) + (125))) * ([abs v] of ([sin v] of ([abs v] of ((i2) + (((x position) + (y position)) + (number1))) ) ) ))\n    pen up\n    change [i v] by (5)\nend\n\ngo to x: (0) y: (0)\nclear graphic effects\nset [ghost v] effect to ((100) - (size))\nswitch costume to (costume1 v)\nshow\nstamp\n\ndefine rend\nset [g v] to [1]\nrepeat ([ceiling v] of ((length of [y v]) / (2)) )\n    set [gotox v] to (([sin v] of (((i3) * (item (g) of [size v])) + (item (g) of [y v])) ) * ((item (g) of [x v]) * (10)))\n    set [gotoy v] to (([cos v] of (((i3) * (item (g) of [size v])) + (item (g) of [y v])) ) * ((item (g) of [x v]) * (10)))\n    if <<not <([abs v] of (gotox) ) > [400]>> and <not <([abs v] of (gotoy) ) > [300]>>> then\n        Set pen color to R (2) G ((item (g) of [size v]) * (255)) B (8) With opacity (10)\n        go to x: (gotox) y: (gotoy)\n        set pen size to (200)\n        pen down\n        pen up\n    end\n    change [g v] by (2)\nend\nset [g v] to [1]\nrepeat (length of [y v])\n    Set pen color to R (9) G (3) B (7) With opacity (100)\n    go to x: (([sin v] of (((i3) * (item (g) of [size v])) + (item (g) of [y v])) ) * ((item (g) of [x v]) * (10))) y: (([cos v] of (((i3) * (item (g) of [size v])) + (item (g) of [y v])) ) * ((item (g) of [x v]) * (10)))\n    change y by (([sin v] of (((i4) * ((item (g) of [x v]) * (0.1))) + (item (g) of [y v])) ) * ((item (g) of [size v]) * (10)))\n    set pen size to ((item (g) of [size v]) * (10))\n    pen down\n    pen up\n    change [g v] by (1)\nend\nchange [i3 v] by (((loud) - (5)) / (10))\nchange [i4 v] by (5)\nset [direction v] to ((i3) / (-3))\nhide\n\nerase all\n\nbroadcast (end v)\nerase all\nhide\nerase all\n\nwhen flag clicked\nerase all\nhide\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.3)\nbroadcast (end v)\n\nwhen [timer v] > (0.3)\nhide\n\n