cube run! - mobile friendly (platformer)

Instructions: Welcome to cube run! - mobile friendly (platformer)\n\nHey people! check out my friend, and good pixel artist, @biggicheesedefeater !\n\nI will take suggestions or ideas for what my future games should be!\n\nPlease play my other game balloon gonzalas! : https://scratch.mit.edu/projects/629239433/\n \n-How to Play-\nWASD, Arrow keys, also mobile friendly\ns/down arrow to crouch\nAvoid Spikes and lava

@Stage\n\nwhen flag clicked\nwait (12) seconds\nforever\n    set volume to (75) %\n    play sound [recording1 v] until done\nend\n\n@Text\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nswitch costume to (costume2 v)\nforever\n    go to [front v] layer\n    go [backward v] (2) layers\n    set [level v] to (costume [number v])\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Ground\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    go [backward v] (5) layers\n    set [level v] to (costume [number v])\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next level v]\nnext costume\n\n@Player\n\nwhen flag clicked\nhide\nset [xvel v] to [0]\nset [yvel v] to [0]\nwait (12) seconds\nshow\nset [level v] to [1]\ngo to x: (-180) y: (-50)\nforever\n    Run physics [0.9] [0.9] [-1] [15]\n    if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(y position) > (mouse y)>>> then\n        if <not <<touching color (#4c86ff)?> or <touching color (#437de0)?>>> then\n            switch costume to (costume2 v)\n        else\n            switch costume to (costume1 v)\n        end\n    else\n        switch costume to (costume1 v)\n    end\nend\n\ndefine Run physics (speed) (friction) (gravity) (jump height)\nchange [yvel v] by (gravity)\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n    change [xvel v] by (speed)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n    change [xvel v] by ((speed) * (-1))\nend\nset [xvel v] to ((Xvel) * (friction))\nchange x by (Xvel)\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (1)\nend\nif <touching (ground v)?> then\n    change y by (-4)\n    change x by ((Xvel) * (-1))\n    if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [yvel v] to ((jump height) - (3.5))\n        if <[0] < (Xvel)> then\n            set [xvel v] to [-6]\n        else\n            set [xvel v] to [6]\n        end\n    else\n        set [xvel v] to [0]\n    end\nend\nchange y by (Yvel)\nif <touching (ground v)?> then\n    change y by ((Yvel) * (-1))\n    set [yvel v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <touching (ground v)?> then\n        set [yvel v] to (jump height)\n    end\nend\nchange y by (1)\n\nwhen I receive [ded v]\nstart sound [Roblox Death Sound  OOF Sound Effect v]\ngo to x: (-180) y: (-50)\nset [ghost v] effect to (0)\n\nwhen I start as a clone\nrepeat (10)\n    change size by (-5)\n    change [ghost v] effect by (5)\nend\ndelete this clone\n\nwhen I receive [next level v]\ngo to x: (-180) y: (-50)\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nrepeat until <(Level) = [22]>\n    if <[220] < (x position)> then\n        broadcast (Next level v) and wait\n        wait until <not <[220] < (x position)>>\n    end\n    if <<<(y position) < [-170]> or <touching (danger v)?>> or <<touching (lava v)?> or <touching (saw v)?>>> then\n        broadcast (Ded v) and wait\n    end\n    if <touching (bouncy v)?> then\n        set [yvel v] to [20]\n    end\nend\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    if <<touching color (#54ceff)?> or <touching color (#63d2ff)?>> then\n        if <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(x position) > (mouse x)>>> then\n            change [xvel v] by (-1.3)\n        end\n        if <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<mouse down?> and <(mouse x) > (x position)>>> then\n            change [xvel v] by (1.3)\n        end\n        if <<<key (down arrow v) pressed?> or <key (s v) pressed?>> or <<mouse down?> and <(y position) > (mouse y)>>> then\n            change [yvel v] by (-1.3)\n        end\n        if <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n            change [yvel v] by (1.3)\n        end\n        set [xvel v] to ((Xvel) * (0.81))\n        set [yvel v] to ((Yvel) * (0.81))\n        change [yvel v] by (((Yvel) / (14.9)) + (0.1))\n    end\n    set size to (125) %\nend\n\nwhen I receive [respawn v]\ngo to x: (-180) y: (-50)\nset [ghost v] effect to (0)\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    go to [front v] layer\n    go [backward v] (1) layers\nend\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    create clone of (_myself_ v)\nend\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    if <[220] < (x position)> then\n        play sound [Ding Sound Effect v] until done\n    end\nend\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    if <touching (bouncy v)?> then\n        play sound [Mario_Jump_-_Gaming_Sound_Effect v] until done\n    end\nend\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    if <<<(y position) < [-170]> or <touching (danger v)?>> or <<touching (lava v)?> or <touching (saw v)?>>> then\n        play sound [Roblox Death Sound  OOF Sound Effect v] until done\n    end\nend\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nforever\n    if <[2] = (costume [number v])> then\n        set [xvel v] to [0]\n        wait until <not <[2] = (costume [number v])>>\n    end\nend\n\n@Danger\n\nwhen flag clicked\nhide\nwait (12) seconds\nshow\nswitch costume to (costume1 v)\nforever\n    go to [front v] layer\n    go [backward v] (10) layers\n    set [level v] to (costume [number v])\n    go to x: (0) y: (0)\nend\n\nwhen I receive [next level v]\nnext costume\n\n@ThumbNail\n\nwhen flag clicked\ngo to x: (1) y: (4)\ngo to [front v] layer\nset size to (100) %\nset [ghost v] effect to (100)\n\n@Intro2\n\nwhen I start as a clone\nif <(Clone ID) = [watermark]> then\n    go to [front v] layer\n    show\n    switch costume to (watermark v)\n    set size to (0) %\n    set [watermark v] to [0]\n    set [watermark 2 v] to [0]\n    point in direction (-90)\n    repeat until <<(round (direction)) = [90]> and <<(round (Watermark)) = [0]> and <<(round (Watermark 2)) = [0]> and <(size) = [100]>>>>\n        set [watermark v] to (((Watermark) * (0.8)) + (((100) - (size)) / (5)))\n        set [watermark 2 v] to (((Watermark 2) * (0.8)) + (((90) - (direction)) / (5)))\n        turn right (Watermark 2) degrees\n        change size by (Watermark)\n    end\n    set size to (100) %\n    point in direction (90)\n    smooth glide [0] [196] [50] [4] [1]\nend\n\ndefine Clone (id)\nset [clone id v] to (id)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\ngo to x: (0) y: (0)\npoint in direction (90)\nset size to (100) %\nclear graphic effects\n\ndefine Chevrons (#) (clone id)\nset [clone id v] to (clone id)\nif <(clone id) = [Chevron1]> then\n    set [var 1 v] to [0]\nelse\n    set [var 1 v] to [-80]\nend\nrepeat (#)\n    create clone of (_myself_ v)\n    change [var 1 v] by (-160)\nend\n\nwhen I receive [sync v]\nif <(Clone ID) = [Chevron1]> then\n    change [var 1 v] by ((80) + ((size) / (20)))\nend\nif <(Clone ID) = [Chevron2]> then\n    change [var 1 v] by ((80) + ((size) / (20)))\nend\nif <(Clone ID) = [BG2]> then\n    set [ghost v] effect to (50)\nend\nif <(Clone ID) = [Chevron3]> then\n    change [var 1 v] by (60)\nend\n\nwhen I receive [end v]\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\nwhen I start as a clone\nif <(Clone ID) = [Name]> then\n    switch costume to (name v)\n    set size to (600) %\n    point in direction (-90)\n    show\n    broadcast (Sync v)\n    repeat (1)\n        repeat (20)\n            go to [front v] layer\n            turn right (((90) - (direction)) / (12)) degrees\n            change size by (((200) - (size)) / (12))\n        end\n        change size by (30)\n        broadcast (Sync v)\n    end\n    repeat (1)\n        repeat (22)\n            turn right (((90) - (direction)) / (12)) degrees\n            change size by (((200) - (size)) / (12))\n        end\n        change size by (30)\n        broadcast (Sync v)\n    end\n    repeat (2)\n        repeat (22)\n            turn right (((90) - (direction)) / (12)) degrees\n            change size by (((200) - (size)) / (12))\n        end\n        set size to (230) %\n        broadcast (Sync v)\n    end\n    set [var 1 v] to [90]\n    repeat (3)\n        repeat (22)\n            change [var 1 v] by (((450) - (Var 1)) / (12))\n            point in direction (Var 1)\n            change size by (((200) - (size)) / (12))\n        end\n        set size to (230) %\n        broadcast (Sync v)\n    end\n    repeat (1)\n        repeat (22)\n            change [var 1 v] by (((450) - (Var 1)) / (12))\n            point in direction (Var 1)\n            change size by (((200) - (size)) / (12))\n        end\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Chevron1]> then\n    set size to (Var 1) %\n    set [brightness v] effect to (0)\n    go [forward v] (4) layers\n    show\n    repeat (1000)\n        switch costume to (circle v)\n        change size by (((Var 1) - (size)) / (4))\n        change [var 1 v] by ((1) + ((size) / (20)))\n        switch costume to (chev2 v)\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Chevron2]> then\n    set size to (Var 1) %\n    set [brightness v] effect to (0)\n    go [backward v] (([abs v] of ((Var 1) / (160)) ) + (5)) layers\n    show\n    repeat (1000)\n        switch costume to (circle v)\n        change size by (((Var 1) - (size)) / (4))\n        change [var 1 v] by ((1) + ((size) / (20)))\n        switch costume to (chevron v)\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Grid]> then\n    set size to (144) %\n    switch costume to (grid v)\n    go [forward v] (1) layers\n    show\nend\n\nwhen I start as a clone\nif <(Clone ID) = [BG]> then\n    set size to (100) %\n    switch costume to (bg v)\n    go [backward v] (40) layers\n    show\nend\n\nwhen I start as a clone\nif <(Clone ID) = [BG2]> then\n    switch costume to (bg v)\n    set [brightness v] effect to (100)\n    set [ghost v] effect to (100)\n    go [forward v] (40) layers\n    show\n    repeat (1000)\n        change [ghost v] effect by (3)\n        go to [front v] layer\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Chevron3]> then\n    set size to (140) %\n    switch costume to (bg v)\n    go to x: (0) y: (((Var 1) * (1.2)) + (220))\n    show\n    go [backward v] (7) layers\n    set [ghost v] effect to (80)\n    repeat (1000)\n        switch costume to (bg v)\n        change y by (((((Var 1) * (1.2)) + (220)) - (y position)) / (4))\n        change [var 1 v] by (4)\n        switch costume to (arrow v)\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Shutter]> then\n    show\n    set [ghost v] effect to (0)\n    set [brightness v] effect to (0)\n    switch costume to (pos hack v)\n    go to [front v] layer\n    go to x: (480) y: (0)\n    switch costume to (shutter v)\n    repeat (25)\n        switch costume to (size hack v)\n        set size to (100) %\n        switch costume to (pos hack v)\n        change x by (((-350) - (x position)) / (12))\n        go to [front v] layer\n        switch costume to (shutter v)\n    end\nend\n\ndefine smooth glide (x) (y) (size) (smooth) (ghost)\nset [ghost v] to [0]\nset [watermark v] to (costume [name v])\nif <(size) = (size)> then\n    set [watermark 2 v] to [1]\nelse\n    set [watermark 2 v] to [0]\nend\nrepeat until <<<(round (x position)) = (x)> and <(round (y position)) = (y)>> and <(round (size)) = (size)>>\n    switch costume to (pos hack v)\n    change x by (((x) - (x position)) / (smooth))\n    change y by (((y) - (y position)) / (smooth))\n    switch costume to (Watermark)\n    if <(Watermark 2) = [0]> then\n        change size by (((size) - (size)) / (smooth))\n    end\n    if <(ghost) = [1]> then\n        change [ghost v] by (((100) - (ghost)) / (smooth))\n        set [ghost v] effect to (ghost)\n    end\nend\nswitch costume to (pos hack v)\ngo to x: (x) y: (y)\nset size to (size) %\nswitch costume to (Watermark)\nif <(ghost) = [1]> then\n    hide\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Circle]> then\n    set [brightness v] effect to (0)\n    switch costume to (pos hack v)\n    go to x: (0) y: (200)\n    go to [back v] layer\n    go [forward v] (2) layers\n    switch costume to (circle2 v)\n    set [y vel v] to [-1]\n    show\n    repeat until <(y position) < [-180]>\n        switch costume to (pos hack v)\n        change y by (y vel)\n        switch costume to (circle2 v)\n        change [y vel v] by ((y vel) / (5))\n    end\n    switch costume to (pos hack v)\n    go to x: (0) y: (-240)\n    point in direction (-90)\n    go to [back v] layer\n    go [forward v] (2) layers\n    repeat until <(size) > [4500]>\n        switch costume to (size hack v)\n        change size by (((4501) - (size)) / (10))\n        go to [back v] layer\n        go [forward v] (2) layers\n        switch costume to (circle2 v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Circle2]> then\n    set [brightness v] effect to (100)\n    switch costume to (pos hack v)\n    go to x: (0) y: (-200)\n    go to [back v] layer\n    go [forward v] (1) layers\n    switch costume to (circle2 v)\n    set [y vel v] to [1]\n    show\n    repeat until <[180] < (y position)>\n        switch costume to (pos hack v)\n        change y by (y vel)\n        switch costume to (circle2 v)\n        change [y vel v] by ((y vel) / (5))\n    end\n    switch costume to (pos hack v)\n    go to x: (0) y: (240)\n    point in direction (-90)\n    go to [back v] layer\n    go [forward v] (1) layers\n    repeat until <(size) > [4500]>\n        switch costume to (size hack v)\n        change size by (((4501) - (size)) / (10))\n        go to [back v] layer\n        go [forward v] (1) layers\n        switch costume to (circle2 v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [BG111]> then\n    set [brightness v] effect to (0)\n    switch costume to (bg111 v)\n    go to x: (0) y: (0)\n    go to [back v] layer\n    go [backward v] (400) layers\n    set [brightness v] effect to (0)\n    show\n    repeat (20)\n        change [brightness v] effect by (-5)\n        go to [back v] layer\n        go [backward v] (400) layers\n    end\n    repeat until <(timer) > [4.9]>\n        go to [back v] layer\n        go [backward v] (400) layers\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Fractal Burst]> then\n    show\n    switch costume to (fractal burst v)\n    set size to (0) %\n    set [color v] effect to (-20)\n    go to [front v] layer\n    set [color v] effect to (-20)\n    clear graphic effects\n    go to x: (0) y: (0)\n    point in direction (90)\n    set [ghost v] effect to (20)\n    set [brightness v] effect to (20)\n    set [color v] effect to (-20)\n    repeat until <(size) > [1000]>\n        switch costume to (size hack v)\n        set [color v] effect to (-20)\n        set [color v] effect to (-20)\n        go to [front v] layer\n        change size by (50)\n        switch costume to (fractal burst v)\n        set [color v] effect to (-20)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Fractal Burst 2]> then\n    show\n    switch costume to (fractal burst v)\n    set size to (0) %\n    go to [front v] layer\n    set [color v] effect to (0)\n    clear graphic effects\n    go to x: (0) y: (0)\n    point in direction (90)\n    set [ghost v] effect to (20)\n    set [brightness v] effect to (20)\n    repeat until <(size) > [1000]>\n        switch costume to (size hack v)\n        set [color v] effect to (0)\n        go to [front v] layer\n        change size by (50)\n        switch costume to (fractal burst v)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nwait until <(timer) > [7.2]>\nset [color v] effect to (20)\nwait until <(timer) > [9.75]>\nset [color v] effect to (0)\n\ndefine Particle Physics\nmove ((yv) + (1)) steps\nset [yv v] to ((yv) * (0.95))\nchange x by (xv)\nset [xv v] to ((xv) * (0.8))\nif <([abs v] of (direction) ) < [90]> then\n    turn right (((0) - (direction)) / (30)) degrees\nelse\n    if <(direction) < [0]> then\n        turn right (((-180) - (direction)) / (30)) degrees\n    else\n        turn right (((180) - (direction)) / (30)) degrees\n    end\nend\n\nwhen I start as a clone\nif <(Clone ID) = [Particle]> then\n    go to [front v] layer\n    set size to (50) %\n    switch costume to (join [Particle] (pick random (1) to (4)))\n    show\n    set [brightness v] effect to (b)\n    set [ghost v] effect to (25)\n    go to x: (0) y: (0)\n    point in direction (pick random (-179) to (179))\n    set [xv v] to (pick random (10) to (-10))\n    set [yv v] to (pick random (5) to (15))\n    repeat (50)\n        go to [front v] layer\n        Particle Physics\n        if <touching (_edge_ v)?> then\n            change [ghost v] effect by (10)\n            go to [front v] layer\n        end\n    end\n    if <not <touching (_edge_ v)?>> then\n        repeat (10)\n            go to [front v] layer\n            Particle Physics\n            change [ghost v] effect by (10)\n        end\n    end\n    delete this clone\nend\n\ndefine Particles (amount)\nrepeat (amount)\n    Clone [Particle]\nend\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [11]>\nstart sound [Slice v]\n\nwhen I receive [boistartnow v]\nstop all sounds\nclear sound effects\nreset timer\nstart sound [ v]\nwait until <(timer) > [14]>\nbroadcast (End v)\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [11]>\nClone [Shutter]\n\nwhen I receive [boistartnow v]\nClone [BG111]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [3.3]>\nClone [Circle]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [4.85]>\nset [b v] to [40]\nParticles [50]\n\nwhen I receive [boistartnow v]\nset [clone id v] to [0]\nset [var 1 v] to [0]\nset [var 2 v] to [0]\nswitch costume to (name v)\nhide\nwait (4.9) seconds\nClone [BG]\nClone [Name]\nClone [Grid]\nClone [BG2]\nChevrons [7] [Chevron1]\nChevrons [7] [Chevron2]\nChevrons [12] [Chevron3]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [4.85]>\nClone [Fractal Burst]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [2.7]>\nClone [Circle2]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [9.68]>\nClone [Fractal Burst]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [7.2]>\nset [b v] to [25]\nParticles [50]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [9.75]>\nset [b v] to [40]\nParticles [50]\n\nwhen I receive [boistartnow v]\nwait until <(timer) > [7.2]>\nClone [Fractal Burst 2]\n\nwhen I receive [boistartnow v]\nClone [watermark]\n\nwhen flag clicked\nset volume to (80) %\nbroadcast (BOISTARTNOW v)\n\n