Pokemon Platformer Game

Instructions: Move player backwards and forwards with the left and right arrow keys.\nUp arrow key to jump.\nSpace-bar to throw 'Pokeball'.\nclick speaker icon to mute sound.\n

@Stage\n\nwhen flag clicked\nswitch backdrop to (starting screen v)\nforever\n    if <(badgecount) = [  0]> then\n        switch backdrop to (backdrop6 v)\n        stop [this script v]\n    end\nend\n\n@Player\n\nwhen flag clicked\ngo to x: (-232) y: (-148)\nhide\nforever\n    if <touching color (#000000)?> then\n        set y to (y position)\n    else\n        set y to ((y position) - (Gravity))\n        set [gravity v] to [7]\n    end\nend\n\nwhen backdrop switches to [backdrop4 v]\ngo to x: (-232) y: (-151)\nforever\n    if <touching (metapod v)?> then\n        go to x: (-232) y: (-151)\n    end\n    if <touching (kakuna v)?> then\n        go to x: (-232) y: (-151)\n    end\n    if <touching (metapod2 v)?> then\n        go to x: (-232) y: (-151)\n    end\nend\n\nwhen flag clicked\nforever\n    if <touching (rattata v)?> then\n        go to x: (-232) y: (121)\n    end\n    if <touching (pidgeotto v)?> then\n        go to x: (-232) y: (121)\n    end\n    if <touching (fearow v)?> then\n        go to x: (-232) y: (121)\n    end\n    if <touching (rapidash v)?> then\n        go to x: (-16) y: (16)\n    end\nend\n\nwhen backdrop switches to [backdrop2 v]\ngo to x: (-211) y: (142)\n\nwhen backdrop switches to [backdrop3 v]\ngo to x: (-232) y: (103)\n\nwhen backdrop switches to [backdrop1 v]\ngo to x: (-232) y: (-148)\nshow\nforever\n    if <key (right arrow v) pressed?> then\n        set [direction v] to [1]\n        switch costume to (redright v)\n        point in direction (90)\n        move (7) steps\n    end\n    if <key (left arrow v) pressed?> then\n        set [direction v] to [-1]\n        switch costume to (redleft v)\n        point in direction (-90)\n        move (7) steps\n    end\nend\n\nwhen [up arrow v] key pressed\nchange y by (50)\nwait (0.6) seconds\n\nwhen backdrop switches to [backdrop6 v]\npoint in direction (90)\nforever\n    if <touching (geodude v)?> then\n        go to x: (-213) y: (-133)\n    end\n    if <touching (onix v)?> then\n        go to x: (-213) y: (-133)\n    end\nend\n\nwhen backdrop switches to [the end v]\nhide\n\nwhen backdrop switches to [backdrop6 v]\ngo to x: (-232) y: (-148)\nshow\n\n@PlayNow\n\nwhen this sprite clicked\nswitch backdrop to (backdrop1 v)\nhide\n\nwhen flag clicked\nswitch backdrop to (starting screen v)\nshow\n\n@Gym\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        switch backdrop to (backdrop2 v)\n    end\nend\n\nwhen backdrop switches to [backdrop1 v]\nshow\ngo to x: (-207) y: (64)\n\nwhen backdrop switches to [backdrop2 v]\nhide\n\n@Rattata\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [backdrop3 v]\nhide\n\nwhen backdrop switches to [backdrop2 v]\nshow\ngo to x: (115) y: (12)\npoint in direction (-90)\nforever\n    move (5) steps\n    if on edge, bounce\nend\n\nwhen flag clicked\nforever\n    if <touching (pokeball v)?> then\n        hide\n        go to x: (222) y: (167)\n    end\nend\n\n@PokeBall\n\nwhen flag clicked\nhide\nset [direction v] to [0]\n\nwhen I start as a clone\nshow\nrepeat until <<<<<touching (rattata v)?> or <touching (_edge_ v)?>> or <key (right arrow v) pressed?>> or <touching (geodude v)?>> or <touching (onix v)?>>\n    if <(direction) = [1]> then\n        change x by (5)\n    end\nend\nwait (0.006) seconds\ndelete this clone\n\nwhen I start as a clone\nshow\nrepeat until <<<<<touching (rattata v)?> or <touching (_edge_ v)?>> or <key (left arrow v) pressed?>> or <touching (geodude v)?>> or <touching (onix v)?>>\n    if <(direction) = [ -1 ]> then\n        change x by (-5)\n    end\nend\nwait (0.006) seconds\ndelete this clone\n\nwhen [space v] key pressed\ngo to (player v)\ncreate clone of (_myself_ v)\n\n@Pidgeotto\n\nwhen backdrop switches to [backdrop3 v]\nshow\ngo to x: (197) y: (157)\npoint in direction (180)\nforever\n    move (5) steps\n    if on edge, bounce\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <touching (pokeball v)?> then\n        hide\n        go to x: (222) y: (167)\n    end\nend\n\nwhen backdrop switches to [backdrop4 v]\nhide\n\n@Gym2\n\nwhen backdrop switches to [backdrop2 v]\nshow\ngo to x: (-207) y: (-141)\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        switch backdrop to (backdrop3 v)\n        hide\n    end\nend\n\n@Gym3\n\nwhen backdrop switches to [backdrop3 v]\nshow\ngo to x: (207) y: (-141)\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        switch backdrop to (backdrop4 v)\n        hide\n    end\nend\n\n@Fearow\n\nwhen backdrop switches to [backdrop3 v]\nshow\ngo to x: (114) y: (25)\npoint in direction (-90)\nforever\n    move (5) steps\n    if on edge, bounce\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <touching (pokeball v)?> then\n        hide\n        go to x: (222) y: (167)\n    end\nend\n\nwhen backdrop switches to [backdrop4 v]\nhide\n\n@Metapod\n\nwhen flag clicked\nhide\ngo to x: (-184) y: (2)\n\nwhen flag clicked\nforever\n    if <touching (pokeball v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\nwhen backdrop switches to [backdrop4 v]\nshow\n\nif on edge, bounce\n\n@Kakuna\n\nwhen backdrop switches to [backdrop4 v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (133) y: (45)\n\nwhen flag clicked\nforever\n    if <touching (pokeball v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\n@Metapod2\n\nwhen backdrop switches to [backdrop4 v]\nshow\n\nwhen flag clicked\nhide\ngo to x: (-107) y: (114)\n\nwhen flag clicked\nforever\n    if <touching (pokeball v)?> then\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nhide\n\n@Gym4\n\nwhen backdrop switches to [backdrop4 v]\nshow\ngo to x: (-1) y: (141)\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        switch backdrop to (backdrop5 v)\n        hide\n    end\nend\n\n@Rapidash\n\nwhen backdrop switches to [backdrop6 v]\nhide\n\nwhen flag clicked\nset [badgecount v] to [4]\nhide\n\nwhen backdrop switches to [backdrop5 v]\nshow\nswitch costume to (rapidashleft v)\ngo to x: (75) y: (-128)\nrepeat until <(badgecount) = [0]>\n    switch costume to (rapidashleft v)\n    point in direction (-90)\n    glide (1) secs to x: (-208) y: (-128)\n    point in direction (0)\n    glide (1) secs to x: (-212) y: (163)\n    point in direction (90)\n    switch costume to (rapidashright v)\n    glide (1) secs to x: (215) y: (163)\n    point in direction (180)\n    glide (1) secs to x: (202) y: (-132)\nend\n\n@badge\n\nwhen flag clicked\nset [badgecount v] to [4]\nrepeat (10)\n    start sound [Pokemon_Theme v]\nend\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        change [badgecount v] by (-1)\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (-206) y: (-126)\nset [badgecount v] to [4]\n\nforever\n    if <(badgecount) = [  0]> then\n        switch backdrop to (backdrop6 v)\n    end\nend\n\n@badge2\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        change [badgecount v] by (-1)\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (207) y: (-126)\n\n@badge3\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        change [badgecount v] by (-1)\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (207) y: (154)\n\n@badge4\n\nwhen flag clicked\nhide\nforever\n    if <touching (player v)?> then\n        change [badgecount v] by (-1)\n        hide\n    end\nend\n\nwhen backdrop switches to [backdrop5 v]\nshow\ngo to x: (-206) y: (160)\n\n@Geodude\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [the end v]\nhide\n\nwhen backdrop switches to [backdrop6 v]\nshow\ngo to x: (-206) y: (-38)\nforever\n    glide (pick random (1) to (3)) secs to x: (pick random (-240) to (240)) y: (-38)\n    point towards (player v)\nend\n\n@brock\n\nwhen flag clicked\nhide\ngo to x: (199) y: (121)\n\nwhen backdrop switches to [backdrop6 v]\nforever\n    if <touching (player v)?> then\n        switch backdrop to (the end v)\n        hide\n        wait (1) seconds\n        stop [all v]\n    end\nend\n\nwhen backdrop switches to [backdrop6 v]\nshow\nwait (2) seconds\nsay [Don't even think about trying to catch my pokemon!] for (4) seconds\n\n@onix\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [the end v]\nhide\n\nwhen backdrop switches to [backdrop6 v]\nshow\ngo to x: (224) y: (114)\nforever\n    repeat (4)\n        point in direction (90)\n        glide (2) secs to x: ((x position) - (70)) y: ((y position) - (40))\n        glide (2) secs to x: ((x position) - (70)) y: ((y position) + (40))\n        if on edge, bounce\n    end\n    repeat (4)\n        point in direction (-90)\n        glide (2) secs to x: ((x position) + (70)) y: ((y position) + (40))\n        glide (2) secs to x: ((x position) + (70)) y: ((y position) - (40))\n    end\n    if on edge, bounce\nend\n\n@Speaker\n\nwhen flag clicked\nshow\n\nwhen this sprite clicked\nstop all sounds\nhide\n\n