Challenge ‖ a platformer 

Instructions: \n☀︎  Hey! so here is my second project, also my first platformer ;)  ☀︎\n\n\n                 ⋯INSTRUCTIONS⋯\n■arrow keys to move \n■don't touch lava, spikes or saws\n■s to skip and r to restart a level\n■enjoy (that's an order lol)\nand that's about it.. \n\n-more levels to come at 15 likes-\n\n⇨don't forget to leave a ♥︎ and ★ and check out my other project: https://scratch.mit.edu/projects/591967714/\n⇨leave some feedback in the comments\n\n\n\n\n\n<3\n#platformer #fun #challenge

@Stage\n\nwhen I receive [start v]\nswitch backdrop to (backdrop1 v)\n\nwhen backdrop switches to [backdrop3 v]\nbroadcast (endd v) and wait\nclear graphic effects\n\nclear graphic effects\n\nwhen flag clicked\nbroadcast (start v)\n\nwhen flag clicked\nforever\n    play sound [Vexento - Norway v] until done\nend\n\n@Player\n\ndefine handle ground <moving up>\nrepeat until <not >\n    if <moving up> then\n        change y by (-1)\n    else\n        change y by (1)\n        set [in air v] to [0]\n    end\n    set [y velocity v] to [0]\nend\n\ndefine walk (steps)\nchange x by (steps)\nset [ground lift v] to [0]\nrepeat until <<not <<touching (ground v)?> or <touching (draw ground v)?>>> or <(ground lift) = [8]>>\n    change y by (1)\n    change [ground lift v] by (1)\nend\nif <(ground lift) = [8]> then\n    change x by ((-1) * (steps))\n    change y by (-8)\nend\n\nwhen I receive [start v]\nset volume to (50) %\nbroadcast (set up v)\nwait (0.5) seconds\nshow\nset size to (100) %\nset rotation style [left-right v]\ngo to x: (-205) y: (-90)\nset [y velocity v] to [0]\nforever\n    change [y velocity v] by (-2)\n    change y by (y velocity)\n    change [in air v] by (1)\n    handle ground <(y velocity) > [0]>\n    if <key (left arrow v) pressed?> then\n        point in direction (-90)\n        walk [-6]\n    end\n    if <key (right arrow v) pressed?> then\n        point in direction (90)\n        walk [6]\n    end\n    if <<key (up arrow v) pressed?> and <(in air) < [8]>> then\n        set [y velocity v] to [12]\n    end\n    if <<not <key (left arrow v) pressed?>> and <not <key (right arrow v) pressed?>>> then\n    if <[239] < (x position)> then\n        go to x: (-205) y: (-90)\n        broadcast (next level v)\n    end\n    if <key (s v) pressed?> then\n        go to x: (-205) y: (-90)\n        broadcast (next level v)\n        wait (0.4) seconds\n    end\n    if <(y position) < [-170]> then\n        go to x: (-205) y: (-90)\n    end\n    if <touching (danger v)?> then\n        die\n    end\n    if <<touching (danger v)?> or <<touching (lava v)?> or <touching (saws v)?>>> then\n        die\n    end\n    if <touching (jump v)?> then\n        broadcast (trampoline v)\n        set [y velocity v] to [25]\n        start sound [Boing v]\n    end\n    if <key (r v) pressed?> then\n        go to x: (-205) y: (-90)\n    end\n    if <key (down arrow v) pressed?> then\n        switch costume to (costume2 v)\n    else\n        switch costume to (costume1 v)\n    end\n    if <touching (ladders v)?> then\n        set [y velocity v] to [0]\n        if <key (up arrow v) pressed?> then\n            set [y velocity v] to [5]\n        end\n        if <key (down arrow v) pressed?> then\n            set [y velocity v] to [-1]\n        end\n    end\nend\n\nwhen I receive [next level v]\ngo to x: (-205) y: (-90)\n\nwhen I receive [endd v]\nhide\n\nwhen I receive [start v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nrepeat (10)\n    change [color v] effect by (10)\n    change [ghost v] effect by (15)\n    change size by (-6)\nend\ndelete this clone\n\ndefine die\nbroadcast (dead v)\nstart sound [Rip v]\nswitch costume to (costume3 v)\nwait (0.5) seconds\ngo to x: (-205) y: (-90)\nswitch costume to (chosen costume)\n\n@Ground\n\nwhen I receive [next level v]\nnext costume\nforever\n    if <(costume [number v]) = [10]> then\n        broadcast (end v)\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume9 v)\nhide\n\nwhen I receive [start v]\nPosition ((x) - (SCROLL X)) ((y) - (SCROLL Y))\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [set up v]\nset [x v] to [0]\nset [y v] to [0]\nif <(level) = [1]> then\n    switch costume to (costume9 v)\nend\n\nwhen I receive [endd v]\nhide\n\n@danger\n\nwhen flag clicked\nswitch costume to (costume9 v)\nset [ghost v] effect to (10)\n\nwhen I receive [next level v]\nshow\nnext costume\n\nwhen I receive [endd v]\nhide\n\n@Text\n\nwhen I receive [next level v]\nset [ghost v] effect to (100)\nnext costume\nforever\n    change [ghost v] effect by (-10)\n    wait (0.1) seconds\nend\n\nwhen I receive [set up v]\nshow\nswitch costume to (costume1 v)\n\nwhen flag clicked\nhide\n\nwhen I receive [endd v]\nhide\n\n@Thumbnail\n\nwhen flag clicked\nforever\n    go to x: (0) y: (0)\n    go to [front v] layer\n    set [ghost v] effect to (100)\nend\n\nclear graphic effects\n\nshow\n\nwait (0.5) seconds\n\n@jump\n\nwhen flag clicked\nset [costume v] to [1]\nshow\nswitch costume to (costume7 v)\ngo to [front v] layer\nforever\n    set size to (70) %\n    set [x position v] to (x position)\n    set [y position v] to (y position)\n    if <(costume [number v]) = [3]> then\n        go to x: (-12) y: (-102)\n    end\n    if <(costume [number v]) = [6]> then\n        go to x: (197) y: (-106)\n    end\n    if <(costume [number v]) = [6]> then\n        go to x: (-178) y: (-102)\n    end\n    if <(costume [number v]) = [6]> then\n        go to x: (201) y: (-102)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\nchange [costume v] by (1)\n\nwhen I receive [trampoline v]\ngo to x: (x position) y: (y position)\nswitch costume to (costume20 v)\nwait (0.1) seconds\nswitch costume to (costume12 v)\nwait (0.2) seconds\nswitch costume to (costume13 v)\nwait (0.1) seconds\nswitch costume to (costume)\n\n@lava\n\nwhen flag clicked\ngo to [back v] layer\nshow\nswitch costume to (costume8 v)\ngo to x: (0) y: (0)\nforever\n    set size to (100) %\n    forever\n        repeat (20)\n            change y by (0.5)\n        end\n        repeat (20)\n            change y by (-0.5)\n        end\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\n@clouds\n\nwhen I start as a clone\nswitch costume to (pick random <(costume [number v]) = [1]> to <(costume [number v]) = [2]>)\ngo to [back v] layer\nshow\nchange [ghost v] effect by (pick random (25) to (85))\nchange size by (pick random (-8) to (25))\ngo to x: (360) y: (pick random (180) to (-140))\nglide (pick random (3) to (9)) secs to x: (-370) y: (y position)\ndelete this clone\n\nwhen I receive [set up v]\nhide\nforever\n    create clone of (_myself_ v)\n    wait (pick random (0.2) to (2)) seconds\nend\n\n@saws\n\nwhen flag clicked\ngo to [back v] layer\nset [costume v] to [1]\nshow\nswitch costume to (saw8 v)\nforever\n    set size to (70) %\n    set [x position v] to (x position)\n    set [y position v] to (y position)\n    forever\n        set size to (70) %\n        repeat (50)\n            turn right (5) degrees\n        end\n        repeat (50)\n            turn left (5) degrees\n        end\n        if <(costume [number v]) = [2]> then\n            go to x: (157) y: (-121)\n        end\n        if <(costume [number v]) = [7]> then\n            go to x: (-126) y: (53)\n        end\n        if <(costume [number v]) = [11]> then\n            go to x: (140) y: (70)\n        end\n    end\nend\n\nwhen I receive [next level v]\nnext costume\nchange [costume v] by (1)\n\n@lava2\n\nwhen flag clicked\ngo to [back v] layer\nshow\nswitch costume to (costume8 v)\ngo to x: (0) y: (0)\nforever\n    set size to (100) %\n    forever\n        repeat (20)\n            change y by (0.5)\n        end\n        repeat (20)\n            change y by (-0.5)\n        end\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\n@ladders\n\nwhen flag clicked\ngo to [front v] layer\nshow\nswitch costume to (costume1 v)\ngo to x: (0) y: (0)\nforever\n    set size to (100) %\n    if <(costume [number v]) = [5]> then\n        go to x: (-171) y: (49)\n    end\n    if <(costume [number v]) = [7]> then\n        go to x: (0) y: (0)\n    end\nend\n\nwhen I receive [next level v]\nnext costume\n\n@death\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [dead v]\nswitch costume to (costume2 v)\nwait (0.5) seconds\nswitch costume to (costume1 v)\n\n@sprite\n\nwhen flag clicked\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nnext costume\n\n