Darkness || A Platformer

Instructions: Controls:\naswd keys or arrow keys to move...\nMobile Controls:\nTap & Hold to move...\n\n2021-wow, I am BAD at this...

@Stage\n\nwhen flag clicked\nforever\n    play sound [Wind v] until done\nend\n\n@Player\n\nwhen flag clicked\nset [dead? v] to [No]\nhide\n\nwhen I receive [start v]\nshow\nset [ghost v] effect to (0)\ngo to x: (-190) y: (0)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <(x position) > [228]> then\n        if <(Level) = [31]> then\n            change x by (20)\n            stop [this script v]\n        else\n            set x to (-228)\n            change [level v] by (1)\n            start sound [Click v]\n        end\n    end\n    if <<<touching (danger v)?> or <touching (danger 2 v)?>> or <(y position) < [-180]>> then\n        stop [other scripts in sprite v]\n        set [dead? v] to [Yes]\n        switch costume to (hurt v)\n        start sound [Ouch v]\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        wait (0.1) seconds\n        broadcast (Start v)\n        set [dead? v] to [No]\n    end\n    if <touching (spring v)?> then\n        set [yv v] to [20]\n        start sound [Jump v]\n    end\nend\n\nwhen I receive [start v]\nforever\n    switch costume to (idle v)\n    change [yv v] by (-1)\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [xv v] by (1)\n        point in direction (90)\n        switch costume to (move v)\n    end\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-1)\n        point in direction (-90)\n        switch costume to (move v)\n    end\n    set [xv v] to ((XV) * (0.9))\n    change x by (XV)\n    if <<touching (level v)?> or <touching (level 2 v)?>> then\n        change y by (1)\n        if <<touching (level v)?> or <touching (level 2 v)?>> then\n            change y by (1)\n            if <<touching (level v)?> or <touching (level 2 v)?>> then\n                change y by (1)\n                if <<touching (level v)?> or <touching (level 2 v)?>> then\n                    change y by (1)\n                    if <<touching (level v)?> or <touching (level 2 v)?>> then\n                        change y by (1)\n                        if <<touching (level v)?> or <touching (level 2 v)?>> then\n                            change x by ((XV) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                            if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n                                if <(XV) > [0]> then\n                                    set [xv v] to [-8]\n                                else\n                                    set [xv v] to [8]\n                                end\n                                set [yv v] to [12]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (YV)\n    if <<touching (level v)?> or <touching (level 2 v)?>> then\n        change y by ((YV) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (level v)?> or <touching (level 2 v)?>> then\n        if <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [yv v] to [12]\n        end\n    end\n    change y by (1)\nend\n\n@Stamp\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I start as a clone\ngo to (player v)\nshow\nrepeat (6)\n    change [ghost v] effect by (16)\n    change size by (-6)\nend\ndelete this clone\n\nwhen I receive [start v]\nrepeat until <(Dead?) = [Yes]>\n    create clone of (_myself_ v)\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Level 2\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nforever\n    if <(Level) > [20]> then\n        show\n        switch costume to (Level)\n        set x to ((0) + (([cos v] of (((timer) - (2)) * (150)) ) * (70)))\n    end\nend\n\n@Tips\n\nwhen flag clicked\ngo to x: (0) y: (0)\nhide\n\nwhen I receive [start v]\nshow\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\n@Play Button\n\nwhen flag clicked\nshow\ngo to x: (0) y: (-20)\nset size to (100) %\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (5)\n        change size by (((120) - (size)) / (3))\n        if <mouse down?> then\n            wait until <not <mouse down?>>\n            start sound [Click v]\n            broadcast (Start v)\n            hide\n            stop [this script v]\n        end\n    else\n        set [brightness v] effect to (0)\n        change size by (((100) - (size)) / (3))\n    end\nend\n\n@Title\n\nwhen flag clicked\ngo to x: (0) y: (60)\nshow\n\nwhen I receive [start v]\nhide\n\n@Clouds1\n\nwhen flag clicked\nset [xpos v] to [0]\nset [ypos v] to [0]\nforever\n    go to [back v] layer\n    go to x: (xPos) y: (yPos)\n    if <(x position) < [-446]> then\n        set [xpos v] to [448]\n    end\n    change [xpos v] by (-1)\nend\n\n@Clouds2\n\nwhen flag clicked\nset [xpos v] to [448]\nset [ypos v] to [0]\nforever\n    go to [back v] layer\n    go to x: (xPos) y: (yPos)\n    if <(x position) < [-446]> then\n        set [xpos v] to [448]\n    end\n    change [xpos v] by (-1)\nend\n\n@Danger\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nhide\n\nwhen I receive [start v]\nshow\nforever\n    switch costume to (Level)\nend\n\n@Danger 2\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\n    if <(Level) = [19]> then\n        set y to ((0) + (([cos v] of (((timer) - (2)) * (200)) ) * (30)))\n    else\n        if <(Level) = [20]> then\n            go to x: (0) y: (0)\n            set x to ((0) + (([cos v] of (((timer) - (2)) * (150)) ) * (50)))\n        else\n            if <(Level) = [23]> then\n                go to x: (0) y: (0)\n                set x to ((0) + (([cos v] of (((timer) - (2)) * (150)) ) * (70)))\n            else\n                set y to ((0) + (([cos v] of (((timer) - (2)) * (200)) ) * (50)))\n            end\n        end\n    end\nend\n\nif <(Level) = [27]> then\n    go to x: (0) y: (0)\n    set x to ((0) + (([cos v] of (((timer) - (2)) * (150)) ) * (70)))\nelse\n    set y to ((0) + (([cos v] of (((timer) - (2)) * (200)) ) * (50)))\nend\n\n@Ta-da\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [31]> then\n        create clone of (_myself_ v)\n        wait (0.2) seconds\n    end\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (30)\ngo to x: (pick random (-210) to (210)) y: (160)\nrepeat until <touching (_edge_ v)?>\n    change y by (-3)\n    next costume\n    turn right (3) degrees\nend\ndelete this clone\n\n@Spring\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\n@Dark\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    go to [front v] layer\nend\n\n@Rain\n\nwhen flag clicked\nhide\nforever\n    wait (0.05) seconds\n    create clone of (_myself_ v)\n    go to [back v] layer\nend\n\nwhen I start as a clone\nshow\nset [ghost v] effect to (80)\ngo to x: (pick random (-237) to (237)) y: (170)\npoint in direction (-165)\nmove (15) steps\nrepeat until <touching (_edge_ v)?>\n    move (10) steps\nend\ndelete this clone\n\n