The mars || a mobile platformer sequel

Instructions: WASD, arrow keys / press x to skip a level\n\nmobile support!\n\nreport bugs and faults in the comments

@Stage\n\n@player\n\ndefine engine\nswitch costume to (kostüm3 v)\nif <(x position) > [220]> then\n    broadcast (go in v)\n    wait (1) seconds\n    go to x: (-200) y: (-139)\n    change [level v] by (1)\nend\nif <<(y position) < [-170]> or <touching (spikes v)?>> then\n    broadcast (2 v)\n    go to x: (-200) y: (-139)\n    start sound [Bonk v]\n    set [vx v] to [0]\n    set [vy v] to [0]\nend\nif <<<key (right arrow v) pressed?> or <key (d v) pressed?>> or <<(mouse x) > (x position)> and <mouse down?>>> then\n    point in direction (90)\n    change [vx v] by (1)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<(x position) > (mouse x)> and <mouse down?>>> then\n    point in direction (-90)\n    change [vx v] by (-1)\nend\nset rotation style [left-right v]\nset [vx v] to ((vx) * (0.84))\nchange x by (vx)\nif <touching (hitbox v)?> then\n    change y by (-2)\n    if <touching (hitbox v)?> then\n        change y by (1)\n        if <touching (hitbox v)?> then\n            change y by (1)\n            if <touching (hitbox v)?> then\n                change y by (1)\n                if <touching (hitbox v)?> then\n                    change y by (1)\n                    if <touching (hitbox v)?> then\n                        change y by (1)\n                        if <touching (hitbox v)?> then\n                            change y by (-5)\n                            change x by ((-1) * (vx))\n                            if <<<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<(mouse y) > (y position)> and <mouse down?>>> and <not <(vx) = [0]>>> then\n                                set [m v] to [walljump]\n                                set [vy v] to [7]\n                                set [vx v] to (((vx) / ([abs v] of (vx) )) * (-3))\n                            else\n                                set [m v] to [wallslide]\n                                set [vx v] to [0]\n                            end\n                        end\n                    end\n                end\n            end\n        end\n    end\n    change y by (2)\nend\nchange y by (-3)\nif <touching (hitbox v)?> then\n    if <(vy) = [-3]> then\n        if <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<key (d v) pressed?> or <key (right arrow v) pressed?>>> then\n            set [m v] to [run]\n        else\n            if <([abs v] of (vx) ) > [.1]> then\n                set [m v] to [slide]\n            else\n                set [m v] to [stand]\n            end\n        end\n    end\n    if <<<<(mouse y) > (y position)> and <mouse down?>> or <<key (w v) pressed?> or <key (up arrow v) pressed?>>> and <not <touching color (#ffac39)?>>> then\n        set [m v] to [jump]\n        set [vy v] to [6]\n    end\nend\nif <<<<(m) = [jump]> or <(m) = [walljump]>> and <(vy) < [0]>> or <<<(m) = [run]> or <(m) = [slide]>> and <(vy) < [-3]>>> then\n    set [m v] to [fall]\nend\nchange y by (3)\nif <(vy) > [-15]> then\n    change [vy v] by ((1) / (-4.5))\nend\nchange y by (-2)\nif <not <touching (hitbox v)?>> then\n    change y by (-1)\n    if <not <touching (hitbox v)?>> then\n        change y by (-1)\n        if <not <touching (hitbox v)?>> then\n            change y by (-1)\n            if <not <touching (hitbox v)?>> then\n                change y by (-1)\n                if <not <touching (hitbox v)?>> then\n                    change y by (-1)\n                    if <not <touching (hitbox v)?>> then\n                        change y by (5)\n                    end\n                end\n            end\n        end\n    end\nend\nchange y by (2)\nchange y by (vy)\nif <touching (hitbox v)?> then\n    change y by (-2)\n    if <touching (hitbox v)?> then\n        change y by ((-1) * (vy))\n        set [vy v] to [-3]\n    end\n    change y by (2)\nend\nif <touching color (#ffac39)?> then\n    set [vy v] to [15]\nend\nif <touching color (#77fff5)?> then\n    set [vx v] to [35]\nend\nif <touching color (#be00ff)?> then\n    set [vx v] to [-35]\nend\n\nwhen I receive [start v]\nset [done? v] to [1]\nshow\nset [vx v] to [0]\nset [vy v] to [0]\nset size to (200) %\ngo to x: (-200) y: (-139)\nshow\nforever\n    if <(level) = [14]> then\n        hide\n    else\n        engine\n        switch costume to (kostüm2 v)\n    end\nend\n\nwhen I receive [start v]\nstop all sounds\nset volume to (75) %\nplay sound [Vexento - Pegasus v] until done\nplay sound [vexento-masked-heroes-1-AHM56EBq6 \(1\) v] until done\nplay sound [Vexento_-_Sunrise\[Converterino v] until done\n\nwhen flag clicked\nset [done? v] to [0]\nhide\n\nwhen I receive [to start v]\ngo to x: (-200) y: (-100)\n\n@hitbox\n\nwhen flag clicked\ngo to x: (0) y: (-2)\nset [done? v] to [0]\nset [level v] to [1]\nset size to (100) %\nshow\nforever\n    switch costume to ((level) + (1))\nend\n\nwhen flag clicked\n\nwhen I receive [menu v]\nswitch costume to (0 v)\n\nhide\ngo to x: (0) y: (-2)\nset [done? v] to [0]\nset [level v] to [1]\nset size to (100) %\n\n@black\n\nwhen I receive [go in v]\nset [brightness v] effect to (4)\ngo to x: (-465) y: (0)\nshow\ngo to [front v] layer\nset [ghost v] effect to (0)\nrepeat until <([abs v] of (x position) ) < [2]>\n    change x by (((0) - (x position)) / (6))\nend\nset x to (0)\ngo to x: (0) y: (0)\nbroadcast (to start v)\nrepeat (32)\n    change x by (((465) - (x position)) / (8))\nend\nrepeat (10)\n    change [ghost v] effect by (10)\nend\nhide\n\nwhen flag clicked\ngo to x: (0) y: (0)\nshow\ngo to [front v] layer\ngo [backward v] (1) layers\nwait until <(done?) = [1]>\nhide\n\n@thumbnail\n\nwhen flag clicked\nswitch costume to (kostüm2 v)\nset size to (100) %\nswitch costume to (thumbnail v)\nforever\n    set size to (100) %\n    show\n    go to x: (0) y: (0)\n    set [ghost v] effect to (100)\n    switch costume to (thumbnail v)\n    go to [front v] layer\n    if <<key (x v) pressed?> and <not <(level) > [19]>>> then\n        set [level v] to ((level) + (1))\n        wait until <not <key (x v) pressed?>>\n        set [vx v] to [0]\n        set [vy v] to [0]\n        broadcast (to start v)\n    end\nend\n\n@Sprite1\n\nwhen flag clicked\nhide\nwait until <(done?) = [1]>\nrepeat (50)\n    wait (0.05) seconds\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nshow\nforever\n    go to [back v] layer\n    set [ghost v] effect to (75)\n    set [brightness v] effect to (pick random (25) to (-25))\n    if <(pick random (1) to (2)) = [1]> then\n        go to x: (pick random (-230) to (240)) y: (176)\n    else\n        go to x: (240) y: (pick random (176) to (-150))\n    end\n    point in direction (pick random (-110) to (-100))\n    repeat until <<[-150] > (y position)> or <[-230] > (x position)>>\n        move (6) steps\n    end\nend\n\n@spikes\n\nwhen flag clicked\ngo to x: (0) y: (-2)\nset [done? v] to [0]\nset [level v] to [1]\nset size to (100) %\nshow\nforever\n    switch costume to ((level) + (1))\n    if <(level) = [14]> then\n        hide\n        stop [this script v]\n    end\nend\n\nwhen flag clicked\n\nwhen I receive [menu v]\nswitch costume to (0 v)\n\nhide\ngo to x: (0) y: (-2)\nset [done? v] to [0]\nset [level v] to [1]\nset size to (100) %\n\n@Outro (@dn_scrtch)\n\nwhen I start as a clone\nif <(Clone) = [8]> then\n    hide\n    switch costume to (logo v)\n    set size to (50) %\n    set [ghost v] effect to (100)\n    go to x: (0) y: (100)\n    point in direction (0)\n    go to [back v] layer\n    show\n    repeat (20)\n        change [ghost v] effect by (-5)\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    set [ghost v] effect to (0)\n    set x to (0)\n    wait (1) seconds\n    forever\n        set [i v] to [0]\n        repeat (15)\n            turn right ([tan v] of (i) ) degrees\n            change [i v] by (5)\n        end\n        repeat (5)\n            turn right (30) degrees\n        end\n        repeat (20)\n            turn right (((90) - (direction)) / (4)) degrees\n        end\n        point in direction (90)\n        wait (3) seconds\n    end\nend\n\nwhen I start as a clone\nif <(Clone) = [8]> then\n    wait (3) seconds\n    set [s v] to [0]\n    forever\n        change size by ([sin v] of (s) )\n        change [s v] by (20)\n    end\nend\n\nwhen flag clicked\ngo to [front v] layer\nset [clone v] to [0]\nhide\nswitch costume to (logo v)\nset size to (100) %\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\npoint in direction (90)\nset [level v] to [1]\nhide\nwait until <(level) = [14]>\nrepeat (10)\n    stop all sounds\n    wait (0) seconds\nend\nset [clone v] to [0]\nhide\nswitch costume to (logo v)\nset size to (100) %\nset [ghost v] effect to (100)\ngo to x: (400) y: (0)\npoint in direction (90)\nstart sound [JJD - Velocity v]\nwait (0.5) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (0.5) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nif <(Clone) = [1]> then\n    hide\n    switch costume to (tile 1 v)\n    set size to (65) %\n    set [ghost v] effect to (100)\n    go to x: (-400) y: (0)\n    point in direction (0)\n    show\n    repeat (40)\n        change [ghost v] effect by (-5)\n        change x by (((0) - (x position)) / (4))\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    set [ghost v] effect to (0)\n    set x to (0)\n    wait (0.5) seconds\n    switch costume to (logo v)\n    wait (0.25) seconds\n    set [i v] to [0]\n    repeat (15)\n        turn right ([tan v] of (i) ) degrees\n        change [i v] by (5)\n    end\n    repeat (5)\n        turn right (30) degrees\n    end\n    repeat (20)\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    point in direction (90)\n    set [i v] to [0]\n    repeat (40)\n        change [ghost v] effect by (5)\n        change size by ([tan v] of (i) )\n        change [i v] by (5)\n    end\n    hide\n    switch costume to (username v)\n    set [ghost v] effect to (100)\n    set size to (200) %\n    point in direction (90)\n    go to x: (0) y: (-20)\n    show\n    repeat (40)\n        change [ghost v] effect by (-2.5)\n        change size by (((100) - (size)) / (8))\n    end\n    set [ghost v] effect to (0)\n    set size to (100) %\n    wait (1) seconds\n    set [clone v] to [4]\n    change [clone v] by (1)\n    create clone of (_myself_ v)\n    wait (0.75) seconds\n    change [clone v] by (1)\n    create clone of (_myself_ v)\n    wait (0.4) seconds\n    change [clone v] by (1)\n    create clone of (_myself_ v)\n    wait (2) seconds\n    change [clone v] by (1)\n    create clone of (_myself_ v)\n    set [s v] to [0]\n    wait (3.5) seconds\n    forever\n        point in direction ((([sin v] of (s) ) * (10)) + (90))\n        change [s v] by (5)\n    end\nend\n\nwhen I start as a clone\nif <(Clone) = [2]> then\n    hide\n    switch costume to (tile 2 v)\n    set size to (65) %\n    set [ghost v] effect to (100)\n    go to x: (0) y: (400)\n    point in direction (90)\n    go to [back v] layer\n    show\n    repeat (40)\n        change [ghost v] effect by (-5)\n        change y by (((0) - (y position)) / (4))\n    end\n    set [ghost v] effect to (0)\n    set y to (0)\n    wait (0.25) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [3]> then\n    hide\n    switch costume to (tile 3 v)\n    set size to (65) %\n    set [ghost v] effect to (100)\n    go to x: (0) y: (0)\n    point in direction (180)\n    go to [back v] layer\n    show\n    repeat (30)\n        change [ghost v] effect by (-5)\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    set [ghost v] effect to (0)\n    set x to (0)\n    wait (0.5) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [4]> then\n    hide\n    switch costume to (tile 4 v)\n    set size to (65) %\n    set [ghost v] effect to (100)\n    go to x: (0) y: (-20)\n    point in direction (90)\n    show\n    repeat (20)\n        change [ghost v] effect by (-5)\n        change y by (((0) - (y position)) / (8))\n    end\n    set [ghost v] effect to (0)\n    set y to (0)\n    wait (0.5) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <<(Clone) > [4]> and <not <(Clone) > [7]>>> then\n    hide\n    switch costume to (join [Icon ] ((Clone) - (4)))\n    set size to (75) %\n    set [ghost v] effect to (100)\n    go to x: ((-200) + (((Clone) - (4)) * (100))) y: (-400)\n    point in direction (0)\n    show\n    repeat (20)\n        change [ghost v] effect by (-3)\n        change y by (((-125) - (y position)) / (4))\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    wait (6) seconds\n    forever\n        repeat (20)\n            change [ghost v] effect by (5)\n        end\n        repeat (20)\n            change [ghost v] effect by (-5)\n        end\n        wait (2) seconds\n    end\nend\n\n@Intro (@dn_scrtch)\n\nwhen flag clicked\ngo to [front v] layer\nset [clone v] to [0]\nhide\nswitch costume to (logo v)\nset size to (100) %\nset [ghost v] effect to (100)\ngo to x: (0) y: (0)\npoint in direction (90)\nhide\nswitch costume to (logo v)\nset size to (100) %\nset [ghost v] effect to (100)\ngo to x: (400) y: (0)\npoint in direction (90)\nstart sound [Introsound v]\nset [clone v] to [Load]\ncreate clone of (_myself_ v)\nset [clone v] to [0]\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (1) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (1) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (1) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (4) seconds\ngo to [back v] layer\nswitch costume to (logo v)\nset size to (200) %\nset [ghost v] effect to (100)\ngo to x: (400) y: (0)\npoint in direction (90)\nshow\nrepeat (20)\n    change [ghost v] effect by (-3)\n    change x by (((-100) - (x position)) / (4))\nend\nwait (0.5) seconds\nchange [clone v] by (1)\ncreate clone of (_myself_ v)\nwait (2.5) seconds\nset [i v] to [0]\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nhide\nset [logoshown v] to [true]\nbroadcast (start v)\n\nwhen I start as a clone\nif <(Clone) = [Load]> then\n    switch costume to (load v)\n    set size to (100) %\n    set [ghost v] effect to (0)\n    point in direction (90)\n    go to x: (-500) y: (0)\n    show\n    repeat (300)\n        go to [front v] layer\n        change x by (1.5)\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n        change x by (1.5)\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [1]> then\n    hide\n    switch costume to (tile 1 v)\n    set size to (50) %\n    set [ghost v] effect to (100)\n    go to x: (-400) y: (0)\n    point in direction (0)\n    show\n    repeat (40)\n        change [ghost v] effect by (-5)\n        change x by (((0) - (x position)) / (8))\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    set [ghost v] effect to (0)\n    set x to (0)\n    wait (3) seconds\n    switch costume to (logo v)\n    set [i v] to [0]\n    repeat (15)\n        turn right ([tan v] of (i) ) degrees\n        change [i v] by (5)\n    end\n    repeat (5)\n        turn right (30) degrees\n    end\n    repeat (20)\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    point in direction (90)\n    set [i v] to [0]\n    repeat (10)\n        change [ghost v] effect by (5)\n        change size by (((80) - (size)) / (2))\n    end\n    repeat (10)\n        change [ghost v] effect by (-5)\n        change size by (((40) - (size)) / (2))\n    end\n    repeat (20)\n        change [ghost v] effect by (5)\n        change [whirl v] effect by (100)\n        turn right (2) degrees\n    end\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [2]> then\n    hide\n    switch costume to (tile 2 v)\n    set size to (50) %\n    set [ghost v] effect to (100)\n    go to x: (0) y: (400)\n    point in direction (90)\n    show\n    repeat (40)\n        change [ghost v] effect by (-5)\n        change y by (((0) - (y position)) / (8))\n    end\n    set [ghost v] effect to (0)\n    set y to (0)\n    wait (2.1) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [3]> then\n    hide\n    switch costume to (tile 3 v)\n    set size to (50) %\n    set [ghost v] effect to (100)\n    go to x: (400) y: (0)\n    point in direction (0)\n    show\n    repeat (40)\n        go to [back v] layer\n        change [ghost v] effect by (-5)\n        change x by (((0) - (x position)) / (8))\n        turn right (((90) - (direction)) / (4)) degrees\n    end\n    set [ghost v] effect to (0)\n    set x to (0)\n    wait (1) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [4]> then\n    hide\n    switch costume to (tile 4 v)\n    set size to (50) %\n    set [ghost v] effect to (100)\n    go to x: (0) y: (-400)\n    point in direction (90)\n    show\n    repeat (40)\n        change [ghost v] effect by (-5)\n        change y by (((0) - (y position)) / (8))\n    end\n    set [ghost v] effect to (0)\n    set y to (0)\n    wait (0.2) seconds\n    delete this clone\nend\n\nwhen I start as a clone\nif <(Clone) = [5]> then\n    hide\n    switch costume to (username v)\n    set size to (100) %\n    set [ghost v] effect to (100)\n    go to x: (100) y: (-400)\n    point in direction (90)\n    show\n    repeat (20)\n        change [ghost v] effect by (-3)\n        change y by (((-150) - (y position)) / (4))\n    end\n    wait (1.5) seconds\n    repeat (20)\n        change [ghost v] effect by (5)\n        change size by (((50) - (size)) / (2))\n    end\n    delete this clone\nend\n\n