Desert - A Platformer #All#Games#Platformer

Instructions: Desert - A Platformer\n\n10 levels 100% possible\nplease ♥ & ★ if you love this proj :)\n- Don't forget to follow ⇨ @clemJ72\nPart 2 at 200 likes ! (97/200)\nDon't advertise please\n\nMusics\n\nMenu : 1- Fall With Me - Jim Yosef\n2- Timelapse - TheFatRat\nGame : Rollercoaster - Elektronomia ft Rud\n\nCredits\n\nCode : 85% by @clemJ72\nArt : 75% by clemJ72\nPlayer Art by @StratfordJames\nSpikes by @-Invisty (free asset)\nBackground parallax by @-Fornax-\nCode for the menu by @kodiak77-77\nMusic engine by @madrid2030\nText inspired by @madrid2030\nSun animation by me\nRest by me\n\nDemo shared in october 10, 2021 : https://scratch.mit.edu/projects/581636168/\n\nLag ? Try Turbowarp : https://turbowarp.org/712075364\n\n\n#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES#ALL#GAMES

@Stage\n\nwhen I receive [night v]\nrepeat (200)\n    change [brightness v] effect by (-0.1)\nend\n\nwhen I receive [midi v]\nwait (5) seconds\nrepeat (200)\n    change [brightness v] effect by (-0.1)\nend\n\nwhen flag clicked\nset volume to (75) %\nplay sound (pick random (2) to (3)) until done\n\nwhen I receive [rain v]\nswitch backdrop to (grunge v)\n\nwhen I receive [0 v]\nset volume to (0) %\n\nwhen I receive [100 v]\nset volume to (60) %\n\nwhen I receive [matin v]\nset [brightness v] effect to (-75)\nrepeat (250)\n    change [brightness v] effect by (0.3)\n    wait () seconds\nend\n\nwhen flag clicked\nswitch backdrop to (desert v)\n\nwhen I receive [play v]\nstop all sounds\nswitch backdrop to (bg v)\nstart sound [Elektronomia  RUD  Rollercoaster v]\nchange volume by (-40)\n\n@Player\n\ndefine fast\nrepeat (6)\n    if <touching (levels v)?> then\n        change y by (1)\n    end\nend\n\ndefine xcoll\nrepeat until <not <touching (levels v)?>>\n    if <(x) > [0]> then\n        change x by (-1)\n    else\n        change x by (1)\n    end\nend\n\ndefine ycoll\nrepeat until <not <touching (levels v)?>>\n    if <(y) > [0]> then\n        change y by (-1)\n    else\n        change y by (1)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen flag clicked\nswitch costume to (blue v)\n\nwhen I receive [someone pressed s key v]\nchange [level v] by (1)\n\nwhen I receive [message1 v]\nchange [level v] by (1)\n\nwhen I receive [play v]\nforever\n    if <(x position) > [237]> then\n        broadcast (message1 v)\n        go to x: (-223) y: (-100)\n    end\nend\n\nwhen I receive [play v]\nswitch costume to (blue v)\nset size to (50) %\nforever\n    if <<touching (spikes v)?> or <<touching (vide v)?> or <touching (saws v)?>>> then\n        go to x: (-200) y: (-100)\n        play sound [Death v] until done\n    end\nend\n\nwhen I receive [play v]\nshow\ngo to [front v] layer\n\nwhen I receive [play v]\nshow\ngo to [front v] layer\npoint in direction (90)\nset [x v] to [0]\nset [y v] to [0]\ngo to x: (-200) y: (-104)\nforever\n    change [y v] by (-1)\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 (1 v)\n        change [x v] by (0.75)\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 (2 v)\n        change [x v] by (-0.75)\n    end\n    set [x v] to ((x) * (0.9))\n    change x by (x)\n    if <touching (levels v)?> then\n        fast\n        if <touching (levels v)?> then\n            change y by (-6)\n            xcoll\n            if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n                set [y v] to [13]\n                if <([abs v] of (x) ) = (x)> then\n                    set [x v] to [-7]\n                else\n                    set [x v] to [8]\n                end\n            else\n                set [x v] to [0]\n            end\n        end\n    end\n    change y by (y)\n    if <touching (levels v)?> then\n        ycoll\n        if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> and <(y) < [0]>> then\n            set [y v] to [13]\n        else\n            set [y v] to [0]\n        end\n    end\nend\n\nwhen I receive [play v]\nset [level v] to [1]\n\n@levels\n\nwhen I receive [message1 v]\nnext costume\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nswitch costume to (00 v)\nhide variable [level v]\nforever\n    if <(level) = [6]> then\n        broadcast (cave v)\n    end\nend\n\nif <(level) = [8]> then\n\nwhen I receive [someone pressed s key v]\nnext costume\n\nwhen I receive [someone pressed skip button v]\nnext costume\n\n@spikes\n\nwhen flag clicked\nswitch costume to (00 v)\n\nwhen I receive [message1 v]\nnext costume\n\nwhen I receive [someone pressed s key v]\nnext costume\n\nwhen I receive [someone pressed skip button v]\nnext costume\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@TN\n\nwhen flag clicked\nforever\n    set [ghost v] effect to (100)\n    show\n    go to [front v] layer\nend\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\n@Vide\n\nwhen flag clicked\ngo to x: (27) y: (-43)\nshow\nset [ghost v] effect to (300)\n\n@moon\n\nwhen flag clicked\ngo to [back v] layer\nhide\n\nwhen I receive [night v]\nshow\nwait (60) seconds\nhide\nbroadcast (5h v)\n\n@sun\n\nwhen flag clicked\nshow\nbroadcast (Matin v)\ngo to x: (-234) y: (-164)\ngo to [back v] layer\nglide (60) secs to x: (-5) y: (135)\nbroadcast (Midi v)\n\nwhen I receive [midi v]\nwait (5) seconds\nglide (60) secs to x: (234) y: (-164)\nhide\nbroadcast (Night v)\n\nwhen I receive [night v]\nhide\n\nwhen I receive [5h v]\nshow\nbroadcast (Matin v)\ngo to x: (-234) y: (-164)\ngo to [back v] layer\nglide (60) secs to x: (-5) y: (135)\nbroadcast (Midi v)\n\nwhen flag clicked\ngo [backward v] (99999) layers\nswitch costume to (costume1 v)\nforever\n    if <(level) = [4]> then\n        go [backward v] (2) layers\n        switch costume to (costume2 v)\n    end\n    broadcast (Sand v)\n    if <(level) = [7]> then\n        go [backward v] (2) layers\n        switch costume to (costume3 v)\n        broadcast (lava v)\n    end\n    if <(level) = [9]> then\n        hide\n        go [backward v] (2) layers\n        switch costume to (costume1 v)\n    end\n    if <(level) = [12]> then\n        show\n        go [backward v] (2) layers\n        switch costume to (costume1 v)\n    end\nend\n\nwhen I receive [fog v]\nhide\n\n@Saws\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    if <(level) = [5]> then\n        go to x: (47) y: (-155)\n        show\n    end\n    if <(level) = [6]> then\n        go to x: (-86) y: (-160)\n        show\n    end\n    if  then\n        go to x: (0) y: (-65)\n        show\n    end\n    if <(level) = [8]> then\n        go to x: (197) y: (-100)\n        show\n    end\nend\n\nwhen flag clicked\nforever\n    turn right (Vitesse de rotation) degrees\nend\n\nwhen flag clicked\nforever\n    repeat (120)\n        set [vitesse de rotation v] to ((Vitesse de rotation) + ((Vitesse de rotation) * (0.01)))\n    end\n    repeat (120)\n        set [vitesse de rotation v] to ((Vitesse de rotation) - ((Vitesse de rotation) * (0.01)))\n    end\n    set [vitesse de rotation v] to [6]\nend\n\nwhen flag clicked\nforever\n    if <not <<(level) = [5]> or >> then\n        hide\n    end\nend\n\n@Sound\n\nwhen flag clicked\nswitch costume to (on v)\n\nwhen flag clicked\nforever\n    go to [front v] layer\nend\n\nset volume to (0) %\nswitch costume to (off v)\n\nwhen flag clicked\nhide\n\nwhen I receive [play v]\nshow\n\nwhen I receive [play v]\ngo to x: (-219) y: (156)\nforever\n    if <<(costume [number v]) = [1]> and <<<touching (mouse-pointer v)?> and <mouse down?>> or <key (m v) pressed?>>> then\n        set [volume v] to [0]\n        broadcast (0 v)\n        switch costume to (off v)\n        wait (1) seconds\n    end\n    if <<(costume [number v]) = [2]> and <<<touching (mouse-pointer v)?> and <mouse down?>> or <key (m v) pressed?>>> then\n        broadcast (100 v)\n        set [volume v] to [100]\n        switch costume to (on v)\n        wait (1) seconds\n    end\nend\n\n@Sand\n\nwhen flag clicked\nhide\n\nwhen I start as a clone\npoint in direction (pick random (0) to (360))\nshow\ngo [backward v] (1000) layers\ngo to x: (236) y: (pick random (-172) to (172))\nglide (pick random (0.5) to (1)) secs to x: (-236) y: (pick random (-172) to (172))\ndelete this clone\n\nwhen flag clicked\nforever\n    create clone of (_myself_ v)\nend\n\nif <(level) = [1]> then\nend\n\nif <(level) = [5]> then\nif <(level) = [6]> then\n    create clone of (_myself_ v)\nend\nif <(level) = [7]> then\n    create clone of (_myself_ v)\nend\nif <(level) = [8]> then\n    stop [other scripts in sprite v]\nend\n\nhide\n\n@Front\n\nwhen flag clicked\nshow\ngo to [back v] layer\n\nwhen flag clicked\nset size to (100) %\ngo to [back v] layer\nforever\n    set y to (([y position v] of [player v]) * (-0.2))\n    set x to (([x position v] of [player v]) * (-0.07))\nend\n\nforever\n    if <(level) = [x]> then\n        hide\n    end\n    if <(level) = [x+1]> then\n        show\n    end\nend\n\n@Play\n\nwhen flag clicked\nset [#1 v] to [0]\nset size to (100) %\ngo to x: (-2) y: (-18)\nset [ghost v] effect to (100)\nshow\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\n\nwhen flag clicked\npoint in direction (90)\nforever\n    set [size2 v] to ((((size) * (2)) + (((80) + (([sin v] of ((timer) * (100)) ) * (50))) + (-1))) / (2.5))\n    set size to (size2) %\nend\n\nwhen I receive [title effect v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (30)\n        if <mouse down?> then\n            broadcast (PLAY v)\n            set [#1 v] to [1]\n            hide\n            stop [this script v]\n        end\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [title effect v]\nforever\n    if <(#1) = [0]> then\n        if <touching (mouse-pointer v)?> then\n            start sound [Touch v]\n            wait until <not <touching (mouse-pointer v)?>>\n        end\n    end\nend\n\n@Name\n\nwhen flag clicked\npoint in direction (90)\nswitch costume to (costume1 v)\ngo to x: (0) y: (100)\nshow\nforever\n    point in direction ((90) - (([cos v] of ((timer) * (100)) ) * (4)))\n    set [size v] to ((((size) * (1.6)) + (((40) + (([sin v] of ((timer) * (100)) ) * (4))) + (-2))) / (2))\n    set size to (size) %\nend\n\nwhen flag clicked\nset [ghost v] effect to (100)\nwait (1) seconds\nrepeat (10)\n    change [ghost v] effect by (-10)\nend\nbroadcast (Title effect v)\n\nwhen I receive [title effect v]\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (30)\n    else\n        set [ghost v] effect to (0)\n    end\nend\n\nwhen I receive [play v]\nhide\nstop [this script v]\n\n@BG-Menu\n\nwhen flag clicked\nshow\nswitch costume to (pick random (1) to (2))\n\nwhen I receive [play v]\nhide\n\n@skip\n\nwhen flag clicked\nhide\n\nwhen flag clicked\n\nwhen I receive [someone pressed skip button v]\nchange [level v] by (1)\n\nwhen flag clicked\nforever\n    if <(level) = [11]> then\n        forever\n            hide\n            stop [other scripts in sprite v]\n        end\n    end\nend\n\nwait (9) seconds\n\nshow\n\nwhen I receive [play v]\nset [level v] to [1]\n\nwhen I receive [play v]\nshow\nset size to (100) %\nset [zine v] to [0]\ngo to x: (210) y: (150)\nforever\n    change [zine v] by (1)\n    point in direction ((90) + (([sin v] of ((zine) * (8)) ) * (3)))\n    if <touching (mouse-pointer v)?> then\n        change size by (((110) - (size)) / (2))\n    else\n        change size by (((100) - (size)) / (4))\n    end\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        repeat until <<not <touching (mouse-pointer v)?>> or <not <mouse down?>>>\n            change [zine v] by (1)\n            point in direction ((90) + (([sin v] of ((zine) * (5)) ) * (3)))\n            change size by (((90) - (size)) / (2))\n        end\n        set size to (100) %\n        wait (0) seconds\n        if <<touching (mouse-pointer v)?> and <not <([costume # v] of [levels v]) = [11]>>> then\n            broadcast (someone pressed skip button v)\n        end\n    end\nend\n\n