Midnight |A Platformer| #All #Games

Instructions: Use arrow keys to move and try to get past all of the levels. \nDon't touch lava or spikes because you will restart the level if you do. \nThis is my best game so far. Hope you enjoy!

@Stage\n\nwhen flag clicked\nforever\n    play sound [5133314953052160 v] until done\nend\n\n@player\n\nwhen I receive [levelup v]\nif <not <(Level Before) = []>> then\n    change [level v] by (1)\nelse\n    set [level v] to ((Level Before) + (1))\nend\ngo to x: (-180) y: (-50)\n\nwhen I receive [dead v]\ngo to x: (-180) y: (-50)\n\nwhen flag clicked\nset [level v] to [1]\nforever\n    if <touching (spikes v)?> then\n        broadcast (dead v)\n    end\n    if <(x position) > [242]> then\n        if <not <(Level) = [14]>> then\n            if <not <(Level) = [15]>> then\n                broadcast (levelup v)\n            end\n        end\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (right v)\nset [ghost v] effect to (0)\nshow\ngo to x: (-180) y: (-50)\nset [level v] to [1]\nset [x v] to [0]\nset [y v] to [0]\npoint in direction (90)\nforever\n    change [y v] by (-1)\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n        change [x v] by (-0.8)\n        switch costume to (left v)\n    end\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        switch costume to (right v)\n        change [x v] by (0.8)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<<key (space v) pressed?> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            set [y v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-5]\n            else\n                set [x v] to [5]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (ground v)?> then\n        change y by ((0) - (y))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<key (space v) pressed?> or <<key (up arrow v) pressed?> or <key (w v) pressed?>>> or <<mouse down?> and <(mouse y) > (y position)>>> and <touching (ground v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <(y position) > [180]> then\n        set [y v] to [0]\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (70)\nrepeat (4)\n    wait (0.01) seconds\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\n    wait (0.01) seconds\nend\n\nwhen flag clicked\nset drag mode [not draggable v]\n\n@Ground\n\nwhen flag clicked\nshow\nswitch costume to (01 v)\n\nwhen I receive [end v]\nhide\n\nwhen I receive [levelup v]\nnext costume\n\nwhen flag clicked\ngo to [front v] layer\n\nwhen flag clicked\ngo to x: (35) y: (26)\n\nwhen flag clicked\nforever\n    if <(costume [number v]) = [12]> then\n        broadcast (level 12 v) and wait\n    end\nend\n\n@spikes\n\nwhen flag clicked\nshow\nswitch costume to (01 v)\ngo to [back v] layer\n\nwhen I receive [levelup v]\nnext costume\n\nwhen flag clicked\ngo to x: (-2) y: (16)\n\n@Sprite1\n\nwhen flag clicked\nset [level before v] to []\nshow\nswitch costume to (skip v)\nset [delay v] to [0]\ngo to x: (-165) y: (128)\nforever\n    if <touching (mouse-pointer v)?> then\n        if <not <(delay) = [1]>> then\n            set [brightness v] effect to (30)\n            repeat until <(size) = [110]>\n                change size by (2.5)\n            end\n            if <mouse down?> then\n                set [level before v] to (Level)\n                if <not <(delay) = [1]>> then\n                    if <not <(Level) = [15]>> then\n                        broadcast (levelup v)\n                        broadcast (dead v)\n                        set [level before v] to []\n                        set [delay v] to [1]\n                        switch costume to (skip \(grey\) v)\n                        wait (0.1) seconds\n                        clear graphic effects\n                        repeat until <(size) = [100]>\n                            wait (0.01) seconds\n                            change size by (-2.5)\n                        end\n                        wait (3) seconds\n                        set [delay v] to [0]\n                        switch costume to (skip v)\n                        wait (0.01) seconds\n                    end\n                end\n            end\n        end\n    else\n        clear graphic effects\n        repeat until <(size) = [100]>\n            change size by (-2.5)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nwhen I receive [level 12 v]\nhide\n\n@Sprite2\n\nwhen flag clicked\nforever\n    go to [back v] layer\nend\n\nwhen flag clicked\ngo to x: (51) y: (34)\n\nwhen I receive [level 12 v]\nforever\n    go to [front v] layer\nend\n\n@thumbnail\n\nwhen flag clicked\nchange [ghost v] effect by (100)\ngo to x: (19) y: (-3)\nforever\n    go to [front v] layer\nend\n\n