Dream Cube: A Platformer

Instructions: Use the arrow keys to move. Try to get out of your dream. If you want to play again then click the green flag twice.

@Stage\n\nwhen flag clicked\nswitch backdrop to (blue sky 2 2 v)\n\nwhen I receive [start game v]\nswitch backdrop to (blue sky 2  v)\nforever\n    if <(Hi!) = [11]> then\n        switch backdrop to (wall 1 v)\n    end\nend\n\nwhen I receive [start game v]\nforever\n    play sound [Vexento - Happy Robot v] until done\nend\n\n@Sprite7\n\nwhen flag clicked\n\nwhen I receive [play v]\nrepeat (34)\n    change [ghost v] effect by (3)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\ngo to [front v] layer\ngo [backward v] (1) layers\nshow\nset [ghost v] effect to (0)\n\n@Sprite5\n\nwhen flag clicked\nhide\n\ngo to [front v] layer\nshow\n\n@Sprite4\n\nwhen I receive [new level v]\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\ngo to [back v] layer\nshow\nswitch costume to (costume1 v)\n\n@Sprite2\n\nwhen flag clicked\nswitch costume to (costume2 v)\n\nwhen I receive [new level v]\nnext costume\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nshow\n\n@Sprite6\n\nwhen flag clicked\n\nwhen I receive [play v]\nrepeat (34)\n    change [ghost v] effect by (3)\nend\nset [hi! v] to [0]\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\ngo to [front v] layer\nshow\nset [ghost v] effect to (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (Play v)\n    end\nend\n\n@Sprite8\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [new level v]\nnext costume\n\nwhen flag clicked\n\nwhen flag clicked\nhide\n\nwhen I receive [start game v]\nshow\ngo to [back v] layer\nset [ghost v] effect to (0)\nforever\n    if <touching (sprite1 v)?> then\n        set [ghost v] effect to (50)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\n@Sprite9\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nswitch costume to (costume1 v)\ngo to [front v] layer\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        change [hi! v] by (1)\n        broadcast (New Level v)\n        broadcast (Restart v)\n        wait (2) seconds\n    else\n        if <touching (mouse-pointer v)?> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\n\nwhen flag clicked\n\n@Sprite10\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nswitch costume to (costume1 v)\ngo to x: (405) y: (33)\ngo to [front v] layer\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        broadcast (Restart v)\n        wait (1) seconds\n    else\n        if <touching (mouse-pointer v)?> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    end\nend\n\n@Intro\n\nwhen I receive [sound v]\nplay sound [Low Whoosh v] until done\n\nwhen I receive [intro music v]\nplay sound [Dance Celebrate v] until done\n\nwhen flag clicked\nset [ghost v] effect to (0)\nbroadcast (Intro Music v)\nshow\ngo to x: (0) y: (0)\nswitch costume to (costume3 v)\nrepeat (30)\n    next costume\nend\nwait (3) seconds\nbroadcast (Sound v)\nrepeat (2)\n    change y by (100)\nend\nswitch costume to (costume34 v)\nwait (1) seconds\nswitch costume to (costume33 v)\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nbroadcast (Start Game v)\n\n@ Sprite1\n\nwhen flag clicked\nswitch costume to (costume1 v)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-3)\nend\ndelete this clone\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nforever\n    if <touching (sprite4 v)?> then\n        go to x: (-169) y: (-42)\n    end\nend\n\nwhen I receive [start game v]\nshow\nset [y velocity v] to [0]\nset [x velocity v] to [0]\ngo to x: (-214) y: (-42)\nforever\n    if <key (right arrow v) pressed?> then\n        change [x velocity v] by (1)\n    end\n    if <key (left arrow v) pressed?> then\n        change [x velocity v] by (-1)\n    end\n    set [x velocity v] to ((x velocity) * (.9))\n    change x by (x velocity)\n    if <touching (sprite2 v)?> then\n        change y by (1)\n        if <touching (sprite2 v)?> then\n            change y by (1)\n            if <touching (sprite2 v)?> then\n                change y by (1)\n                if <touching (sprite2 v)?> then\n                    change y by (1)\n                    if <touching (sprite2 v)?> then\n                        change y by (1)\n                        if <touching (sprite2 v)?> then\n                            change x by ((x velocity) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(x velocity) > [0]> then\n                                    set [x velocity v] to [-8]\n                                else\n                                    set [x velocity v] to [8]\n                                end\n                                set [y velocity v] to [15]\n                            else\n                                set [x velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (y velocity)\n    if <touching (sprite2 v)?> then\n        change y by ((y velocity) * (-1))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <touching (sprite2 v)?> then\n        if <key (up arrow v) pressed?> then\n            change [y velocity v] by (15)\n        end\n    end\n    change y by (1)\n    if <(x position) > [230]> then\n        change [level v] by (1)\n        broadcast (New Level v)\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n        go to x: (-214) y: (-42)\n    end\nend\n\n