Invisible -A Platformer-

Instructions: Arrow keys/wad/mobile to move\nAvoid spikes\nThe ground and spikes are invisible unless you shine a black light on them\nAlso you can't move while he's talking but when he finishes talking you can move

@Stage\n\nwhen flag clicked\nforever\n    play sound [Travel The Galaxy \(HD\) v] until done\nend\n\n@Sprite\n\ndefine say (text)\nset [letter v] to []\nset [say v] to []\nrepeat (length of (text))\n    change [letter v] by (1)\n    set [say v] to (join (say) (letter (letter) of (text)))\n    say (say)\n    wait (0.03) seconds\nend\nwait (1.5) seconds\nsay []\n\nwhen flag clicked\nforever\n    if <(x position) > [220]> then\n        set [xv v] to [0]\n        set [yv v] to [0]\n        go to x: (-193) y: (-77)\n        broadcast (NEXT LEVEL v)\n    end\nend\n\nwhen flag clicked\nset [yv v] to [0]\nset [xv v] to [0]\nset [level v] to [1]\nset [change? v] to [0]\nswitch costume to (costume1 v)\npoint in direction (90)\nshow\ngo to x: (-193) y: (-77)\nsay [Welcome to Invisible -A Platformer-, where the ground is invisble.]\nsay [Be glad that you have this black flashlight to guide you around!]\nrepeat until <(Level) = [2]>\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 (costume2 v)\n        change [xv v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        switch costume to (costume2 v)\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (sprite1 v)?> then\n        change y by (1)\n        if <touching (sprite1 v)?> then\n            change y by (1)\n            if <touching (sprite1 v)?> then\n                change y by (1)\n                if <touching (sprite1 v)?> then\n                    change y by (1)\n                    if <touching (sprite1 v)?> then\n                        change y by (1)\n                        if <touching (sprite1 v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> 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 [13]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (sprite1 v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (sprite1 v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (sprite3 v)?> then\n        start sound [Crunch v]\n        Die\n    end\nend\nsay [Even spikes are invisible!]\nsay [Avoid them!]\nrepeat until <(Level) = [3]>\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [xv v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (sprite1 v)?> then\n        change y by (1)\n        if <touching (sprite1 v)?> then\n            change y by (1)\n            if <touching (sprite1 v)?> then\n                change y by (1)\n                if <touching (sprite1 v)?> then\n                    change y by (1)\n                    if <touching (sprite1 v)?> then\n                        change y by (1)\n                        if <touching (sprite1 v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> 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 [13]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (sprite1 v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (sprite1 v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (sprite3 v)?> then\n        start sound [Crunch v]\n        Die\n        go to x: (-193) y: (-77)\n    end\nend\nsay [You can wall jump!]\nsay [I will stop talking now.]\nforever\n    if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n        change [xv v] by (1)\n    end\n    if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [xv v] by (-1)\n    end\n    set [xv v] to ((Xv) * (0.9))\n    change x by (Xv)\n    if <touching (sprite1 v)?> then\n        change y by (1)\n        if <touching (sprite1 v)?> then\n            change y by (1)\n            if <touching (sprite1 v)?> then\n                change y by (1)\n                if <touching (sprite1 v)?> then\n                    change y by (1)\n                    if <touching (sprite1 v)?> then\n                        change y by (1)\n                        if <touching (sprite1 v)?> then\n                            change x by ((Xv) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> 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 [13]\n                            else\n                                set [xv v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [yv v] by (-1)\n    change y by (Yv)\n    if <touching (sprite1 v)?> then\n        change y by ((Yv) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <touching (sprite1 v)?> then\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>> then\n            set [yv v] to [15]\n        end\n    end\n    change y by (1)\n    if <touching (sprite3 v)?> then\n        start sound [Crunch v]\n        Die\n        go to x: (-193) y: (-77)\n    end\nend\n\nwhen I receive [lvl start v]\ngo to x: (-193) y: (-77)\n\nwhen I receive [next level v]\ngo to x: (-193) y: (-77)\nchange [level v] by (1)\n\nif <(change?) = [0]> then\n\nset [change? v] to [1]\n\nwait (.1) seconds\nset [change? v] to [0]\n\nset [change? v] to [0]\n\nwhen flag clicked\nforever\n\nif <(Level) = [2]> then\n\nforever\n\nif <(Level) = [1]> then\n\ndefine Die\nhide\nbroadcast (dead v)\nset [xv v] to [0]\nset [yv v] to [0]\nwait until <not <(wre) = [0]>>\ngo to x: (-193) y: (-77)\nshow\n\n@Sprite1\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@Sprite2\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to [back v] layer\nset size to (100) %\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nset [my variable v] to [0]\nforever\n    if <(my variable) = [0]> then\n        go to [back v] layer\n        repeat (10)\n            go to (sprite v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (sprite v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    else\n        go to [back v] layer\n        go [forward v] (3) layers\n        repeat (10)\n            go to (death animation v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (death animation v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    end\nend\n\nwhen I start as a clone\nset size to (130) %\nforever\n    if <(my variable) = [0]> then\n        go to [back v] layer\n        repeat (10)\n            go to (sprite v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (sprite v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    else\n        go to [back v] layer\n        go [forward v] (3) layers\n        repeat (10)\n            go to (death animation v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (death animation v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    end\nend\n\nwhen I receive [dead v]\nhide\n\nwhen I receive [alive again v]\nshow\n\n@Sprite3\n\nwhen flag clicked\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\nshow\n\nwhen I receive [next level v]\nnext costume\n\n@Death Animation\n\nwhen flag clicked\ngo to [front v] layer\nset [wre v] to [0]\nhide\n\nwhen I receive [dead v]\ngo to (sprite v)\nrepeat (1)\n    next costume\n    create clone of (_myself_ v)\nend\nwait until <not <(wre) = [0]>>\nbroadcast (alive again v)\nset [wre v] to [0]\n\nwhen I start as a clone\nshow\ngo to (sprite v)\nset [pieces: yv v] to (pick random (10) to (15))\nset [pieces: xv v] to (pick random (5) to (-5))\nforever\n    go to [front v] layer\n    change x by (pieces: XV)\n    change y by (pieces: YV)\n    turn right (((pieces: XV) * ([abs v] of (pieces: YV) )) / (2)) degrees\n    change [pieces: yv v] by (-1)\n    if <<([abs v] of (x position) ) > [239]> or <([abs v] of (y position) ) > [179]>> then\n        set [wre v] to [erea]\n        delete this clone\n    end\nend\n\n@Sprite4\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\nset [ghost v] effect to (100)\ngo to [front v] layer\n\n@Sprite5\n\nwhen flag clicked\nshow\nclear graphic effects\ngo to [back v] layer\nset size to (100) %\nset [ghost v] effect to (0)\ncreate clone of (_myself_ v)\nset [my variable v] to [0]\nforever\n    if <(my variable) = [0]> then\n        go to [back v] layer\n        repeat (10)\n            go to (mouse-pointer v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (mouse-pointer v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    else\n        go to [back v] layer\n        go [forward v] (3) layers\n        repeat (10)\n            go to (death animation v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (death animation v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    end\nend\n\nwhen I start as a clone\nset size to (130) %\nforever\n    if <(my variable) = [0]> then\n        go to [back v] layer\n        repeat (10)\n            go to (mouse-pointer v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (mouse-pointer v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    else\n        go to [back v] layer\n        go [forward v] (3) layers\n        repeat (10)\n            go to (death animation v)\n            change size by (3)\n            change [ghost v] effect by (3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n        repeat (10)\n            go to (death animation v)\n            change size by (-3)\n            change [ghost v] effect by (-3)\n            turn right (36) degrees\n            move (3) steps\n            wait (.01) seconds\n        end\n    end\nend\n\nwhen I receive [dead v]\nhide\n\nwhen I receive [alive again v]\nshow\n\n