Burger platformer By MohamadBD (Mobile friendly)

Instructions: Really proud of this project my most popular so far!!\nHit green flag 2 times to activate Press Arrow keys or W,A,D and Space bar to move or joystick\n #20 Trending on tutorial page? thank you so much!\n➣ New Music and settings update!!\n➣ New Mobile friendly update!!\n➣ New Spikes Updated!!

@Stage\n\nwhen flag clicked\nset [volume v] to [100]\nset [timer v] to [0]\nset [pitch v] effect to (0)\nset volume to (100) %\nforever\n    play sound [1 v] until done\nend\n\nwhen I receive [start game v]\nreset timer\nforever\n    set [timer v] to (timer)\n    if <(Level) = [13]> then\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\nforever\n    set volume to (Volume) %\nend\n\n@Player\n\nwhen I receive [makeplayerfollowhitbox v]\ngo to (hitbox v)\n\nwhen flag clicked\nset [☁ world record v] to (Timer)\nerase all\nswitch costume to (costume1 v)\nset rotation style [left-right v]\npoint in direction (90)\nforever\n    stamp\n    if <key (m v) pressed?> then\n        broadcast (no music! v)\n    end\n    if <<key (m v) pressed?> and <(volume) = [0]>> then\n        broadcast (Turn music! v)\n    end\n    if <key (d v) pressed?> then\n        switch costume to ((costume [number v]) + (1))\n        point in direction (90)\n    else\n        if <key (a v) pressed?> then\n            switch costume to ((costume [number v]) - (1))\n            point in direction (-90)\n        else\n            switch costume to (costume1 v)\n        end\n    end\n    wait (0.04) seconds\nend\n\n@Hitbox\n\nwhen flag clicked\nshow\nset size to (50) %\nset [spawnx v] to [-203]\nset [spawny v] to [-71]\ngo to x: (SpawnX) y: (SpawnY)\nset rotation style [left-right v]\nset [my variable2 v] to [0]\nset [yvelocity v] to [0]\nset [ghost v] effect to (100)\n\ndefine Up/Down Movement (jump height) (fall speed)\nchange y by (yVelocity)\nif <touching (level v)?> then\n    CheckTouchingLava\n    repeat ([ceiling v] of ([abs v] of (yVelocity) ) )\n        if <touching (level v)?> then\n            change y by (((yVelocity) / ([abs v] of (yVelocity) )) * (-1))\n        end\n    end\n    if <<not <(yVelocity) > [0]>> and <<key (space v) pressed?> or <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <(STICK Y) > [0.2]>>>>> then\n        set [yvelocity v] to (jump height)\n    else\n        set [yvelocity v] to [0]\n    end\nelse\n    change [yvelocity v] by (fall speed)\nend\n\ndefine Right/Left Movement (move speed) (drag)\nchange x by (xVelocity)\nif <touching (level v)?> then\n    CheckTouchingLava\n    repeat ([ceiling v] of ([abs v] of (xVelocity) ) )\n        if <touching (level v)?> then\n            change x by (((xVelocity) / ([abs v] of (xVelocity) )) * (-1))\n        end\n    end\n    set [xvelocity v] to [0]\nend\nif <<key (d v) pressed?> or <<key (right arrow v) pressed?> or <(STICK X) > [0.2]>>> then\n    set [xvelocity v] to (move speed)\nelse\n    if <<key (a v) pressed?> or <<key (left arrow v) pressed?> or <(STICK X) < [-0.2]>>> then\n        set [xvelocity v] to ((move speed) * (-1))\n    end\nend\nset [xvelocity v] to ((xVelocity) * (drag))\n\ndefine CheckNextLevel\nif <(x position) > [241]> then\n    broadcast (Next Level v)\n    go to x: (SpawnX) y: (SpawnY)\nend\n\ndefine CheckTouchingLava\nif <touching color (#ff6300)?> then\n    go to x: (SpawnX) y: (SpawnY)\nend\n\ndefine CheckFallOfScreen\nif <(y position) < [-173]> then\n    go to x: (SpawnX) y: (SpawnY)\nend\n\nwhen I receive [start game v]\nforever\n    broadcast (MakePlayerFollowHitbox v)\n    Up/Down Movement [15] [-1]\n    Right/Left Movement [10] [0.6]\n    CheckNextLevel\n    CheckFallOfScreen\n    CheckTouchingSpikes\nend\n\ndefine CheckTouchingSpikes\nif <touching (spikes v)?> then\n    go to x: (SpawnX) y: (SpawnY)\nend\n\n@Level\n\nwhen flag clicked\nset [level v] to [1]\ngo to x: (0) y: (0)\nswitch costume to (costume1 v)\n\nwhen I receive [next level v]\nchange [level v] by (1)\nnext costume\n\n@Fader\n\nwhen flag clicked\ngo to x: (0) y: (0)\ngo to [back v] layer\nhide\nset [ghost v] effect to (85)\nforever\n    stamp\nend\n\n@Control Stick\n\nwhen flag clicked\ngo to [front v] layer\nset [base sprite v] to [Control Stick]\nset [max stick v] to ((size) / (4))\nset [joystick v] to [1]\nset size to (140) %\nswitch costume to (base v)\nset [ghost v] effect to (60)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nswitch costume to (stick v)\ngo [forward v] (1) layers\nset [ghost v] effect to (20)\nforever\n    set [stik power v] to []\n    set [stick x v] to [0]\n    set [stick y v] to [0]\n    repeat until <mouse down?>\n        go to (Base sprite)\n    end\n    if <(distance to [mouse-pointer v]) < ((size) * (0.7))> then\n        Stick Drag\n    else\n        wait until <not <mouse down?>>\n    end\nend\n\ndefine Stick Drag\nrepeat until <not <mouse down?>>\n    go to (mouse-pointer v)\n    point towards (Base sprite)\n    turn right (180) degrees\n    set [stick direction v] to (direction)\n    set [stik power v] to (distance to [(Base sprite) v])\n    if <(STIK POWER) > (max stick)> then\n        move ((max stick) - (STIK POWER)) steps\n        set [stik power v] to (max stick)\n    end\n    set [stik power v] to ((STIK POWER) / (max stick))\n    set [stick x v] to ((STIK POWER) * ([sin v] of (STICK DIRECTION) ))\n    set [stick y v] to ((STIK POWER) * ([cos v] of (STICK DIRECTION) ))\nend\n\nwhen flag clicked\nforever\n    if <(Joystick) = [0]> then\n        hide\n    else\n        show\n    end\nend\n\nwhen I start as a clone\nforever\n    if <(Joystick) = [0]> then\n        hide\n    else\n        show\n    end\nend\n\n@Thumbnail\n\nwhen I receive [start game v]\nhide\n\nwhen flag clicked\nshow\n\n@Play\n\nwhen flag clicked\ngo to [front v] layer\nshow\nset [speed v] to [0]\nforever\n    change [speed v] by (4)\n    point in direction ((([sin v] of (speed) ) * (4)) + (90))\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen this sprite clicked\nchange [brightness v] effect by (25)\nhide\nset size to (120) %\ngo to [back v] layer\nbroadcast (start game v)\n\n@Sprite2\n\nwhen flag clicked\nshow\ngo to [front v] layer\nset [speed v] to [0]\nforever\n    change [speed v] by (4)\n    point in direction ((([sin v] of (speed) ) * (2)) + (90))\nend\n\nwhen I receive [start game v]\nhide\ngo to [back v] layer\nset [ghost v] effect to (100)\n\n@Settings\n\nwhen flag clicked\nhide variable [volume v]\nhide variable [joystick v]\nhide variable [music v]\nswitch costume to (button2-a v)\ngo to x: (2) y: (-100)\ngo to [front v] layer\nshow\nset [speed v] to [0]\nforever\n    change [speed v] by (4)\n    point in direction (90)\n    if <(costume [number v]) = [1]> then\n        if <touching (mouse-pointer v)?> then\n            change size by (((120) - (size)) / (5))\n        else\n            change size by (((100) - (size)) / (5))\n        end\n    end\nend\n\nwhen this sprite clicked\nbroadcast (settings v)\n\nwhen I receive [settings v]\nshow variable [volume v]\nshow variable [joystick v]\nshow variable [music v]\ngo to x: (-8) y: (-32)\nswitch costume to (screen v)\ngo to [front v] layer\n\nwhen I receive [start game v]\nhide\ngo to [back v] layer\n\nwhen I receive [close settings v]\nhide variable [volume v]\nhide variable [joystick v]\nhide variable [music v]\nswitch costume to (button2-a v)\ngo to [front v] layer\ngo to x: (2) y: (-100)\n\n@close\n\nwhen flag clicked\nhide\ngo to x: (-120) y: (62)\n\nwhen I receive [settings v]\nshow\ngo to [front v] layer\ngo to x: (-120) y: (62)\nforever\n    if <touching (mouse-pointer v)?> then\n        change size by (((120) - (size)) / (5))\n    else\n        change size by (((100) - (size)) / (5))\n    end\nend\n\nwhen this sprite clicked\nbroadcast (close settings v)\n\nwhen I receive [close settings v]\nhide\n\n@Thumbnail2\n\nwhen flag clicked\nshow\nset [ghost v] effect to (100)\n\n@Spikes\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to x: (0) y: (0)\nforever\n    Spike Tick\nend\n\ndefine Spike Tick\nif <(Level) = [1]> then\n    switch costume to (1 v)\nend\nif <(Level) = [2]> then\n    switch costume to (2 v)\nend\nif <(Level) = [3]> then\n    switch costume to (3 v)\nend\nif <(Level) = [4]> then\n    switch costume to (4 v)\nend\nif <(Level) = [5]> then\n    switch costume to (5 v)\nend\nif <(Level) = [6]> then\n    switch costume to (6 v)\nend\nif <(Level) = [7]> then\n    switch costume to (7 v)\nend\nif <(Level) = [8]> then\n    switch costume to (8 v)\nend\nif <(Level) = [9]> then\n    switch costume to (9 v)\nend\nif <(Level) = [10]> then\n    switch costume to (10 v)\nend\nif <(Level) = [11]> then\n    switch costume to (11 v)\nend\nif <(Level) = [12]> then\n    switch costume to (12 v)\nend\nif <(Level) = [13]> then\n    switch costume to (13 v)\nend\n\n