-Robbed- A Platformer

Instructions: Robbed A Platformer is a platformer series - Part 1 is out and it is to be continued. You are robbed and you go on an adventure to retrieve your loot. Go through a variety of adventures. There are spikes, trampolines, and find out the rest. Arrow keys to move. Game is sort of glitchy. All credit goes to me. 

@Stage\n\n@Nuggets2\n\nwhen flag clicked\nforever\n    if <(Level) = [15]> then\n        switch costume to (costume1 v)\n        go to [front v] layer\n        hide\n        wait (pick random (1) to (2)) seconds\n        hide\n        turn right (45) degrees\n        wait (1) seconds\n        go to x: (pick random (-240) to (240)) y: (-135)\n        show\n        wait (0.2) seconds\n        glide (pick random (1.7) to (2)) secs to x: (pick random (-250) to (250)) y: (pick random (100) to (250))\n        glide (pick random (1.7) to (2)) secs to x: (pick random (-250) to (250)) y: (-142)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [15]> then\n        turn right (30) degrees\n    else\n        hide\n    end\nend\n\n@Nuggets\n\nwhen flag clicked\nforever\n    if <(Level) = [15]> then\n        switch costume to (costume1 v)\n        go to [front v] layer\n        hide\n        wait (pick random (1) to (2)) seconds\n        hide\n        turn right (45) degrees\n        wait (1) seconds\n        go to x: (pick random (-240) to (240)) y: (-135)\n        show\n        wait (0.2) seconds\n        glide (pick random (1.7) to (2)) secs to x: (pick random (-250) to (250)) y: (pick random (100) to (250))\n        glide (pick random (1.7) to (2)) secs to x: (pick random (-250) to (250)) y: (-142)\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [15]> then\n        turn right (30) degrees\n    else\n        hide\n    end\nend\n\n@Guards1\n\nwhen flag clicked\nforever\n    if <(Level) = [14]> then\n        show\n        go to [front v] layer\n        switch costume to (costume1 v)\n        go to x: (159) y: (-67)\n        glide (1) secs to x: (250) y: (-67)\n        switch costume to (costume2 v)\n        glide (1) secs to x: (159) y: (-67)\n    else\n        hide\n    end\nend\n\n@Guards\n\nwhen flag clicked\nforever\n    if <(Level) = [14]> then\n        show\n        go to [front v] layer\n        switch costume to (costume1 v)\n        go to x: (77) y: (-67)\n        glide (1) secs to x: (77) y: (-67)\n        switch costume to (costume2 v)\n        glide (1) secs to x: (-103) y: (-67)\n    else\n        hide\n    end\nend\n\n@Thumbnail\n\nforever\n    show\n    go to [front v] layer\nend\n\nwhen flag clicked\n\n@Portal2\n\nwhen flag clicked\nhide\nforever\n    if <(Level) = [9]> then\n        show\n        set [brightness v] effect to (100)\n        go to [front v] layer\n        go to x: (-69) y: (-25)\n        if <<touching (character v)?> or <touching (character2 v)?>> then\n            broadcast (Portal v)\n            broadcast (Portal1 v)\n        end\n    else\n        hide\n    end\nend\n\n@Portal1\n\nwhen flag clicked\nforever\n    if <(Level) = [9]> then\n        show\n        set [brightness v] effect to (100)\n        go to [front v] layer\n        go to x: (84) y: (9)\n    end\n    if <(Level) = [10]> then\n        hide\n    end\nend\n\nwhen flag clicked\nforever\n    hide\nend\n\n@Pen4\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\ngo to [front v] layer\nforever\n    go to x: (item (4) of [mousex v]) y: (item (4) of [mousey v])\n    erase all\nend\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\nforever\n    if <touching (moving platform2 v)?> then\n        broadcast (MovingPlatform2 v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Pen\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\ngo to [front v] layer\nforever\n    go to x: (item (1) of [mousex v]) y: (item (1) of [mousey v])\n    erase all\nend\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\nforever\n    if <mouse down?> then\n        insert (mouse y) at (1) of [mousey v] \n    end\nend\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\nforever\n    if <mouse down?> then\n        insert (mouse x) at (1) of [mousex v] \n    end\nend\n\ngo to x: (-130) y: (-1)\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\nforever\n    if <touching (moving platform2 v)?> then\n        broadcast (MovingPlatform2 v)\n    end\nend\n\nwhen flag clicked\nhide\n\n@Moving Platform2\n\nwhen flag clicked\nhide\nwait until <(Level) = [6]>\nshow\nswitch costume to (costume1 v)\ngo to [front v] layer\n\nwhen I receive [movingplatform2 v]\ngo to [front v] layer\nshow\nswitch costume to (costume2 v)\nforever\n    go to x: (178) y: (-110)\n    glide (1) secs to x: (178) y: (20)\n    glide (1) secs to x: (178) y: (-200)\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [7]> then\n        hide\n    end\nend\n\n@Moving Platform\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        show\n        go to [front v] layer\n        go to x: (178) y: (-135)\n        glide (1) secs to x: (178) y: (-4)\n        glide (1) secs to x: (178) y: (-135)\n    end\n    if <(Level) = [6]> then\n        forever\n            hide\n            go to [back v] layer\n        end\n    end\nend\n\n@Lava Walls\n\nwhen flag clicked\nforever\n    if <(Level) = [4]> then\n        show\n        switch costume to (1 v)\n        go to [front v] layer\n        repeat (20)\n            glide (1) secs to x: (0) y: (210)\n            glide (1) secs to x: (0) y: (127)\n        end\n    else\n        hide\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nforever\n    if <(Level) = [5]> then\n        hide\n    else\n    end\nend\n\n@Backdrop Costume\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to [front v] layer\nshow\n\n@NextLevel\n\nwhen I receive [platforms v]\nforever\n    show\n    go [forward v] (99) layers\n    switch costume to (open v)\nend\n\nwhen I receive [platforms v]\nshow\nforever\n    go to [front v] layer\n    if <touching (character v)?> then\n        broadcast (NextLevel v)\n        broadcast (NextLevel1 v)\n    end\n    if <(Level) = [1]> then\n        go to x: (123) y: (-43)\n    end\n    if <(Level) = [2]> then\n        go to x: (123) y: (-43)\n    end\n    if <(Level) = [3]> then\n        go to x: (70) y: (-140)\n    end\n    if <(Level) = [4]> then\n        go to x: (123) y: (-74)\n    end\n    if <(Level) = [5]> then\n        go to x: (115) y: (19)\n    end\n    if <(Level) = [8]> then\n        go to x: (123) y: (-45)\n    end\n    if <(Level) = [10]> then\n        go to x: (-296) y: (138)\n    end\n    if <(Level) = [12]> then\n        go to x: (123) y: (-45)\n    end\n    if <(Level) = [13]> then\n        go to x: (123) y: (-70)\n    end\n    if <(Level) = [14]> then\n        go to x: (123) y: (-45)\n    end\n    if <(Level) = [15]> then\n        go to x: (112) y: (16)\n    end\nend\n\nwhen I receive [platforms v]\nforever\n    wait until <(Level) = [3]>\n    go to x: (70) y: (-140)\nend\n\nwhen flag clicked\nforever\n    hide\nend\n\n@Character\n\nwhen flag clicked\nforever\n\nwhen I receive [forward v]\nchange [costume v] by (1)\nnext costume\n\nwhen I receive [backward v]\nchange [costume v] by (-1)\nswitch costume to <(costume) = [-1]>\n\nwhen I receive [platforms v]\nbroadcast (Platforms1 v)\nshow\ngo to x: (-215) y: (71)\nset [yv2 v] to [0]\nset [xv2 v] to [0]\nforever\n    if <touching (_edge_ v)?> then\n    end\n    if <(Level) = [4]> then\n        broadcast (Lava Walls v)\n    end\n    if <<<touching (nuggets v)?> or <touching (nuggets2 v)?>> or > then\n        go to x: (-215) y: (71)\n    end\n    if <touching color (#12ff2e)?> then\n        go to x: (-215) y: (71)\n    end\n    if <<touching (guards v)?> or <touching (guards1 v)?>> then\n        go to x: (-215) y: (71)\n    end\n    if <touching color (#ff0000)?> then\n        go to x: (-215) y: (71)\n    end\n    if <touching color (#c000ff)?> then\n        set [yv2 v] to [15]\n    end\n    go to [front v] layer\n    if <key (left arrow v) pressed?> then\n        change [xv2 v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        change [xv2 v] by (1)\n    end\n    change x by (Xv2)\n    set [xv2 v] to ((Xv2) * (0.9))\n    if <touching color (#0db220)?> then\n        change y by (0.5)\n        if <touching color (#0db220)?> then\n            change y by (0.5)\n            if <touching color (#0db220)?> then\n                change y by (0.5)\n                if <touching color (#0db220)?> then\n                    change y by (0.5)\n                    if <touching color (#0db220)?> then\n                        change y by (0.5)\n                        if <touching color (#0db220)?> then\n                            change y by (0.5)\n                            if <touching color (#0db220)?> then\n                                change y by (0.5)\n                                if <touching color (#0db220)?> then\n                                    change y by (0.5)\n                                    if <touching color (#0db220)?> then\n                                        if <key (up arrow v) pressed?> then\n                                            if <(Xv2) > [0]> then\n                                                set [xv2 v] to [-7]\n                                            else\n                                                set [xv2 v] to [7]\n                                            end\n                                            set [yv2 v] to [10]\n                                        else\n                                            set [xv2 v] to ((Xv2) * (-1.3))\n                                            change x by (Xv2)\n                                            set [xv2 v] to [0]\n                                            change x by ((Xv2) / (5))\n                                        end\n                                        change y by (-4)\n                                    end\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv2 v] by (-0.5)\n    change y by (Yv2)\n    if <touching color (#0db220)?> then\n        set [yv2 v] to ((Yv2) * (-0.25))\n        change y by (Yv2)\n        if <touching color (#0db220)?> then\n            change y by (Yv2)\n            if <touching color (#0db220)?> then\n                change y by (Yv2)\n                if <touching color (#0db220)?> then\n                    change y by (Yv2)\n                end\n            end\n        end\n    end\n    change y by (-1)\n    if <<touching color (#0db220)?> and <key (up arrow v) pressed?>> then\n        set [yv2 v] to [10]\n    end\n    change y by (1)\nend\n\nwhen I receive [nextlevel v]\ngo to x: (-215) y: (71)\n\nwhen I receive [platforms v]\nforever\n    show\n    go [forward v] (99) layers\n    switch costume to (costume3 v)\nend\n\nwhen I receive [portal v]\nhide\nwait (0.5) seconds\nshow\ngo to x: (84) y: (9)\n\n@Animation\n\nwhen I receive [animation v]\ngo to [front v] layer\nforever\n    show\nend\n\ngo [forward v] (98) layers\n\nwhen I receive [switchbackdrop v]\nswitch costume to (costume2 v)\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\n@Platforms\n\nwhen I receive [nextlevel v]\nnext costume\nchange [level v] by (1)\n\nwhen I receive [platforms v]\nswitch costume to (1 v)\ngo to x: (0) y: (0)\ngo to [front v] layer\nshow\nset [level v] to [1]\n\n@forward\n\ngo to x: (42) y: (-106)\nshow\ngo [forward v] (1) layers\nforever\n    go to [front v] layer\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (25)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\n\nwhen this sprite clicked\nbroadcast (forward v)\n\n@Settings\n\nwhen this sprite clicked\nswitch costume to (2 v)\nbroadcast (back v)\ngo to x: (0) y: (0)\nset size to (100) %\nswitch costume to (2 v)\nwait (1) seconds\nswitch costume to (1 v)\ngo to x: (-174) y: (-135)\nset size to (160) %\n\nwhen this sprite clicked\ngo to [front v] layer\n\nwhen flag clicked\nforever\n    show\n    go [forward v] (1) layers\n    switch costume to (1 v)\n    go to x: (-174) y: (-135)\n    set size to (160) %\nend\n\n@backward\n\ngo to x: (-58) y: (-106)\nshow\ngo [forward v] (1) layers\nforever\n    go to [front v] layer\n    show\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (25)\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\n\nwhen this sprite clicked\nbroadcast (backward v)\n\n\n\n\n\n@Chicken Nuggets\n\nwhen I receive [animation v]\nshow\nswitch costume to (costume1 v)\nwait (2) seconds\ngo to x: (232) y: (-72)\nswitch costume to (costume2 v)\nglide (3) secs to x: (-70) y: (-71)\nforever\n    wait (0.2) seconds\n    next costume\n    if <(costume [number v]) = [3]> then\n        switch costume to (costume1 v)\n    end\n    wait (3) seconds\n    broadcast (OtherCostumes v)\n    stop [this script v]\nend\n\nwhen I receive [animation v]\n\nwait (2) seconds\ngo to x: (232) y: (-72)\nforever\n    go [forward v] (99) layers\nend\n\nwhen I receive [othercostumes v]\nswitch costume to (costume3 v)\nwait (2) seconds\nswitch costume to (costume4 v)\nwait (0.5) seconds\nswitch costume to (costume5 v)\nglide (3) secs to x: (240) y: (-72)\nwait (1) seconds\nswitch costume to (costume6 v)\nbroadcast (SwitchBackdrop v)\nwait (2) seconds\nbroadcast (Platforms v)\n\nwhen I receive [animation v]\nforever\n    show\n    go to [front v] layer\n    broadcast (Animation1 v)\nend\n\nforever\n    hide\nend\n\nwhen I receive [platforms v]\nforever\n    hide\nend\n\nwhen flag clicked\nhide\n\n@Clickbait\n\nwhen flag clicked\nswitch costume to (1 v)\ngo [forward v] (1) layers\npoint in direction (90)\nshow\ngo to x: (-14) y: (-24)\nset size to (0) %\nforever\n    repeat until <[1000] = ([floor v] of (size) )>\n        go to [front v] layer\n        change size by (((1000) - (size)) / (4))\n    end\n    if <touching (mouse-pointer v)?> then\n        repeat until <[1300] = ([floor v] of (size) )>\n            go to [front v] layer\n            change size by (((1300) - (size)) / (1.5))\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n        repeat until <[1000] = ([floor v] of (size) )>\n            go to [front v] layer\n            change size by (((1000) - (size)) / (3))\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (Animation v)\n\nwhen flag clicked\nforever\n    if <[1] < (Level)> then\n        stop [this script v]\n    end\nend\n\nhide\n\n@Clouds\n\nwhen I start as a clone\nshow\ngo [backward v] (pick random (10) to (20)) layers\ngo to x: (190) y: (pick random (-10) to (190))\nset [ghost v] effect to (pick random (50) to (50))\nset size to (pick random (100) to (300)) %\nset [cloud speed v] to ((size) / (200))\nrepeat until <[-240] > (x position)>\n    change x by ((Cloud Speed) / (-1))\nend\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\n\nwhen I receive [platforms v]\nhide\nforever\n    create clone of (_myself_ v)\n    wait (1) seconds\nend\n\nwhen I start as a clone\nshow\ngo [backward v] (pick random (10) to (20)) layers\ngo to x: (190) y: (pick random (-10) to (190))\nset [ghost v] effect to (pick random (50) to (50))\nset size to (pick random (100) to (300)) %\nset [cloud speed v] to ((size) / (200))\nrepeat until <[-240] > (x position)>\n    change x by ((Cloud Speed) / (-1))\nend\ndelete this clone\n\nwhen I start as a clone\nforever\n    go to [front v] layer\nend\n\n@Dodge\n\nwhen flag clicked\nset size to (0) %\nforever\n    repeat until <[800] = ([floor v] of (size) )>\n        go to [front v] layer\n        change size by (((800) - (size)) / (4))\n    end\n    if <touching (mouse-pointer v)?> then\n        repeat until <[1000] = ([floor v] of (size) )>\n            go to [front v] layer\n            change size by (((1000) - (size)) / (2))\n        end\n        wait until <not <touching (mouse-pointer v)?>>\n        repeat until <[800] = ([floor v] of (size) )>\n            go to [front v] layer\n            change size by (((800) - (size)) / (3))\n        end\n    end\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (119)\nforever\n    point in direction (((5) * ([cos v] of ((timer) * (80)) )) + (90))\nend\n\nwhen flag clicked\nforever\n    play sound [Dance Sitar v] until done\nend\n\nwhen flag clicked\nshow\ngo to x: (0) y: (119)\npoint in direction (((5) * ([cos v] of ((timer) * (80)) )) + (90))\nforever\nend\n\nwhen flag clicked\nforever\n    if <[1] < (Level)> then\n        stop [this script v]\n    end\nend\n\nhide\n\n