Boing - A Platformer

Instructions: All instructions are in the game!\n\nExcept that you press 'R' to restart the level.\n\nDo NOT play in fullscreen!

@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\nforever\n    play sound [We are Scratchers! v] until done\nend\n\nwhen [space v] key pressed\nif <(backdrop [number v]) = [13]> then\n    next backdrop\nend\n\nwhen [k v] key pressed\nif <(username) = [elfowl]> then\n    switch backdrop to (backdrop25 v)\nend\n\n@Ball\n\nwhen flag clicked\nshow\nbroadcast (start v)\nset [deaths v] to [0]\n\nwhen I receive [start v]\nforever\n    set [nusdna nblkc dfv lkjasdvb lkajdsfvlkjb v] to (direction)\n    switch costume to (the ninja2 v)\n    point in direction (90)\n    if <(y position) < [-180]> then\n        broadcast (refresh level v) and wait\n    end\n    if <(x position) > [235]> then\n        change [level v] by (1)\n        broadcast (refresh level v) and wait\n    end\n    change [yv v] by (-0.5)\n    if <key (right arrow v) pressed?> then\n        change [xv v] by (0.7)\n    end\n    if <key (left arrow v) pressed?> then\n        change [xv v] by (-0.7)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching color (#000000)?> then\n        change y by (1)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change x by ((Xv) * (-1))\n                            change x by (-1)\n                            change y by (-5)\n                            change x by (1)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (Yv)\n    if <touching color (#000000)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching color (#000000)?> then\n        if <key (up arrow v) pressed?> then\n            start sound [boing v]\n            set [yv v] to [10]\n        end\n    end\n    if <touching color (#003fff)?> then\n        start sound [zoop v]\n        start sound [boing v]\n        set [yv v] to [15]\n    end\n    if <touching color (#0140ff)?> then\n        start sound [zoop v]\n        start sound [boing v]\n        set [yv v] to [15]\n    end\n    change y by (1)\n    point in direction (nusdna nblkc dfv lkjasdvb lkajdsfvLKJB)\n    switch costume to (the ninja v)\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n    end\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n    end\nend\n\nwhen I receive [start v]\nforever\n    add (x position) to [where x v]\n    add (y position) to [where y v]\n    go to [front v] layer\nend\n\nwhen I receive [start v]\nforever\n    if <(x position) > [230]> then\n        switch backdrop to (next backdrop v)\n        go to x: (-205) y: (-86)\n        delete (all) of [where y v]\n        delete (all) of [where x v]\n    end\n    if <[-175] > (y position)> then\n        stop [other scripts in sprite v]\n        play sound [laser1 v] until done\n        go to x: (item (1) of [where x v]) y: (item (1) of [where y v])\n        delete (last) of [where y v]\n        delete (last) of [where x v]\n        set [yv v] to [0]\n        set [xv v] to [0]\n        change [deaths v] by (1)\n        broadcast (start v)\n    end\nend\n\nwhen I receive [start v]\ndelete (all) of [where y v]\ndelete (all) of [where x v]\ngo to x: (-205) y: (-86)\nforever\n    if <touching color (#ff0000)?> then\n        stop [other scripts in sprite v]\n        play sound [laser1 v] until done\n        go to x: (item (1) of [where x v]) y: (item (1) of [where y v])\n        delete (last) of [where y v]\n        delete (last) of [where x v]\n        set [yv v] to [0]\n        set [xv v] to [0]\n        change [deaths v] by (1)\n        broadcast (start v)\n    end\nend\n\nwhen backdrop switches to [backdrop14 v]\ngo to x: (-205) y: (-86)\n\nwhen I receive [start v]\nforever\n    if <<touching color (#ff9400)?> and <(backdrop [number v]) = [21]>> then\n        switch backdrop to (next backdrop v)\n        go to x: (-205) y: (-86)\n        delete (all) of [where y v]\n        delete (all) of [where x v]\n    end\nend\n\nwhen backdrop switches to [backdrop21 v]\nsay (join [You only had ] (join (deaths) [ deaths!]))\n\nwhen [r v] key pressed\ngo to x: (-205) y: (-86)\n\nhide\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nforever\n    if <(backdrop [name v]) = [backdrop10]> then\n        show\n    else\n        hide\n    end\n    change [color v] effect by (2)\nend\n\n@Sprite2\n\nwhen flag clicked\ngo to x: (0) y: (0)\nset [ghost v] effect to (100)\n\nforever\n    go to [front v] layer\nend\n\nshow\n\nclear graphic effects\n\n@Ball2\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    hide\n    wait (0.05) seconds\n    clear graphic effects\nend\n\nwhen I start as a clone\nswitch costume to (ball-a v)\ngo to (ball v)\nshow\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\n@Ball3\n\nwhen I receive [start v]\nforever\n    if <not <touching (ball v)?>> then\n        set [nusdna nblkc dfv lkjasdvb lkajdsfvlkjb v] to (direction)\n        switch costume to (the ninja2 v)\n        point in direction (90)\n        if <(y position) < [-180]> then\n            broadcast (Refresh Level v) and wait\n        end\n        if <(x position) > [235]> then\n            change [level v] by (1)\n            broadcast (Refresh Level v) and wait\n        end\n        change [yv v] by (-0.5)\n        if <key (left arrow v) pressed?> then\n            change [xv v] by (0.7)\n        end\n        if <key (right arrow v) pressed?> then\n            change [xv v] by (-0.7)\n        end\n        set [xv v] to ((Xv) * (0.9))\n        change x by (Xv)\n        if <touching color (#000000)?> then\n            change y by (1)\n            if <touching color (#000000)?> then\n                change y by (1)\n                if <touching color (#000000)?> then\n                    change y by (1)\n                    if <touching color (#000000)?> then\n                        change y by (1)\n                        if <touching color (#000000)?> then\n                            change y by (1)\n                            if <touching color (#000000)?> then\n                                change x by ((Xv) * (-1))\n                                change x by (-1)\n                                change y by (-5)\n                                change x by (1)\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (Yv)\n        if <touching color (#000000)?> then\n            change y by ((Yv) * (-1))\n            set [yv v] to [0]\n        end\n        change y by (-1)\n        if <touching color (#000000)?> then\n            if <key (up arrow v) pressed?> then\n                start sound [boing v]\n                set [yv v] to [10]\n            end\n        end\n        if <touching color (#003fff)?> then\n            start sound [zoop v]\n            start sound [boing v]\n            set [yv v] to [15]\n        end\n        if <touching color (#0140ff)?> then\n            start sound [zoop v]\n            start sound [boing v]\n            set [yv v] to [15]\n        end\n        change y by (1)\n        point in direction (nusdna nblkc dfv lkjasdvb lkajdsfvLKJB)\n        switch costume to (the ninja v)\n        if <key (left arrow v) pressed?> then\n            point in direction (90)\n        end\n        if <key (right arrow v) pressed?> then\n            point in direction (-90)\n        end\n    end\nend\n\nwhen backdrop switches to [backdrop25 v]\ngo to x: (205) y: (-86)\n\nwhen [r v] key pressed\ngo to x: (205) y: (-86)\n\nwhen flag clicked\nforever\n    if <(backdrop [name v]) = [backdrop25]> then\n        show\n    else\n        hide\n    end\nend\n\n