space a platformer (Mobile Friendly)

Instructions: follow @anassssss\nSubscribe to my channel: https://www.youtube.com/channel/UCLAU8k-ZLk9-owj4KYaPjvQ\n///////////////////////////////////////////////////\nnew update (mobile friendly)\nnew update skins

@Stage\n\n@platformer\n\nwhen I receive [blue v]\nif <(volume) = [100]> then\n    set volume to (0) %\nelse\n    if <(volume) = [0]> then\n        set volume to (100) %\n    end\nend\n\nwhen flag clicked\nset [level v] to [0]\n\nwhen I receive [next v]\nnext costume\n\nwhen flag clicked\nswitch costume to (platformer v)\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nshow\n\nwhen I receive [start v]\nforever\n    play sound [vexento-masked-heroes-1-AHM56EBq6 \(1\) v] until done\nend\n\nwhen flag clicked\nset volume to (100) %\n\n@TN3\n\nwhen flag clicked\nforever\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    show\nend\n\nshow\ngo to [front v] layer\ngo to x: (0) y: (0)\n\n@wall\n\nwhen flag clicked\nforever\n    if <touching (player2 v)?> then\n        wait (0.01) seconds\n        change [level v] by (1)\n        broadcast (Next v)\n        wait (0.01) seconds\n    end\nend\n\nwhen flag clicked\nset [level v] to [0]\n\n@Player2\n\nwhen flag clicked\nforever\n    \n        \n            set [mode v] to [jump]\n            set [yv v] to [9]\n            wait (1.7) seconds\n        end\n    end\nend\n\nwhen I receive [start v]\ngo to x: (-189) y: (-111)\npoint in direction (-90)\nshow\n\nwhen flag clicked\nforever\n    switch costume to (PlayerSkin?)\nend\n\nwhen flag clicked\nhide\ngo to x: (-12) y: (-999)\n\nwhen this sprite clicked\nswitch costume to (costume2 v)\n\nwhen I receive [normal v]\nswitch costume to (normal v)\n\nwhen I receive [red v]\nswitch costume to (red v)\n\nwhen I receive [orange v]\nswitch costume to (orange v)\n\nwhen I receive [yellow v]\nswitch costume to (yellow v)\n\nwhen I receive [green v]\nswitch costume to (green v)\n\nwhen I receive [lightblue v]\nswitch costume to (lightblue v)\n\nwhen I receive [blue v]\nswitch costume to (blue v)\n\nwhen I receive [purple v]\nswitch costume to (purple v)\n\nwhen I receive [pink v]\nswitch costume to (pink v)\n\nwhen flag clicked\nswitch costume to (normal v)\nset [back v] to [0]\n\nwhen I receive [start v]\nhide\n\nwhen flag clicked\nforever\n    if <touching (play v)?> then\n        wait (0.00001) seconds\n        go to x: (-181) y: (-109)\n    end\nend\n\nwhen flag clicked\nforever\n    if <(y position) > [-10]> then\n        if <(level) = [1]> then\n            broadcast (yo v)\n            stop [this script v]\n        end\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <touching (wall v)?> then\n        wait (0.00000001) seconds\n        go to x: (-209) y: (-96)\n    end\nend\n\nwhen I receive [start v]\nforever\n    if <mouse down?> then\n        if <(mouse x) < (x position)> then\n            point in direction (90)\n            change [xv v] by (-1)\n        end\n        if <mouse down?> then\n            if <(mouse x) > (x position)> then\n                point in direction (-90)\n                change [xv v] by (1)\n            end\n        end\n    end\nend\n\nwhen I receive [start v]\nshow\ngo to x: (-222) y: (-96)\nset [xv v] to [0]\nset [yv v] to [0]\nforever\n    if <touching color (#b200ff)?> then\n        set [mode v] to [jump]\n        set [yv v] to [17]\n    end\n    if <<key (r v) pressed?> and <key (g v) pressed?>> then\n        wait until <not <<key (g v) pressed?> and <key (r v) pressed?>>>\n        go to x: (-209) y: (-96)\n        set [xv v] to [0]\n        set [yv v] to [0]\n        broadcast (Restart v)\n    end\n    if <key (r v) pressed?> then\n        if <not <key (g v) pressed?>> then\n            wait until <not <key (r v) pressed?>>\n            go to x: (-209) y: (-96)\n            set [xv v] to [0]\n            set [yv v] to [0]\n        end\n    end\n    go to [front v] layer\n    if <(back) = [1]> then\n        hide\n        stop [this script v]\n    end\n    if <(x position) > [235]> then\n        broadcast (Next v)\n        set x to (-222)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <<(y position) < [-175]> or <touching color (#ff0000)?>> then\n        go to x: (-209) y: (-96)\n        set [xv v] to [0]\n        set [yv v] to [0]\n    end\n    if <<key (left arrow v) pressed?> or <key (a v) pressed?>> then\n        point in direction (90)\n        change [xv v] by (-1)\n    end\n    if <<key (right arrow v) pressed?> or <key (d v) pressed?>> then\n        point in direction (-90)\n        change [xv v] by (1)\n    end\n    set [xv v] to ((xv) * (0.85))\n    change x by (xv)\n    if <touching color (#000008)?> then\n        change y by (-2)\n        if <touching color (#000008)?> then\n            change y by (1)\n            if <touching color (#000008)?> then\n                change y by (1)\n                if <touching color (#000008)?> then\n                    change y by (1)\n                    if <touching color (#000008)?> then\n                        change y by (1)\n                        if <touching color (#000008)?> then\n                            change y by (1)\n                            if <touching color (#000008)?> then\n                                change y by (-5)\n                                change x by ((-1) * (xv))\n                                if <<<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(y position) < (mouse y)>>>> and <not <(xv) = [0]>>> then\n                                    set [mode v] to [walljump]\n                                    set [yv v] to [8]\n                                    set [xv v] to (((xv) / ([abs v] of (xv) )) * (-10))\n                                else\n                                    set [mode v] to [wallslide]\n                                    set [xv v] to [0]\n                                end\n                            end\n                        end\n                    end\n                end\n            end\n        end\n        change y by (2)\n    end\n    change y by (-3)\n    if <touching color (#000008)?> then\n        if <(yv) = [-3]> then\n            if <<key (left arrow v) pressed?> or <key (right arrow v) pressed?>> then\n                set [mode v] to [run]\n            else\n                if <([abs v] of (xv) ) > [.1]> then\n                    set [mode v] to [skid]\n                else\n                    set [mode v] to [stand]\n                end\n            end\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n            set [mode v] to [jump]\n            set [yv v] to [9]\n        end\n    end\n    if <<<<(mode) = [jump]> or <(mode) = [walljump]>> and <(yv) < [0]>> or <<<(mode) = [run]> or <(mode) = [skid]>> and <(yv) < [-3]>>> then\n        set [mode v] to [fall]\n    end\n    change y by (3)\n    if <(yv) > [-15]> then\n        change [yv v] by (-0.5)\n    end\n    change y by (-2)\n    if <not <touching color (#000008)?>> then\n        change y by (-1)\n        if <not <touching color (#000008)?>> then\n            change y by (-1)\n            if <not <touching color (#000008)?>> then\n                change y by (-1)\n                if <not <touching color (#000008)?>> then\n                    change y by (-1)\n                    if <not <touching color (#000008)?>> then\n                        change y by (-1)\n                        if <not <touching color (#000008)?>> then\n                            change y by (5)\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\n    change y by (yv)\n    if <touching color (#000008)?> then\n        change y by (-2)\n        if <touching color (#000008)?> then\n            change y by ((-1) * (yv))\n            set [yv v] to [-3]\n        end\n        change y by (2)\n    end\nend\n\n@Introoooo\n\nwhen I start as a clone\nif <<(costume [number v]) = [2]> and <(x position) > [0]>> then\n    set size to (250) %\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    repeat (42)\n        change [ghost v] effect by (-0.5)\n        turn left (0.9) degrees\n    end\n    set [indiv. turn v v] to [0]\n    forever\n        point in direction (((150) - ((42) * (0.9))) - (([sin v] of ((Indiv. Turn V) * (100)) ) * (15)))\n        go to [front v] layer\n        change [indiv. turn v v] by (0.03)\n    end\nend\n\nwhen I start as a clone\nif <<(costume [number v]) = [2]> and <(x position) < [0]>> then\n    set size to (250) %\n    show\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    repeat (42)\n        change [ghost v] effect by (-0.5)\n        turn left (-0.9) degrees\n    end\n    set [indiv. turn v v] to [0]\n    forever\n        point in direction (((30) + ((42) * (0.9))) + (([sin v] of ((Indiv. Turn V) * (100)) ) * (15)))\n        go to [front v] layer\n        change [indiv. turn v v] by (0.03)\n    end\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [2]> then\n    wait (1.4) seconds\n    repeat (6)\n        change [ghost v] effect by (-10)\n    end\n    repeat (100)\n        change [ghost v] effect by (0.6)\n    end\nend\n\nwait (0) seconds\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    set [indiv. yv v] to [-5]\n    hide\n    wait (1) seconds\n    point in direction (90)\n    set size to (100) %\n    go to x: (0) y: (300)\n    show\n    go to [front v] layer\n    clear graphic effects\n    set [brightness v] effect to (-100)\n    repeat (10)\n        change [brightness v] effect by (8)\n        change [indiv. yv v] by (-3)\n        change y by (Indiv. Yv)\n    end\n    wait until <(timer) > [1.4]>\n    set [indiv. yv v] to [20]\n    repeat (4)\n        switch costume to (dust v)\n        go to x: (-50) y: (-40)\n        create clone of (_myself_ v)\n        go to x: (50) y: (-40)\n        create clone of (_myself_ v)\n        switch costume to (will logo glow under v)\n        Make lots o particles\n    end\n    repeat (4)\n        repeat (9)\n            Make lots o particles\n        end\n    end\nend\n\nwhen flag clicked\nswitch costume to (background darkness v)\ngo to [front v] layer\nif <(Intro Already Been Played) = [0]> then\n\nwhen I start as a clone\nif <(costume [number v]) = [3]> then\n    wait until <(timer) > [2.7]>\n    point in direction (90)\n    switch costume to (logo glow. loglow v)\n    create clone of (_myself_ v)\n    switch costume to (will glow v)\n    create clone of (_myself_ v)\n    switch costume to (will logo glow under v)\n    repeat (12)\n        change [brightness v] effect by (2)\n    end\n    repeat (3)\n        change [brightness v] effect by (2)\n        switch costume to (particle v)\n        create clone of (_myself_ v)\n        switch costume to (will logo glow under v)\n    end\n    wait (0.25) seconds\n    repeat (25)\n        change [brightness v] effect by (-1)\n    end\nend\n\ndelete this clone\n\nwhen I start as a clone\nif <<(costume [number v]) = [6]> or <(costume [number v]) > [12]>> then\n    set rotation style [don't rotate v]\n    go to x: (pick random (-240) to (240)) y: (-170)\n    set [ghost v] effect to (0)\n    set [indiv. xv v] to (pick random (-5) to (5))\n    set [indiv. yv v] to (pick random (5) to (14))\n    repeat (100)\n        change [ghost v] effect by (1)\n        set [brightness v] effect to ((100) - ((distance to [introoooo v]) * (0.75)))\n        change y by (Indiv. Yv)\n        change x by (Indiv. Xv)\n        change [indiv. xv v] by (pick random (-1) to (1))\n        change [indiv. yv v] by (pick random (-1) to (0.8))\n        if <touching (_edge_ v)?> then\n            delete this clone\n        end\n        if <<(timer) > [2.9]> and <(timer) < [3.9]>> then\n            point towards (introoooo v)\n            change [indiv. xv v] by (([sin v] of (direction) ) * (-3))\n            change [indiv. yv v] by (([cos v] of (direction) ) * (-3))\n            set [indiv. xv v] to ((Indiv. Xv) * (0.9))\n            set [indiv. yv v] to ((Indiv. Yv) * (0.8))\n        end\n    end\nend\n\nwhen I start as a clone\nif <<(costume [number v]) = [7]> or <(costume [number v]) = [12]>> then\n    if <(costume [number v]) = [12]> then\n        set size to (100) %\n        go to x: (0) y: (80)\n    end\n    show\n    clear graphic effects\n    go to [front v] layer\n    set [ghost v] effect to (100)\n    repeat (15)\n        change [ghost v] effect by (-7)\n        change [brightness v] effect by (5)\n    end\n    wait (0.25) seconds\n    repeat (25)\n        change [ghost v] effect by (4)\n        change [brightness v] effect by (-2)\n    end\nend\n\nwhen I receive [intro disappear v]\nrepeat (20)\n    change [brightness v] effect by (-5)\nend\nif <<(costume [number v]) = [1]> or <(costume [number v]) = [11]>> then\n    switch costume to (background darkness v)\n    repeat (10)\n        change [ghost v] effect by (10)\n    end\n    broadcast (right after intro v)\nelse\n    stop [other scripts in sprite v]\n    delete this clone\nend\n\nwhen I start as a clone\nif <(costume [number v]) = [5]> then\n    set size to (pick random (50) to (100)) %\n    set [indiv. turn v v] to (pick random (-10) to (10))\n    if <(x position) > [2]> then\n        set [indiv. yv v] to (pick random (4) to (15))\n        set [indiv. xv v] to (pick random (55) to (35))\n    else\n        set [indiv. yv v] to (pick random (4) to (15))\n        set [indiv. xv v] to (pick random (-55) to (-35))\n    end\n    show\n    set [ghost v] effect to (90)\n    repeat (60)\n        set [indiv. yv v] to ((Indiv. Yv) * (0.95))\n        set [indiv. xv v] to ((Indiv. Xv) * (0.75))\n        change x by (Indiv. Xv)\n        change y by (Indiv. Yv)\n        turn right (Indiv. Turn V) degrees\n        change [ghost v] effect by (0.35)\n        change size by (6)\n    end\n    delete this clone\nend\n\ndefine Make lots o particles\npoint in direction (90)\ngo to x: (pick random (Indiv. Yv) to ((Indiv. Yv) * (-1))) y: ((-8) + (pick random (Indiv. Yv) to ((Indiv. Yv) * (-1))))\nset [indiv. yv v] to ((Indiv. Yv) * (0.8))\nswitch costume to (Indiv. Turn V)\ncreate clone of (_myself_ v)\nswitch costume to (will logo glow under v)\n\nwhen flag clicked\nset [indiv. turn v v] to [Particle]\n\nwhen I receive [start v]\nset [intro already been played v] to [1]\n\nswitch costume to (goodbye, thanks! :d v)\nshow\nclear graphic effects\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\n\nswitch costume to (resizer v)\nset size to (100) %\nshow\nclear graphic effects\ngo to [front v] layer\ngo to x: (0) y: (0)\nswitch costume to (thumbnail v)\nset [intro already been played v] to [0]\n\n@Skins\n\nwhen flag clicked\nswitch costume to (costume1 v)\ngo to x: (0) y: (-119)\nshow\nforever\n    if <<touching (mouse-pointer v)?> and <mouse down?>> then\n        next costume\n        wait until <not <mouse down?>>\n    end\n    set [playerskin? v] to (costume [number v])\nend\n\nwhen I receive [start v]\nhide\nstop [other scripts in sprite v]\nstop [this script v]\n\n@play\n\nwhen this sprite clicked\nbroadcast (start v)\nhide\n\nwhen flag clicked\nshow\n\nwhen flag clicked\nforever\n    change [color v] effect by (2)\nend\n\n@الكائن 3\n\nwhen flag clicked\nswitch costume to (screenshot_2020-06-27 scratch - imagine, program, share v)\n\nwhen this sprite clicked\nnext costume\nbroadcast (blue v)\n\n