The Dark Cave (a platformer sequel)  ⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀⠀ #all #timmccool

Instructions: The Dark Cave - a mobile platformer by @TimMcCool\nPlay in fullscreen\n\nHow to play:\nArrow keys or tap to move. Avoid saws and don't fall into holes. Complete all 13 levels!\n\n01/19/20 - shared\n\nCredits:\nArt - 100% by me in Scratch vector editor\nCoding - 95% by me\n- Thanks to @antiquark for the interactive grass engine\nMusic: The music is called "intimidation". I have it from that YouTube Video: https://www.youtube.com/watch?v=TrRL2pR4IoQ\nInspired by Limbo, @griffpatch_tutor, @--Explosion--, @antiquark, @Qalmar (@-Imagineer-) and many other scratchers

@Stage\n\nwhen flag clicked\nforever\n    play sound [# v] until done\nend\n\nwhen flag clicked\nforever\n    broadcast (scrolling b ground v)\nend\n\n@player\n\nwhen flag clicked\ngo to x: (159) y: (69)\n\nwhen I receive [scrolling b ground v]\nif <(paused) = [0]> then\n    show\n    change [y v] by (-1)\n    if <<<(x position) > (mouse x)> and <mouse down?>> or <key (left arrow v) pressed?>> then\n        change [x v] by (-0.7)\n    end\n    if <<<(x position) < (mouse x)> and <mouse down?>> or <key (right arrow v) pressed?>> then\n        change [x v] by (0.7)\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 (1)\n    end\n    if <touching (ground v)?> then\n        change y by (-5)\n        change x by ((x) * (-1))\n        if <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>> then\n            set [y v] to [10]\n            if <([abs v] of (x) ) = (x)> then\n                set [x v] to [-20]\n            else\n                set [x v] to [20]\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 [1]\n    end\n    change y by (-2)\n    if <<touching (ground v)?> and <<key (up arrow v) pressed?> or <<(mouse y) > (y position)> and <mouse down?>>>> then\n        set [y v] to [15]\n    end\n    change y by (2)\n    if <(y position) > [180]> then\n        set [y v] to [0]\n    end\n    if <<[-175] > (y position)> or <touching (figur7 v)?>> then\n        set [x v] to [0]\n        set [y v] to [0]\n        go to x: (-239) y: (0)\n    end\n    if <(x position) > [230]> then\n        if <not <(Level) = [13]>> then\n            set [x v] to [0]\n            set [y v] to [0]\n            broadcast (slide v)\n            go to x: (-239) y: (0)\n            hide\n        end\n    end\nend\n\nwhen I receive [scrolling b ground v]\ngo to [front v] layer\ngo [backward v] (1) layers\nif <touching (mouse-pointer v)?> then\n    set [ghost v] effect to (60)\nelse\n    set [ghost v] effect to (30)\nend\n\nwhen flag clicked\ngo to x: (-164) y: (-88)\npoint in direction (90)\nshow\nset [level v] to [0]\n\nwhen I receive [slide v]\nset [paused v] to [1]\nhide\nwait (0.5) seconds\nbroadcast (levelup v)\nwait (0.5) seconds\nchange [level v] by (1)\nwait (1.5) seconds\nset [paused v] to [0]\nshow\n\nwhen flag clicked\nforever\n    switch costume to (kostüm1 v)\n    if <key (up arrow v) pressed?> then\n        repeat (10)\n            next costume\n        end\n    end\nend\n\nwhen flag clicked\nset [paused v] to [1]\nhide\nwait (2) seconds\nset [paused v] to [0]\n\n@grass\n\ndefine Grass from (xpos1) to (xpos2)\nshow\ngo to x: (xpos1) y: (0)\npoint in direction (90)\nrepeat until <(x position) > (xpos2)>\n    set size to (100) %\n    switch costume to (pick random (1) to (5))\n    create clone of (_myself_ v)\n    change x by (20)\nend\nhide\n\nwhen I start as a clone\nshow\nGrass\nforever\n    if <<touching (player v)?> or <touching (mouse-pointer v)?>> then\n        Sway\n    end\nend\n\ndefine Grass\nset [ghost v] effect to (50)\nif <touching (ground v)?> then\n    repeat until <<not <touching (ground v)?>> or <touching (_edge_ v)?>>\n        change y by (1)\n    end\n    if <touching (_edge_ v)?> then\n        delete this clone\n    end\n    change x by (-4)\nelse\n    repeat until <touching (ground v)?>\n        change y by (-5)\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n    end\n    change y by (-10)\nend\n\ndefine Sway\nset [magnitude v] to (((xmotion) + (pick random (-15) to (5))) * (2))\nset [sway v] to [0]\nrepeat until <<[0] = (round ((Magnitude) * (2)))> or < and <([abs v] of (Magnitude) ) < ([abs v] of ((xmotion) * (2)) )>>>\n    point in direction ((90) - (([sin v] of (sway) ) * (Magnitude)))\n    change [sway v] by (-10)\n    set [magnitude v] to ((0.9) * (Magnitude))\nend\n\n\n\ndefine flower at (xpos)\ngo to x: (xpos) y: (0)\nswitch costume to (3 v)\ncreate clone of (_myself_ v)\n\nwhen I receive [scrolling b ground v]\n\nwhen flag clicked\nbroadcast (start v)\n\nnew chain at [-14] [249]\n\nwhen I receive [levelup v]\ndelete this clone\n\nwhen I receive [start v]\nwait until <(Level) = [1]>\nGrass from [-245] to [216]\nwait until <(Level) = [2]>\nGrass from [-245] to [-28]\nwait until <(Level) = [3]>\nGrass from [-245] to [-180]\nGrass from [139] to [216]\n\nwhen I receive [start v]\nwait until <(Level) = [5]>\nGrass from [-245] to [-28]\nwait until <(Level) = [6]>\nGrass from [-245] to [215]\nwait until <(Level) = [8]>\nGrass from [-245] to [216]\nswitch backdrop to (bühnenbild3 v)\nwait until <(Level) = [9]>\nGrass from [-245] to [-44]\nwait until <(Level) = [10]>\nGrass from [-245] to [216]\n\nwhen flag clicked\nwait until <(Level) = [11]>\nGrass from [-245] to [216]\nwait until <(Level) = [12]>\nGrass from [-245] to [216]\nwait until <(Level) = [13]>\nGrass from [-245] to [216]\n\nwhen I receive [thumbnail v]\ndelete this clone\n\n@Figur7\n\nwhen flag clicked\nbroadcast (start v)\nhide\n\ndefine new saw at level (level) position (x) (y) type (type)\nif <(type) = [1]> then\n    if <(Level) = (level)> then\n    go to x: (x) y: (y)\n    create clone of (_myself_ v)\nelse\n    if <(type) = [2]> then\n        if <(Level) = (level)> then\n        wait (0.1) seconds\n        go to x: (x) y: (y)\n        show\n        forever\n            if <(Level) = (level)> then\n                repeat (60)\n                    change x by (5)\n                    turn right (15) degrees\n                end\n                repeat (60)\n                    change x by (-5)\n                    turn right (15) degrees\n                end\n                go to x: (x) y: (y)\n            end\n        end\n    else\n        if <(Level) = (level)> then\n        wait (0.1) seconds\n        forever\n            if <(Level) = (level)> then\n                show\n                go to x: (x) y: (180)\n                repeat (30)\n                    change y by (-10)\n                    turn right (15) degrees\n                end\n                go to x: (y) y: (-180)\n                repeat (30)\n                    change y by (10)\n                    turn right (15) degrees\n                end\n            end\n        end\n    end\nend\n\nwhen I start as a clone\nshow\ngo to [front v] layer\nforever\n    point in direction ((([sin v] of ((timer) * (Rot Velocity)) ) * ((Rot Velocity) * (0.5))) + (90))\nend\n\nwhen I receive [levelup v]\nhide\ndelete this clone\n\nwhen flag clicked\nnew saw at level [2] position [32] [-148] type [1]\nnew saw at level [2] position [87] [-148] type [1]\nnew saw at level [2] position [142] [-148] type [1]\nnew saw at level [4] position [64] [141] type [1]\nnew saw at level [5] position [-20] [-132] type [1]\nnew saw at level [5] position [59] [-150] type [1]\nnew saw at level [5] position [109] [-150] type [1]\nnew saw at level [5] position [159] [-150] type [1]\nnew saw at level [5] position [209] [-150] type [1]\nnew saw at level [7] position [-33] [73] type [1]\nnew saw at level [7] position [59] [-135] type [3]\n\npoint in direction ((([sin v] of ((timer) * (Rot Velocity)) ) * ((Rot Velocity) * (0.5))) + (90))\n\nwhen I receive [start v]\nwait until <(Level) = [8]>\nstop [other scripts in sprite v]\nnew saw at level [8] position [-129] [-143] type [2]\n\nwhen I receive [thumbnail v]\ndelete this clone\n\nwhen I receive [levelup v]\nnew saw at level [11] position [20] [-135] type [1]\n\nwhen I receive [levelup v]\nnew saw at level [9] position [104] [-179] type [1]\n\n@ground\n\nwhen I receive [levelup v]\nnext costume\n\nwhen I receive [start v]\ngo to x: (0) y: (0)\nswitch costume to (1 v)\nset [ghost v] effect to (0)\n\nwhen I receive [scrolling b ground v]\ngo to [front v] layer\n\nwhen I receive [thumbnail v]\nswitch costume to (thumb v)\n\n@Figur3\n\nwhen flag clicked\n\nwhen I receive [levelup v]\nnext costume\n\nwhen I receive [start v]\nshow\nswitch costume to (1 v)\nset [ghost v] effect to (14)\ngo to x: (0) y: (0)\npoint in direction (90)\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (40)\n    else\n        set [ghost v] effect to (30)\n    end\nend\n\nwhen flag clicked\nswitch costume to (de v)\n\nwhen I receive [thumbnail v]\nswitch costume to (thumb v)\n\n@particle effects\n\nwhen I start as a clone\ngo to (player v)\nshow\ngo to [front v] layer\nset [ghost v] effect to (60)\nswitch costume to (dot v)\nset size to (pick random (10) to (30)) %\nset [brightness v] effect to (0)\nset [cy2 v] to (pick random (20) to (30))\nset [cx1 v] to (pick random (-5) to (5))\nrepeat until <touching (_edge_ v)?>\n    change x by (cx1)\n    change y by (cy2)\n    change [cy2 v] by (-2)\nend\ndelete this clone\n\nwhen I receive [levelup v]\ndelete this clone\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\n    wait (0.5) seconds\nend\n\n@Figur5\n\nwhen flag clicked\nshow\nclear graphic effects\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\nwhen I receive [scrolling b ground v]\ngo to [front v] layer\n\nwhen flag clicked\n\nwhen I receive [slide v]\nshow\nset [ghost v] effect to (100)\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nwait (2) seconds\nrepeat (10)\n    change [ghost v] effect by (10)\nend\n\n@Figur6\n\nwhen I start as a clone\nforever\n    show\n    set [ghost v] effect to (30)\n    point in direction (90)\n    forever\n        point in direction ((([sin v] of ((timer) * (Rot Velocity)) ) * ((Rot Velocity) * (0.01))) + (90))\n        if <touching (mouse-pointer v)?> then\n            set [ghost v] effect to (60)\n        else\n            set [ghost v] effect to (50)\n        end\n    end\nend\n\ndefine new chain at (x) (y)\ngo to x: (x) y: (y)\ncreate clone of (_myself_ v)\n\nwhen flag clicked\nhide\nwait until <(Level) = [1]>\nnew chain at [-10] [213]\nnew chain at [20] [162]\nnew chain at [50] [127]\nnew chain at [80] [171]\nnew chain at [110] [222]\nwait until <(Level) = [2]>\nnew chain at [-154] [303]\nnew chain at [-183] [272]\nnew chain at [-217] [242]\nnew chain at [54] [157]\nnew chain at [94] [157]\nwait until <(Level) = [3]>\nnew chain at [-165] [193]\nnew chain at [-135] [252]\nnew chain at [-105] [223]\nnew chain at [74] [163]\nwait until <(Level) = [4]>\nnew chain at [-225] [280]\nnew chain at [-195] [240]\nnew chain at [-165] [220]\nnew chain at [-135] [250]\nnew chain at [-105] [220]\nnew chain at [-74] [240]\nnew chain at [-44] [230]\nnew chain at [-14] [270]\nnew chain at [130] [245]\nwait until <(Level) = [5]>\nnew chain at [-216] [227]\nwait until <(Level) = [6]>\nswitch backdrop to (bühnenbild2 v)\nnew chain at [-30] [213]\nnew chain at [20] [200]\nnew chain at [70] [213]\nwait until <(Level) = [7]>\nnew chain at [-221] [136]\nnew chain at [155] [72]\nwait until <(Level) = [8]>\nnew chain at [-10] [213]\nnew chain at [20] [162]\nnew chain at [50] [127]\nnew chain at [80] [171]\nnew chain at [110] [222]\nwait until <(Level) = [9]>\nnew chain at [-225] [280]\nnew chain at [-195] [240]\nnew chain at [-165] [220]\nnew chain at [-135] [250]\nnew chain at [-105] [220]\nnew chain at [-74] [240]\nnew chain at [-44] [230]\nnew chain at [-14] [270]\nnew chain at [96] [171]\n\nwhen I receive [start v]\nset [level v] to [1]\n\nwhen I receive [levelup v]\nwait (0.5) seconds\ndelete this clone\n\nwhen flag clicked\nswitch backdrop to (bühnenbild1 v)\n\n@Grunge\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\nset [ghost v] effect to (85)\nrepeat until <(timer) > [5]>\n\n@title\n\nwhen flag clicked\nhide\nset [ghost v] effect to (20)\n\n@glow\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    wait (0.7) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\ngo to (random position v)\ngo to [back v] layer\nshow\nswitch costume to (1 v)\nset [ghost v] effect to (100)\nrepeat (40)\n    change [ghost v] effect by (-1)\nend\nrepeat (40)\n    change [ghost v] effect by (1)\nend\ndelete this clone\n\n@fog\n\nwhen flag clicked\nset [ghost v] effect to (90)\ngo to x: (10) y: (0)\nshow\ncreate clone of (_myself_ v)\nforever\n    change x by (-1)\n    if <(x position) = [-420]> then\n        hide\n    end\nend\n\nwhen I start as a clone\nshow\nset x to (420)\nforever\n    change x by (-1)\n    if <(x position) = [10]> then\n        create clone of (_myself_ v)\n    end\n    if <(x position) = [-420]> then\n        delete this clone\n    end\nend\n\nwhen I start as a clone\nset [ghost v] effect to (90)\n\nwhen flag clicked\nset [title y change vl v] to [-10]\nforever\n    repeat (50)\n        change [title y change vl v] by (0.25)\n    end\n    repeat (50)\n        change [title y change vl v] by (-0.25)\n    end\nend\n\n@//📊 Scratch Analytics by @TimMcCool2\n\ndefine Send Data (payload)\nset [☁ to_host v] to (payload)\n\ndefine Encode (input)\nset [//output v] to []\nset [i v] to [0]\nrepeat (length of (input))\n    change [i v] by (1)\n    switch costume to (join [=] (letter (i) of (input)))\n    set [//output v] to (join (//output) (costume [number v]))\nend\n\nwhen flag clicked\nwait (0.6) seconds\nEncode (join (username) (join [,] (join (current [hour v]) (join [,] []))))\nSend Data (//output)\n\n