rain platformer

Instructions: ----------------------------------------------------------instruction-\nRight key or d for going right\nUp key or w for a jump\nleft key or a for going left\nDown key or s for nothing\n-------------------------------------------------------------------------

@Stage\n\n@Player\n\nwhen flag clicked\nset size to (65) %\ngo to [front v] layer\nswitch costume to (costume1 v)\nset [ghost v] effect to (0)\nshow\ngo to x: (-180) y: (-50)\nset [level v] to [1]\nset [x2 v] to [0]\nset [y2 v] to [0]\npoint in direction (90)\nforever\n    change [y2 v] by (-1)\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        switch costume to (costume2 v)\n        change [x2 v] by (-2)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        switch costume to (costume1 v)\n        change [x2 v] by (2)\n    end\n    set [x2 v] to ((x2) * (0.9))\n    change x by (x2)\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (1)\n    end\n    if <touching (platforms v)?> then\n        change y by (-4)\n        change x by ((x2) * (-1))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y2 v] to [10]\n            if <([abs v] of (x2) ) = (x2)> then\n                set [x2 v] to [-5]\n            else\n                set [x2 v] to [5]\n            end\n        else\n            set [x2 v] to [0]\n        end\n    end\n    change y by (y2)\n    if <touching (platforms v)?> then\n        change y by ((0) - (y2))\n        set [y2 v] to [1]\n    end\n    change y by (-1)\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (platforms v)?>> then\n        set [y2 v] to [15]\n    end\n    if <(y position) > [180]> then\n        set [y2 v] to [0]\n    end\n    change y by (1)\nend\n\nhide\n\nwhen I receive [now v]\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    if <<key (r v) pressed?> or <touching (spikes v)?>> then\n        go to x: (-180) y: (-50)\n        broadcast (dead v)\n    end\n    if <(x position) > [246]> then\n        go to x: (-180) y: (-50)\n        broadcast (levelup v)\n        change [level v] by (1)\n    end\n    if <(Level) = [15]> then\n        broadcast (end v)\n        stop [other scripts in sprite v]\n    end\nend\n\n@Platforms\n\nwhen I receive [end v]\n\nhide\n\nwhen flag clicked\nshow\ngo to [front v] layer\nswitch costume to (01 v)\n\nwhen I receive [levelup v]\nnext costume\n\nwhen I receive [now v]\n\n@Spikes\n\nhide\n\nwhen flag clicked\ngo to [front v] layer\nshow\nswitch costume to (01 v)\n\nwhen I receive [levelup v]\nnext costume\n\nwhen I receive [now v]\n\n@Rain\n\nwhen flag clicked\nshow\nforever\n    repeat (10)\n        create clone of (_myself_ v)\n        create clone of (_myself_ v)\n    end\n    go to [front v] layer\nend\n\nwhen I start as a clone\nswitch costume to (pick random (1) to (3))\ngo to x: (pick random (-240) to (240)) y: (184)\nglide (pick random (0.005) to (2)) secs to x: (x position) y: (-184)\ndelete this clone\n\n@Thumbnail\n\nwhen flag clicked\nset [ghost v] effect to (100)\nshow\nforever\n    go to [front v] layer\n    go to x: (0) y: (0)\nend\n\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\n\n@music\n\nwhen flag clicked\nplay sound [Vexento - Masked Heroes \(128  kbps\) v] until done\n\n