The Cave (A Dark Platformer)
@Stage\n\nwhen flag clicked\nswitch backdrop to (backdrop2 v)\nwait (3) seconds\nswitch backdrop to (backdrop3 v)\nbroadcast (b v)\n\nwhen I receive [a v]\nswitch backdrop to (backdrop1 v)\n\n@Player\n\nwhen flag clicked\nhide\n\ndefine reset\ngo to x: (-200) y: (-100)\n\nwhen I receive [a v]\nset [y v] to [0]\nset [y v] to [0]\nset [level v] to [1]\nshow\ngo to x: (-200) y: (-87)\nsay [This cave is really dark.] for (2) seconds\nforever\n    if <key (left arrow v) pressed?> then\n        change [x v] by (-1)\n    end\n    if <key (right arrow v) pressed?> then\n        change [x v] by (1)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\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 ((x) * (-1))\n                            change y by (-5)\n                            if <key (up arrow v) pressed?> then\n                                if <(x) > [0]> then\n                                    set [x v] to [-7]\n                                else\n                                    set [x v] to [7]\n                                end\n                                set [y v] to [10]\n                            else\n                                set [x v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y v] by (-1)\n    change y by (y)\n    if <touching (sprite1 v)?> then\n        change y by ((y) * (-1))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<touching color (#000000)?> and <key (up arrow v) pressed?>> then\n        set [y v] to [10]\n    end\n    change y by (1)\n    if <(x position) > [235]> then\n        broadcast (message1 v)\n        change [level v] by (1)\n        reset\n    end\n    if <key (r v) pressed?> then\n        reset\n    end\n    if <<(y position) < [-175]> or <touching color (#ff0000)?>> then\n        reset\n    end\nend\n\nset [x v] to ((x) * (-1.3))\nchange x by (x)\n\nchange x by ((x) / (5))\nif <touching (sprite1 v)?> then\n    change y by (y)\n    if <touching (sprite1 v)?> then\n        change y by (y)\n        if <touching (sprite1 v)?> then\n            change y by (y)\n        end\n    end\nend\n\nwhen I receive [c v]\nhide\n\n@Light\n\nwhen flag clicked\nhide\n\nwhen I receive [a v]\nshow\nforever\n    go [backward v] (1) layers\n    go to (player v)\nend\n\nwhen I receive [c v]\nhide\n\n@Sprite1\n\nwhen flag clicked\nhide\n\nwhen I receive [message1 v]\nnext costume\n\nwhen I receive [a v]\nshow\nswitch costume to (costume1 v)\nforever\n    if <(costume [number v]) = [20]> then\n        switch backdrop to (backdrop4 v)\n    end\n    if <(costume [number v]) = [21]> then\n        broadcast (c v)\n        hide\n        switch backdrop to (backdrop5 v)\n    end\nend\n\n@Sprite2\n\nwhen flag clicked\nhide\n\nwhen I receive [b v]\nshow\nset size to (80) %\ngo to x: (-253) y: (-73)\nwait (3) seconds\nglide (3) secs to x: (-40) y: (-73)\nsay [Is that a cave?] for (2) seconds\nsay [Let's go inside!] for (2) seconds\nglide (3) secs to x: (206) y: (-73)\nbroadcast (a v)\nhide\n\nwhen I receive [c v]\nshow\nset size to (80) %\ngo to x: (-253) y: (-75)\nsay [Yipee!We made it!] for (2) seconds\nsay [Thanks for playing! ] for (2) seconds\n\n
Check out the sequel!\nhttps://scratch.mit.edu/projects/296329755/\n**************************************************************\nThe rules are easy!\nArrow keys to move,avoid red and falling.\nPlease enjoy!\nAll 20 levels are possible!\n+++++++++++++++++++++++++++++++++++++++++\nIf there are any bugs, please let me know in the comments!\nIf you have any suggestions, you can also write them down in the comments!\n+++++++++++++++++++++++++++++++++++++++++\nCheck out my other games too!\nhttps://scratch.mit.edu/studios/4685976/projects/