Platformer v2.4 (Mobile Friendly).
@Stage\n\nwhen I receive [startgame v]\nswitch backdrop to (background v)\n\nwhen I receive [are you sure? v]\nshow\nswitch backdrop to (are you sure? v)\nforever\n    if <key (y v) pressed?> then\n        broadcast (Yes v)\n        hide\n        switch backdrop to (background v)\n    end\n    if <key (n v) pressed?> then\n        broadcast (No v)\n        hide\n        switch backdrop to (background v)\n    end\nend\n\nwhen flag clicked\nswitch backdrop to (◀skins▶ v)\n\n@ThumbNail\n\nwhen flag clicked\ngo to [front v] layer\nset [ghost v] effect to (100)\nforever\n    reset timer\nend\n\nwhen [timer v] > (0.1)\nhide variable [music + - v]\nhide variable [music v]\ngo to x: (0) y: (0)\nset size to (150) %\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\n\n@Player\n\nwhen flag clicked\nset size to (70) %\nrepeat until <(backdrop [number v]) = [1]>\n    go to x: (0) y: (0)\nend\n\nwhen flag clicked\nforever\n    if <touching color (#0dbf00)?> then\n        hide\n        go to x: (-214) y: (-137)\n        show\n    end\n    if <touching color (#ff0000)?> then\n        hide\n        go to x: (-214) y: (-137)\n        show\n    end\n    if <touching color (#ca00ff)?> then\n        set [y velocity v] to [20]\n    end\nend\n\nwhen I receive [yes v]\ngo to x: (-214) y: (-90)\n\nwhen I receive [csr v]\nnext costume\n\nwhen I receive [csl v]\nswitch costume to ((costume [number v]) - (1))\n\nwhen backdrop switches to [◀skins▶ v]\nshow\ngo to x: (0) y: (0)\nswitch costume to (skin1 v)\n\nwhen I receive [nextlvl v]\ngo to x: (-214) y: (-117)\n\nwhen backdrop switches to [background v]\nshow\n\ndefine StartGame\nset size to (40) %\nshow\nset [x velocity v] to [0]\nset [y velocity v] to [0]\ngo to x: (-214) y: (-90)\nforever\n    if <(x position) > [230]> then\n        broadcast (NextLvl v)\n        change [level v] by (1)\n        set [y velocity v] to [0]\n        set [x velocity v] to [0]\n        go to x: (-214) y: (-90)\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 [x velocity v] by (1)\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 [x velocity v] by (-1)\n    end\n    set [x velocity v] to ((x velocity) * (.9))\n    change x by (x velocity)\n    if <touching (level v)?> then\n        change y by (1)\n        if <touching (level v)?> then\n            change y by (1)\n            if <touching (level v)?> then\n                change y by (1)\n                if <touching (level v)?> then\n                    change y by (1)\n                    if <touching (level v)?> then\n                        change y by (1)\n                        if <touching (level v)?> then\n                            change x by ((x velocity) * (-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 <(x velocity) > [0]> then\n                                    set [x velocity v] to [-5]\n                                else\n                                    set [x velocity v] to [5]\n                                end\n                                set [y velocity v] to [10]\n                            else\n                                set [x velocity v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change [y velocity v] by (-1)\n    change y by (y velocity)\n    if <touching (level v)?> then\n        change y by ((y velocity) * (-1))\n        set [y velocity v] to [0]\n    end\n    change y by (-1)\n    if <touching (level 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 [y velocity v] by (15)\n        end\n    end\n    change y by (1)\nend\n\nwhen backdrop switches to [background v]\nStartGame\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@Trail\n\nwhen I start as a clone\ngo to (player v)\nshow\nset size to (40) %\nset [ghost v] effect to (0)\nrepeat (10)\n    change [ghost v] effect by (3)\n    change size by (-1)\nend\ndelete this clone\n\nwhen flag clicked\nhide\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\ngo to [back v] layer\nforever\n    switch costume to ([costume # v] of [player v])\nend\n\n@Level\n\nwhen I receive [nextlvl v]\nnext costume\n\nwhen I receive [startgame v]\nforever\n    if <key (r v) pressed?> then\n        broadcast (Are You Sure? v)\n    end\nend\n\nwhen flag clicked\nswitch costume to (costume1 v)\nhide\n\nwhen flag clicked\nif <(level) > [15]> then\n    broadcast (StopTimer v)\nend\n\nwhen I receive [startgame v]\nset [level v] to [1]\nswitch costume to (costume1 v)\n\nwhen backdrop switches to [background v]\nshow\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@Lava\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlvl v]\nnext costume\nshow\n\nwhen I receive [startgame v]\nswitch costume to (lvl1 v)\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen backdrop switches to [background v]\nshow\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@Poison\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen I receive [startgame v]\nswitch costume to (lvl1 v)\nshow\n\nwhen I receive [nextlvl v]\nnext costume\nshow\n\nwhen flag clicked\nhide\n\nwhen backdrop switches to [background v]\nshow\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@Left\n\nwhen this sprite clicked\nbroadcast (CSL v)\n\nwhen flag clicked\ngo to x: (-100) y: (0)\nshow\n\nwhen I receive [startgame v]\nhide\n\nwhen flag clicked\nset [color v] effect to (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        change [color v] effect by (-2)\n    end\nend\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@Right\n\nwhen this sprite clicked\nbroadcast (CSR v)\n\nwhen I receive [startgame v]\nhide\n\nwhen flag clicked\ngo to x: (100) y: (0)\nshow\n\nwhen flag clicked\nset [color v] effect to (0)\nforever\n    if <touching (mouse-pointer v)?> then\n        change [color v] effect by (-2)\n    end\nend\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@StartGame\n\nwhen flag clicked\ngo to x: (0) y: (-100)\nset [level v] to [0]\nhide variable [level v]\nstop [this script v]\n\nwhen this sprite clicked\nbroadcast (StartGame v)\nhide\nshow variable [level v]\nbroadcast (StartTimer v)\nstop [this script v]\n\nwhen I receive [starttimer v]\nrepeat until <(level) > [15]>\n    wait (0.1) seconds\nend\n\nwhen backdrop switches to [are you sure? v]\nhide variable [level v]\n\nwhen backdrop switches to [background v]\nshow variable [level v]\n\nwhen flag clicked\nforever\n    if <touching (mouse-pointer v)?> then\n        set size to (((125) + (size)) / (2)) %\n        set [brightness v] effect to (5)\n    else\n        set size to (((100) + (size)) / (2)) %\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen backdrop switches to [◀skins▶ v]\nshow\n\nwhen [s v] key pressed\nshow variable [level v]\n\nwhen [h v] key pressed\nhide variable [level v]\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n@Music&Names\n\nwhen [m v] key pressed\nset volume to (0) %\n\nwhen [u v] key pressed\nset volume to (100) %\n\nwhen flag clicked\nset [music + - v] to [50]\nshow variable [music + - v]\nset [music v] to [1]\nshow variable [music v]\n\nwhen flag clicked\nset volume to (100) %\nforever\n    set volume to (Music + -) %\nend\n\nwhen backdrop switches to [background v]\nhide variable [music + - v]\nhide variable [music v]\n\nwhen flag clicked\nshow\ngo to [back v] layer\nforever\n    switch costume to ([costume # v] of [player v])\nend\n\nwhen backdrop switches to [background v]\nhide\n\nwhen flag clicked\nforever\n    if <(Music) = [1]> then\n        stop all sounds\n        play sound [Alan Walker - Force v] until done\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Music) = [2]> then\n        stop all sounds\n        play sound [Lost Sky - Dreams v] until done\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Music) = [3]> then\n        stop all sounds\n        play sound [JJD - Adventure v] until done\n        wait (1) seconds\n    end\nend\n\nwhen flag clicked\nforever\n    if <(Music) = [4]> then\n        stop all sounds\n        play sound [Vicetone - United We Dance v] until done\n        wait (1) seconds\n    end\nend\n\n@Skip-Button\n\nwhen flag clicked\nhide\ngo to x: (190) y: (-165)\n\nwhen this sprite clicked\nbroadcast (NextLvl v)\nchange [level v] by (1)\n\nwhen backdrop switches to [background v]\nshow\n\nwhen backdrop switches to [background v]\nshow\nforever\n    point in direction ((([sin v] of ((timer) * (100)) ) * (5)) + (90))\nend\n\nwhen flag clicked\nforever\n    if <(level) = [16]> then\n        hide\n    end\nend\n\n@Bounce\n\nwhen flag clicked\nhide\n\nwhen I receive [nextlvl v]\nnext costume\nshow\n\nwhen I receive [startgame v]\nswitch costume to (lvl1 v)\nshow\n\nwhen flag clicked\ngo to x: (0) y: (0)\n\nwhen backdrop switches to [background v]\nshow\n\nwhen backdrop switches to [are you sure? v]\nhide\n\n
Hello this is my first platformer.\n\nStats:\n#96720 most love's on Scratch\n#91601 most fave's on Scratch\n#197404 most views on Scratch\n\n-------------------------------------------------------------------------\nLights version:\nhttps://scratch.mit.edu/projects/483082315\n\nMini version:\nhttps://scratch.mit.edu/projects/448698938\n\nPlatformer2:\nhttps://scratch.mit.edu/projects/478104399\n-------------------------------------------------------------------------\n\nRed = Lava\nGreen = Poison   \nBlack = Ground\n\nPress M to Mute|Press U to unmute.\n\nPress R to restart the level.\nAll levels are possible.\n\n10-Sprites\n3-Backdrops\n\nHAVE FUN/ENJOY :)