Cave - A platformer (Mobile friendly). v1.1 #Game #Platformer #Cave #DaveDeRave
@Stage\n\nwhen flag clicked\nforever\n    if <(level) = [15]> then\n        switch backdrop to (backdrop|light v) and wait\n    else\n        switch backdrop to (backdrop|cave v) and wait\n    end\nend\n\n@ThumbNail & Music & Variables &Skip\n\ndefine (number or text)\n\nwhen flag clicked\nswitch backdrop to (backdrop1 v)\n(pick random (1) to (2))\nif <(pick random (1) to (2)) = [2]> then\n    forever\n        play sound [Elektronomia - Energy v] until done\n        wait (1) seconds\n        play sound [Vicetone - United We Dance v] until done\n    end\nelse\n    forever\n        play sound [Vicetone - United We Dance v] until done\n        wait (1) seconds\n        play sound [Elektronomia - Energy v] until done\n    end\nend\n\nwhen flag clicked\nforever\n    change [ghost v] effect by (100)\n    go to [front v] layer\nend\n\nwhen flag clicked\nset volume to (100) %\n\nwhen [u v] key pressed\nset volume to (100) %\n\nwhen [m v] key pressed\nset volume to (0) %\n\nwhen flag clicked\nset [level v] to [1]\nset [deaths v] to [0]\nshow variable [level v]\nshow variable [deaths v]\n\nwhen [s v] key pressed\nbroadcast (NextLvl v)\nchange [level v] by (1)\n\n@detector\n\nwhen flag clicked\nhide\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (-200)\nset [timer v] to [0]\nswitch costume to (pick random (1) to (4))\nset [ghost v] effect to (100)\nrepeat until <(Timer) > [3.5]>\n    change y by ((y position) / (-10))\n    change [ghost v] effect by (-3)\nend\nset [timer v] to [0]\nrepeat until <(Timer) > [3.5]>\n    change y by (((y position) - (-150)) / (-10))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\nwhen flag clicked\nset [timer v] to [0]\nforever\n    change [timer v] by (.097)\nend\n\n@Platform\n\nwhen I receive [nextlvl v]\nnext costume\n\nwhen flag clicked\nshow\nswitch costume to (lvl1 v)\n\n@Moving platform\n\nwhen flag clicked\nhide\ngo to x: (75) y: (0)\n\nwhen flag clicked\nforever\n    show\n    if <(level) = [7]> then\n        glide (2) secs to x: (-75) y: (0)\n        glide (2) secs to x: (75) y: (0)\n    end\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [1]> or <<(level) = [2]> or <<(level) = [3]> or <<(level) = [4]> or <<(level) = [5]> or <<(level) = [6]> or <<(level) = [8]> or <<(level) = [9]> or <<(level) = [10]> or <<(level) = [11]> or <<(level) = [12]> or <<(level) = [13]> or <<(level) = [14]> or <<(level) = [15]> or <(level) = [16]>>>>>>>>>>>>>>> then\n        hide\n    end\nend\n\n@Player\n\nwhen I start as a clone\nswitch costume to (effect v)\nrepeat (10)\n    set [ghost v] effect to (10)\n    change size by (-3)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nshow\ngo to x: (-214) y: (-90)\nset [xv v] to [0]\nset [yv v] to [0]\nset [level v] to [1]\nforever\n    if <(x position) > [230]> then\n        go to x: (-214) y: (-90)\n        broadcast (NextLvl v)\n        set [yv v] to [0]\n        set [xv v] to [0]\n        change [level v] by (1)\n    end\n    if <<<<mouse down?> and <(mouse x) > (x position)>> or <key (right arrow v) pressed?>> or <key (d v) pressed?>> then\n        change [xv v] by (1)\n        switch costume to (right v)\n    end\n    if <<<<mouse down?> and <(x position) > (mouse x)>> or <key (left arrow v) pressed?>> or <key (a v) pressed?>> then\n        change [xv v] by (-1)\n        switch costume to (left v)\n    end\n    set [xv v] to ((XV) * (.9))\n    change x by (XV)\n    if <<touching (platform v)?> or <touching (moving platform v)?>> then\n        change y by (1)\n        if <<touching (platform v)?> or <touching (moving platform v)?>> then\n            change y by (1)\n            if <<touching (platform v)?> or <touching (moving platform v)?>> then\n                change y by (1)\n                if <<touching (platform v)?> or <touching (moving platform v)?>> then\n                    change y by (1)\n                    if <<touching (platform v)?> or <touching (moving platform v)?>> then\n                        change y by (1)\n                        if <<touching (platform v)?> or <touching (moving platform v)?>> then\n                            change x by ((XV) * (-1))\n                            change y by (-5)\n                            if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (w v) pressed?>> then\n                                if <(XV) > [0]> then\n                                    set [xv v] to [-5]\n                                else\n                                    set [xv v] to [5]\n                                end\n                                set [yv v] to [10]\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 (platform v)?> or <touching (moving platform v)?>> then\n        change y by ((YV) * (-1))\n        set [yv v] to [0]\n    end\n    change y by (-1)\n    if <<touching (platform v)?> or <touching (moving platform v)?>> then\n        if <<<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> or <key (w v) pressed?>> then\n            change [yv v] by (15)\n        end\n    end\n    change y by (1)\nend\n\nwhen flag clicked\nforever\n    if <touching (jumppads v)?> then\n        set [yv v] to [20]\n    end\n    if <touching (jumppads2 v)?> then\n        set [yv v] to [-20]\n    end\n    if <<touching (spike's v)?> or <<touching (lava v)?> or <touching (monster lvl 10 & 11 v)?>>> then\n        Spawn\n    end\n    if <key (r v) pressed?> then\n        Spawn\n    end\nend\n\ndefine Spawn\ngo to x: (-214) y: (-90)\nchange [deaths v] by (1)\n\nwhen flag clicked\nforever\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\nforever\n    if <(level) = [16]> then\n        hide\n        broadcast (You Won! v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [nextlvl v]\ngo to x: (-214) y: (-90)\n\n@Spike's\n\nwhen flag clicked\npoint in direction (90)\nforever\n    if <<(level) = [6]> or <(level) = [13]>> then\n        point in direction (0)\n    else\n        point in direction (90)\n    end\nend\n\nwhen I receive [nextlvl v]\nnext costume\n\nwhen flag clicked\nswitch costume to (1 v)\n\n@Lava\n\nwhen flag clicked\nforever\n    go [forward v] (1) layers\nend\n\nwhen flag clicked\nswitch costume to (lvl1 v)\n\nwhen I receive [nextlvl v]\nnext costume\n\n@Light\n\nwhen I start as a clone\ngo to (player v)\nshow\nset size to (50) %\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (3)\n    change size by (-2)\nend\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nforever\n    if <(level) = [16]> then\n        hide\n    end\nend\n\n@JumpPads\n\nwhen I receive [nextlvl v]\nnext costume\n\nwhen flag clicked\nswitch costume to (lvl1 v)\n\n@JumpPads2\n\nwhen I receive [nextlvl v]\nnext costume\n\nwhen flag clicked\nswitch costume to (lvl1 v)\n\n@NextLVL\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlvl v]\nshow\ngo to x: (530) y: (0)\nrepeat until <(x position) < [-530]>\n    change x by (-80)\nend\nhide\n\nwhen flag clicked\nforever\n    if <(level) = [16]> then\n        hide\n    end\nend\n\n@Monster LVL 10 & 11\n\nwhen flag clicked\nhide\nswitch costume to (left v)\ngo to x: (200) y: (-120)\n\nwhen flag clicked\nforever\n    if <(level) = [10]> then\n        show\n        Move\n        stop [this script v]\n    end\nend\n\ndefine Move\ngo to x: (200) y: (-120)\nforever\n    switch costume to (left v)\n    glide (2) secs to x: (-200) y: (-120)\n    switch costume to (right v)\n    glide (2) secs to x: (200) y: (-120)\n    switch costume to (left v)\nend\n\nwhen flag clicked\nforever\n    if <<(level) = [1]> or <<(level) = [2]> or <<(level) = [3]> or <<(level) = [4]> or <<(level) = [5]> or <<(level) = [6]> or <<(level) = [7]> or <<(level) = [8]> or <<(level) = [9]> or <<(level) = [12]> or <<(level) = [13]> or <<(level) = [14]> or <(level) = [15]>>>>>>>>>>>>> then\n        hide\n    end\nend\n\n@Win\n\nwhen I receive [you won! v]\nset [deaths2.0. v] to (Deaths)\nhide variable [level v]\nhide variable [deaths v]\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\nshow\nswitch costume to (blank v)\nset size to (150) %\nswitch costume to (win screen v)\nrepeat until <(size) < [101]>\n    go to [front v] layer\n    switch costume to (blank v)\n    change size by (((100) - (size)) / (7))\n    switch costume to (win screen v)\n    change [ghost v] effect by (-5)\n    set x to (((((pick random (0) to (1)) * (2)) - (1)) * ((size) - (100))) * (0.75))\n    set y to (((((pick random (0) to (1)) * (2)) - (1)) * ((size) - (100))) * (0.75))\nend\ngo to x: (0) y: (0)\nshow variable [deaths2.0. v]\n\nwhen flag clicked\nhide\nhide variable [deaths2.0. v]\n\n
___________________________________________\n(16/02/2021 - 24/02/2021) #1 on trending :O\n---------------------------------Stats---------------------------------\n#61155 most love's on Scratch\n#57121 most fave's on Scratch\n#90732 most views on Scratch\n___________________________________________\nHi, welcome to my newest game/platformer:\nCave - A platformer\nA platformer with 15 levels!\n___________________________________________\nInstructions:\n\nWAD or ➡⬅⬆ or mobile to move.\n\nPress:\nR to Restart level.\nM to Mute music.\nU to Unmute music.\nS to skip.\n\nDon't touch:\n-Spike's\n-Lava.\n___________________________________________\n-13 Sprites\n-2 Backdrops\n___________________________________________\nEnjoy! :)\n___________________________________________