Lightning -A Scrolling Platformer-

Instructions: Lightning - A scrolling platformer\n\nHeart, star and follow and I will give you some pie\n\nArrow keys to move, down arrow to crouch. Sometimes lighting will appear and it will usually blind you for a few seconds. Beware!\n\nWARNING: This game has flashing lights in it. \n=============================================\nCredits:\nMe @JWhandle\nMusic: Tiny woods\n\nEnjoy :D\n\n#game #games #platformer #lightning #jwhandle

@Stage\n\nchange [brightness v] effect by (0.1)\n\nchange [color v] effect by (25)\n\nwhen flag clicked\nforever\n    play sound [07 Tiny Woods v] until done\nend\n\nset [mosaic v] effect to (0)\n\n@player\n\nwhen flag clicked\nset [xv v] to [0]\nset [yv v] to [0]\nset [scroll x v] to [230]\nset [scroll y v] to [30]\nset size to (100) %\nshow\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen flag clicked\n\ngo to [front v] layer\n\nwhen flag clicked\n\nif <touching (spikes v)?> then\n\nbroadcast (dead v)\nset [x v] to [0]\nset [y v] to [0]\n\nif <touching color (#fffa00)?> then\n    set [yv v] to [19]\nend\n\nwhen flag clicked\n\nwhen I receive [next v]\n\nwhen flag clicked\n\nif <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n    set [yv v] to [10]\nend\n\nwhen flag clicked\n\nwhen flag clicked\n\nwhen I receive [start v]\nswitch costume to (costume v)\nset [pixelate v] effect to (0)\nforever\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        change [xv v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        change [xv v] by (1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if  then\n        change y by (1)\n        if  then\n            change y by (1)\n            if  then\n                change y by (1)\n                if  then\n                    change y by (1)\n                end\n                if  then\n                    change y by (1)\n                    if  then\n                        change x by ((Xv) * (-1))\n                        change y by (-5)\n                        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n                            if <(Xv) > [0]> then\n                                set [xv v] to [-5]\n                            else\n                                set [xv v] to [5]\n                            end\n                            set [yv v] to [10]\n                        else\n                            set [xv v] to [0]\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if  then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if  then\n        if <<key (up arrow v) pressed?> or <key (w v) pressed?>> then\n            set [yv v] to [10]\n        end\n    end\n    change y by (1)\n    change [scroll x v] by ((x position) * (-1))\n    change [scroll y v] by ((y position) * (-1))\n    go to x: (0) y: (0)\n    if <touching (spikes v)?> then\n        broadcast (dead v)\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        set [ghost v] effect to (0)\n        set [scroll x v] to [230]\n        set [scroll y v] to [30]\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <<key (down arrow v) pressed?> or <key (s v) pressed?>> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume v)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <touching (next v)?> then\n        wait () seconds\n        set size to (100) %\n        point in direction (90)\n        set [pixelate v] effect to (0)\n        set [scroll x v] to [230]\n        set [scroll y v] to [30]\n        set [xv v] to [0]\n        set [yv v] to [0]\n        broadcast (next v)\n        wait () seconds\n    end\nend\n\nwhen I receive [start v]\nforever\n    broadcast (tick v)\nend\n\nif <[] = [1]> then\n\n@level\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    if <(Scroll X) > [275]> then\n        set [scroll x v] to [274]\n    end\n    if <(Scroll X) < [-373]> then\n        set [scroll x v] to [-374]\n    end\nend\n\ngo to x: (0) y: (Scroll Y)\n\nwhen I receive [next v]\nnext costume\nwait (0.1) seconds\n\nwhen I receive [tick v]\ngo to x: (Scroll X) y: (Scroll Y)\nif <(Scroll X) > [275]> then\n    set [scroll x v] to [274]\nend\nif <(Scroll X) < [-373]> then\n    set [scroll x v] to [-374]\nend\n\nwhen flag clicked\nforever\nend\n\nif <(costume [number v]) = [10]> then\n    broadcast (end v)\n    stop [this script v]\nend\n\n@next\n\nwhen flag clicked\nshow\ngo to x: (240) y: (21)\nset [ghost v] effect to (0)\n\nwhen I receive [tick v]\ngo to x: ((Scroll X) + (300)) y: ((Scroll Y) + (-50))\n\nwhen I receive [end v]\nhide\n\n@dead\n\nwhen flag clicked\nhide\ngo to [front v] layer\nset [ghost v] effect to (100)\nset size to (120) %\n\nwhen flag clicked\n\nwhen I receive [dead v]\ngo to [front v] layer\nshow\nrepeat (20)\n    change [ghost v] effect by (-5)\nend\nwait (0.2) seconds\nbroadcast (reset v)\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nset [ghost v] effect to (100)\nhide\n\n@Sprite1\n\n@spikes\n\nwhen I receive [tick v]\ngo to x: (Scroll X) y: (Scroll Y)\n\nwhen I receive [next v]\nnext costume\nwait (0.01) seconds\n\nwhen flag clicked\nswitch costume to (costume10 v)\n\n@title\n\nwhen flag clicked\nset size to (100) %\nshow\nset [ghost v] effect to (0)\nswitch costume to (costume3 v)\ngo to x: (0) y: (0)\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@play\n\nwhen flag clicked\nshow\nset [ghost v] effect to (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (5)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen this sprite clicked\nbroadcast (start v)\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n@thumb\n\nwhen flag clicked\nhide\n\n@lightning\n\nwhen flag clicked\n\nwhen I receive [start v]\n\nwhen flag clicked\nhide\ndelete this clone\n\nwhen I start as a clone\nset volume to (100) %\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\ngo to [front v] layer\nshow\nswitch costume to (costume7 v)\nrepeat (5)\n    change [ghost v] effect by (-20)\nend\nwait (pick random (0.3) to (1)) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen [space v] key pressed\n\nwhen I receive [start v]\nset [ghost v] effect to (0)\ngo to [back v] layer\nforever\n    set [ghost v] effect to (0)\n    hide\n    wait (pick random (2.5) to (6)) seconds\n    go to x: (pick random (-230) to (230)) y: (74)\n    switch costume to (pick random (1) to (6))\n    set [ghost v] effect to (100)\n    show\n    start sound (pick random (1) to (2))\n    set [strike v] to (pick random (1) to (3))\n    set volume to (pick random (70) to (110)) %\n    repeat (5)\n        change [ghost v] effect by (-20)\n    end\n    wait (0.3) seconds\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    hide\nend\n\nwhen I receive [start v]\nforever\n    if <<(strike) = [1]> or <(strike) = [2]>> then\n        set [strike v] to [0]\n        create clone of (_myself_ v)\n    end\nend\n\n@words2\n\nwhen I receive [tick v]\n\ngo to x: ((Scroll X) + (pick random (-1) to (1))) y: ((Scroll Y) + (pick random (-1) to (1)))\n\nwhen flag clicked\nhide\n\nwhen I receive [end v]\nshow\n\n@title2\n\nwhen flag clicked\ngo to [front v] layer\nset size to (100) %\nshow\nset [ghost v] effect to (0)\nswitch costume to (costume3 v)\ngo to x: (0) y: (79)\nforever\n    set [my variable v] to [0]\n    forever\n        change [my variable v] by (20)\n        change size by ([cos v] of (my variable) )\n    end\nend\n\nwhen I receive [start v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\n