★  Cave || A Platformer  ★ #all #games #platformer
@Stage\n\nwhen flag clicked\nswitch backdrop to (background 1 v)\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        switch backdrop to (background 2 v)\n    else\n        switch backdrop to (background 1 v)\n    end\nend\n\n@| Thumbnail\n\nwhen flag clicked\nforever\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\nend\n\n@Player\n\nwhen I start as a clone\nswitch costume to (shadow v)\nrepeat (10)\n    change [ghost v] effect by (10)\n    change size by (-2)\nend\ndelete this clone\n\ndefine Place Player: (x) (y) Set Size To: (size)\ngo to x: (x) y: (y)\nset size to (size) %\n\ndefine Gravity, Platform Detection, Physics....\nforever\n    change [y v] by (-1)\n    if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n        change [x v] by (-1)\n    end\n    if <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> 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 (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (1)\n    end\n    if <touching (level v)?> then\n        change y by (-4)\n        change x by ((x) * (-1))\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > [0]>>> then\n            set [y v] to [17]\n            if <(x) > [0]> then\n                set [x v] to [-10]\n            else\n                set [x v] to [10]\n            end\n        else\n            set [x v] to [0]\n        end\n    end\n    change y by (y)\n    if <touching (level v)?> then\n        change y by ((y) - ((y) * (2)))\n        set [y v] to [0]\n    end\n    change y by (-1)\n    if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <((mouse y) - (y position)) > [50]>>> and <touching (level v)?>> then\n        set [y v] to [15]\n    end\n    change y by (1)\n    if <<<<touching (| obstacles v)?> or <(y position) < [-175]>> or <<touching (| lava v)?> or <touching (saw2 v)?>>> or <touching (saw1 v)?>> then\n        Place Player: [-200] [0] Set Size To: [40]\n    end\n    if <(x position) > [230]> then\n        broadcast (@cheekyscuola's Transition v)\n        wait (0.5) seconds\n        change [level v] by (1)\n        set [y v] to [0]\n        set [x v] to [0]\n        Place Player: [-200] [0] Set Size To: [40]\n    end\n    if <touching (| obstacles v)?> then\n        set [y v] to [20]\n    end\nend\n\nwhen flag clicked\nswitch costume to (1 v)\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I receive [restart v]\nPlace Player: [-200] [500] Set Size To: [40]\n\nbroadcast (@cheekyscuola's Transition v) and wait\n\nwhen flag clicked\nset [level v] to [1]\nshow\nPlace Player: [-200] [500] Set Size To: [40]\nhide variable [y v]\nhide variable [x v]\nset [y v] to [0]\nset [x v] to [0]\nforever\n    Gravity, Platform Detection, Physics....\nend\n\n@Level\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to (Level)\nend\n\n@| Obstacles\n\nwhen flag clicked\nforever\n    switch costume to (Level)\nend\n\n@| Lava\n\nwhen flag clicked\nforever\n    set y to (Magma)\n    switch costume to (Level)\n    go to [back v] layer\nend\n\nwhen flag clicked\nforever\n    set [magma v] to [0]\n    repeat (10)\n        change [magma v] by (1)\n    end\n    repeat (20)\n        change [magma v] by (-1)\n    end\n    repeat (10)\n        change [magma v] by (0.9)\n    end\nend\n\n@| Decor & Text\n\nwhen flag clicked\ngo to [front v] layer\nforever\n    switch costume to (Level)\nend\n\nwhen flag clicked\nforever\n    go to [back v] layer\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\n@| Detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\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: (50)\nreset timer\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) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\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\n@Mute Button\n\nwhen flag clicked\npoint in direction (90)\nforever\n    show\n    go to [front v] layer\n    point in direction ((([sin v] of ((timer) * (300)) ) * (6)) + (90))\nend\n\nwhen this sprite clicked\nif <(Music) = [1]> then\n    set [music v] to [0]\n    switch costume to (off v)\nelse\n    set [music v] to [1]\n    switch costume to (on v)\n    set volume to (100) %\nend\n\nwhen flag clicked\nset [music v] to [1]\n\nwhen flag clicked\nforever\n    if <(Music) = [0]> then\n        set volume to (0) %\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Music) = [1]> then\n        play sound [Raven & Kreyn - Muffin \[NCS Release\] v] until done\n    end\nend\n\n@Skip Button\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        switch costume to (2 v)\n    else\n        switch costume to (1 v)\n        repeat until <(direction) = [90]>\n            change [direction v] by (5)\n            point in direction ((([sin v] of (Direction) ) * (5)) + (90))\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <<mouse down?> and <touching (mouse-pointer v)?>> then\n        if <not <(Level) = [15]>> then\n            wait until <not <mouse down?>>\n            broadcast (Pos v)\n            change [level v] by (1)\n        end\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Level) = [10]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen flag clicked\nshow\nset [my variable v] to [80]\nset [direction v] to [0]\nset size to (100) %\ngo to x: (125) y: (150)\npoint in direction (90)\nforever\n    point in direction ((([sin v] of (Direction) ) * (3)) + (90))\n    change [direction v] by (5)\n    set size to (my variable) %\n    if <touching (mouse-pointer v)?> then\n        change [my variable v] by (3)\n    end\n    set [my variable v] to ((my variable) * (0.85))\n    change [my variable v] by (13)\nend\n\n
                         ★  Cave || A Platformer  ★\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n                                 ★ Control's ★\n                          Arrow Keys or W,A,S,D \n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\nIf You Enjoyed This Please ❤️ & ⭐ \nAlso please propose it here : https://scratch.mit.edu/studios/28715018\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n                              = CREDITS =\nSome Platformer code - @griffpatch\n@TimMcCool for the detector\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n                 Please Tell Me If I forgot Anything!\n▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬\n= Tags =\n#art\n#music\n#games\n#all\n#_InfinityCannon_\n#platformer\n#supercoolproject\n#griffpatch\n#trending\n#part2\n#platformers