Platformer

Instructions: Arrow keys -> Move\nSpace -> Skip + 10 Deaths\nRed -> 1 Death\nLight Blue -> Water\nDark Blue -> Bounce\nR -> Restart Level\nDouble Click Green Flag\nGo on turbo mode for a bad time

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop3 v)\nwait (3) seconds\nswitch backdrop to (backdrop2 v)\nset volume to (50) %\nforever\n    play sound [Track1.mp3 v] until done\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\nwait (3) seconds\nshow\nforever\n    go to [front v] layer\n    if <(costume [number v]) = [10]> then\n        broadcast (fish v)\n        wait until <not <(costume [number v]) = [10]>>\n    end\n    if <not <(costume [number v]) = [10]>> then\n        broadcast (unfish v)\n        wait until <(costume [number v]) = [10]>\n    end\nend\n\nwhen I receive [message1 v]\nnext costume\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [6]> then\n        broadcast (inv2 v)\n        wait until <not <(costume [number v]) = [6]>>\n    end\n    if <not <(costume [number v]) = [6]>> then\n        broadcast (inv v)\n        wait until <(costume [number v]) = [6]>\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume2 v)\ngo to x: (0) y: (0)\nset size to (100) %\ngo [backward v] (3) layers\n\nwhen flag clicked\nrepeat until <(costume [number v]) = [11]>\n    if <key (space v) pressed?> then\n        next costume\n        broadcast (skip v)\n        wait until <not <key (space v) pressed?>>\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [9]> then\n        broadcast (thing v)\n        wait until <not <(costume [number v]) = [9]>>\n    end\n    if <not <(costume [number v]) = [9]>> then\n        broadcast (thing hide v)\n        wait until <(costume [number v]) = [9]>\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [8]> then\n        broadcast (go to show v)\n        wait until <not <(costume [number v]) = [8]>>\n    end\n    if <not <(costume [number v]) = [8]>> then\n        broadcast (go to hide v)\n        wait until <(costume [number v]) = [8]>\n    end\nend\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [5]> then\n        broadcast (show v)\n        wait until <not <(costume [number v]) = [5]>>\n    end\n    if <not <(costume [number v]) = [5]>> then\n        broadcast (stop v)\n        wait until <(costume [number v]) = [5]>\n    end\nend\n\nwhen flag clicked\nforever\n    go [backward v] (1) layers\nend\n\nmove (10) steps\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (-200) y: (20)\nhide\nwait (3) seconds\nshow\nswitch backdrop to (backdrop1 v)\nset [ghost v] effect to (0)\nset [level v] to [1]\nset [deaths v] to [0]\nset [game v] to [1]\nset [xv v] to [0]\nset [yv v] to [0]\nbroadcast (Update Deaths v)\ngo to [front v] layer\nforever\n    go to [front v] layer\n    go [backward v] (-1) layers\n    if <(game) = [1]> then\n        change [yv v] by (-0.5)\n        if <key (right arrow v) pressed?> then\n            change [xv v] by (0.7)\n            point in direction (90)\n        end\n        if <key (left arrow v) pressed?> then\n            change [xv v] by (-0.7)\n            point in direction (90)\n        end\n        set [xv v] to ((Xv) * (0.9))\n        change x by (Xv)\n        if <<<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>> or <touching (sprite5 v)?>> then\n            change y by (1)\n            if <<<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>> or <touching (sprite5 v)?>> then\n                change y by (1)\n                if <<touching (sprite5 v)?> or <<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>>> then\n                    change y by (1)\n                    if <<<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>> or <touching (sprite5 v)?>> then\n                        change y by (1)\n                        if <<<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>> or <touching (sprite5 v)?>> then\n                            change y by (1)\n                            if <<<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>> or <touching (sprite5 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 (up arrow v) pressed?> 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 [10]\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 (sprite5 v)?> or <<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>>> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <<touching (sprite5 v)?> or <<touching color (#b2b2b2)?> or <<touching color (#7f7f7f)?> or <touching color (#666666)?>>>> then\n            if <key (up arrow v) pressed?> then\n                set [yv v] to [10]\n            end\n        end\n        change y by (1)\n    end\n    if <touching (_edge_ v)?> then\n        set [yv v] to [0]\n        go to x: (-200) y: (20)\n        change [level v] by (1)\n        broadcast (message1 v)\n    end\n    if <touching color (#003fff)?> then\n        set [yv v] to [15]\n    end\n    if <<touching color (#00ffff)?> or <<touching color (#00cccc)?> or <touching color (#009999)?>>> then\n        if <key (up arrow v) pressed?> then\n            set [yv v] to [5]\n        else\n            set [yv v] to [-1]\n        end\n    end\n    if <<touching color (#ff0000)?> or <<touching color (#990000)?> or <touching color (#cc0000)?>>> then\n        repeat (10)\n            change [ghost v] effect by (10)\n        end\n        set [yv v] to [0]\n        set [xv v] to [0]\n        go to x: (-200) y: (20)\n        set [ghost v] effect to (0)\n        change [deaths v] by (1)\n        broadcast (dead v)\n        broadcast (Update Deaths v)\n        erase all\n    end\n    if <<touching color (#00ffff)?> or <<touching color (#00cccc)?> or <touching color (#009999)?>>> then\n        if <key (down arrow v) pressed?> then\n            set [yv v] to [-5]\n        else\n        end\n    end\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen flag clicked\nrepeat until <(costume [number v]) = [11]>\n    if <key (r v) pressed?> then\n        go to x: (-200) y: (20)\n        change [deaths v] by (1)\n        broadcast (Update Deaths v)\n        broadcast (clear v) and wait\n    end\nend\n\nwhen [l v] key pressed\nhide\nwait (1) seconds\nshow\nrepeat until <key (a v) pressed?>\n    create clone of (_myself_ v)\nend\n\nwhen I receive [skip v]\nchange [deaths v] by (10)\nbroadcast (Update Deaths v)\ngo to x: (-200) y: (20)\n\n@Sprite4\n\nwhen I receive [fish v]\ngo to [front v] layer\nshow\nset rotation style [left-right v]\ngo to x: (97) y: (-19)\npoint in direction (-90)\nrepeat until \n    glide (2) secs to x: (202) y: (-19)\n    wait (0.1) seconds\n    turn right (180) degrees\n    glide (2) secs to x: (97) y: (-19)\n    wait (0.1) seconds\n    turn left (180) degrees\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [unfish v]\nhide\n\n@Sprite5\n\nwhen I receive [inv2 v]\nset [switch v] to [1]\nclear graphic effects\nshow\ngo to x: (-26) y: (128)\nrepeat until <(Switch) = [0]>\n    clear graphic effects\n    go [backward v] (1) layers\n    show\n    if <(distance to [sprite1 v]) < [100]> then\n        set [color v] effect to (87)\n        go [backward v] (1) layers\n    else\n        go [backward v] (1) layers\n        clear graphic effects\n    end\nend\n\nwhen flag clicked\nset [switch v] to [0]\nhide\n\nwhen I receive [inv v]\nhide\nset [switch v] to [0]\n\n@Sprite8\n\nwhen I receive [go to hide v]\nhide\n\nwhen I receive [go to show v]\ngo to [front v] layer\nshow\nrepeat until \n    go to (mouse-pointer v)\n    go [backward v] (0) layers\nend\n\n@Sprite9\n\nwhen flag clicked\nhide\n\nwhen I receive [thing v]\nshow\nrepeat until \n    go to (mouse-pointer v)\n    if <mouse down?> then\n        stamp\n        wait until <not <mouse down?>>\n    end\nend\n\nwhen I receive [thing hide v]\nhide\nerase all\nstop [other scripts in sprite v]\n\nwhen I receive [thing hide v]\nhide\n\nwhen I receive [clear v]\nerase all\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen I receive [show v]\nshow\npoint in direction (90)\ngo to x: (-81) y: (54)\nrepeat until \n    turn right (5) degrees\nend\n\nwhen I receive [stop v]\nhide\n\n@Numbers\n\nwhen flag clicked\nswitch costume to (0 v)\ngo to x: (220) y: (155)\n\nwhen I receive [update deaths v]\nerase all\nset [digits v] to (length of (Deaths))\nset [x v] to [220]\nrepeat until <(Digits) = [0]>\n    go to [front v] layer\n    go to x: (x) y: (155)\n    switch costume to (letter (Digits) of (Deaths))\n    stamp\n    stamp\n    stamp\n    set [digits v] to ((Digits) - (1))\n    set [x v] to ((x) - (20))\n    repeat until <(Digits) = [0]>\n        go to [front v] layer\n        go to x: (x) y: (155)\n        switch costume to (letter (Digits) of (Deaths))\n        stamp\n        stamp\n        stamp\n        set [digits v] to ((Digits) - (1))\n        set [x v] to ((x) - (20))\n        repeat until <(Digits) = [0]>\n            go to [front v] layer\n            go to x: (x) y: (155)\n            switch costume to (letter (Digits) of (Deaths))\n            stamp\n            stamp\n            stamp\n            set [digits v] to ((Digits) - (1))\n            set [x v] to ((x) - (20))\n            repeat until <(Digits) = [0]>\n                go to [front v] layer\n                go to x: (x) y: (155)\n                switch costume to (letter (Digits) of (Deaths))\n                stamp\n                stamp\n                stamp\n                set [digits v] to ((Digits) - (1))\n                set [x v] to ((x) - (20))\n                repeat until <(Digits) = [0]>\n                    go to [front v] layer\n                    go to x: (x) y: (155)\n                    switch costume to (letter (Digits) of (Deaths))\n                    stamp\n                    stamp\n                    stamp\n                    set [digits v] to ((Digits) - (1))\n                    set [x v] to ((x) - (20))\n                    repeat until <(Digits) = [0]>\n                        go to [front v] layer\n                        go to x: (x) y: (155)\n                        switch costume to (letter (Digits) of (Deaths))\n                        stamp\n                        stamp\n                        stamp\n                        set [digits v] to ((Digits) - (1))\n                        set [x v] to ((x) - (20))\n                    end\n                end\n            end\n        end\n    end\nend\n\n