Land Escape (Platformer)

Instructions: First levels should run with no problem, but, after, it will go too slow (7 fps), so, I recomend to go to turbowarp.\nhttps://turbowarp.org/419379287?hqpen\n\n1.-Move with WASD\n2.-Turn with arrow keys\n3.-Jump with space

@Stage\n\nwhen I receive [intro v]\nforever\n    play sound [Red Lights- Tiesto v] until done\nend\n\n@c\n\nwhen I receive [intro v]\nswitch costume to (1 v)\nset [☁ money v] to [0]\nset size to (50) %\ngo to [front v] layer\ngo to x: (116) y: (-132)\nshow\nforever\n    set [my variable v] to [1000]\n    next costume\n    wait (.1) seconds\nend\n\nwhen I start as a clone\nswitch costume to (1 v)\nchange x by (20)\nforever\n    next costume\n    wait (.1) seconds\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        change [☁ money v] by (100)\n        wait until <not <touching (player v)?>>\n    end\nend\n\nwhen I receive [intro v]\ncreate clone of (_myself_ v)\n\nwhen I receive [intro v]\nforever\n    if <touching (player v)?> then\n        change [☁ money v] by (100)\n        hide\n        wait until <not <touching (player v)?>>\n    end\nend\n\nwhen I start as a clone\nforever\n    if <touching (player v)?> then\n        delete this clone\n    end\nend\n\nwhen I receive [end v]\nshow\ncreate clone of (_myself_ v)\nwait until <(my variable) = [100]>\n\n@Level\n\nwhen I receive [intro v]\nswitch costume to (g1 v)\nshow\ngo to [front v] layer\n\nwhen I receive [end v]\nnext costume\n\nwhen I receive [intro v]\nforever\n    set [my variable v] to [1000]\nend\n\nwhen I receive [intro v]\nforever\n    if <(costume [name v]) = [g5]> then\n        broadcast (da v)\n        stop [this script v]\n    end\nend\n\nwhen I receive [intro v]\nforever\n    if <(costume [name v]) = [g6]> then\n        broadcast (dada v)\n    end\nend\n\nwhen I receive [intro v]\nforever\n    if <(costume [name v]) = [g7]> then\n        broadcast (go v)\n    end\nend\n\n@player\n\ndefine Platformer Physics (speed) (friction) (jump height)\nchange [y vel v] by (-1)\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > ((x position) + (20))>>>> then\n    change [x vel v] by (speed)\n    switch costume to (r2 v)\nend\nif <<key (left arrow v) pressed?> or <<key (a v) pressed?> or <<mouse down?> and <(x position) > ((mouse x) + (20))>>>> then\n    change [x vel v] by ((speed) * (-1))\n    switch costume to (l2 v)\nend\nset [x vel v] to ((X vel) * (friction))\nchange x by (X vel)\nset [slope v] to [0]\nif <touching (level v)?> then\n    repeat until <<not <touching (level v)?>> or <(slope) = [-8]>>\n        change [slope v] by (-1)\n        change y by (1)\n    end\nend\nif <touching (level v)?> then\n    change y by (slope)\n    repeat until <not <touching (level v)?>>\n        change x by ((([abs v] of (X vel) ) / (X vel)) * (-1))\n    end\n    if <<key (up arrow v) pressed?> or <<key (w v) pressed?> or <<mouse down?> and <(mouse y) > ((y position) + (20))>>>> then\n        if <(X vel) > [0]> then\n            set [x vel v] to [-12]\n        else\n            set [x vel v] to [12]\n        end\n        set [y vel v] to [12]\n    else\n        set [x vel v] to [0]\n    end\nend\nchange y by (Y vel)\nif <touching (level v)?> then\n    repeat until <not <touching (level v)?>>\n        change y by ((([abs v] of (Y vel) ) / (Y vel)) * (-1))\n    end\n    set [y vel v] to [0]\nend\nchange y by (-1)\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> and <touching (level v)?>> then\n    set [y vel v] to (jump height)\nend\nchange y by (1)\n\nwhen I receive [end v]\ngo to x: (-198) y: (-5)\n\nwhen I receive [intro v]\nshow\ngo to [front v] layer\nset [level v] to [1]\nset [x vel v] to [0]\nset [y vel v] to [0]\nswitch costume to (l2 v)\nReset Position [-198] [-10]\npoint in direction (90)\nforever\n    Platformer Physics [1] [0.9] [13]\n    if <<touching (dan v)?> or <touching (dan2 v)?>> then\n        start sound [Prick v]\n        Reset Position [-198] [-10]\n    end\nend\n\nwhen flag clicked\nset [level v] to [1]\nhide\n\nwhen I receive [intro v]\nforever\n    create clone of (_myself_ v)\nend\n\nwhen I start as a clone\nswitch costume to (effect v)\nrepeat (25)\n    change [ghost v] effect by (10)\n    change size by (-5)\nend\ndelete this clone\n\nwhen flag clicked\nbroadcast (intro v)\n\ndefine Reset Position (x) (y)\ngo to x: (x) y: (y)\n\nwhen I receive [intro v]\nforever\n    key check\nend\n\nwhen I receive [intro v]\nforever\n    if <(x position) = [249]> then\n        broadcast (end v)\n        Reset Position [-198] [-10]\n    end\nend\n\ndefine key check\nif <key (up arrow v) pressed?> then\n    switch costume to (u v)\nelse\n    if <key (right arrow v) pressed?> then\n        switch costume to (r2 v)\n    else\n        if <key (left arrow v) pressed?> then\n            switch costume to (l2 v)\n        else\n            if <<key (left arrow v) pressed?> and <key (up arrow v) pressed?>> then\n                switch costume to (l1 v)\n            else\n                if <<key (right arrow v) pressed?> and <key (up arrow v) pressed?>> then\n                    switch costume to (r1 v)\n                else\n                    if <not <key (any v) pressed?>> then\n                        switch costume to (s v)\n                    end\n                end\n            end\n        end\n    end\nend\n\nwhen I receive [c v]\nstart sound [Coin v]\n\nwhen I receive [intro v]\nforever\n    if <touching (c v)?> then\n        broadcast (c v)\n    end\nend\n\nwhen I receive [intro v]\nchange [☁ viewers v] by (1)\n\n@Dan\n\nwhen I receive [intro v]\nswitch costume to (g1 v)\nshow\ngo to [front v] layer\n\nwhen I receive [end v]\nnext costume\n\n@Dan2\n\nwhen I receive [intro v]\ngo to x: (-82) y: (60)\nhide\nswitch costume to (1 v)\ngo to [front v] layer\n\nwhen I receive [da v]\nshow\nforever\n    next costume\n    wait (.01) seconds\nend\n\nwhen I receive [dada v]\nstop [other scripts in sprite v]\nhide\n\n@Love and fave reminder\n\nwhen I receive [intro v]\nrepeat (2)\n    switch costume to (costume1 v)\n    go to x: (-100) y: (105)\n    show\n    go to [front v] layer\n    repeat (9)\n        change y by (-6)\n    end\n    repeat (5)\n        change y by (3)\n    end\n    repeat (5)\n        change y by (-1)\n    end\n    wait (2) seconds\n    repeat (15)\n        change y by (7)\n    end\n    hide\nend\n\n@detector\n\nwhen flag clicked\nhide\nset [faved___ v] to [0]\nset [loved__ v] to [0]\nset [clone id v] to [0]\ncreate clone of (_myself_ v)\nwait (0.2) seconds\nset [clone id v] to [1]\ncreate clone of (_myself_ v)\nwait until <<(LOVED__) = [1]> and <(FAVED___) = [1]>>\nwait (1) seconds\nshow\ngo to x: (0) y: (50)\nreset timer\ngo to [front v] layer\nswitch costume to (2 v)\nset [ghost v] effect to (100)\nrepeat until <(timer) > [3.5]>\n    change y by ((y position) / (-15))\n    change [ghost v] effect by (-3)\nend\nreset timer\nrepeat until <(timer) > [3.5]>\n    change y by (((y position) - (-100)) / (-15))\n    change [ghost v] effect by (10)\nend\n\nwhen I start as a clone\nif <(clone id) = [0]> then\n    go to x: (-15) y: (0)\n    set [loved__ v] to [0]\n    switch costume to (love v)\n    forever\n        set [love? v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [loved__ v] to [1]\n        end\n    end\nend\nif <(clone id) = [1]> then\n    go to x: (0) y: (0)\n    switch costume to (fave v)\n    set [faved___ v] to [0]\n    forever\n        set [fav v] to <touching (mouse-pointer v)?>\n        if <touching (mouse-pointer v)?> then\n            set [faved___ v] to [1]\n        end\n    end\nend\n\n@Thumbnail\n\nwhen flag clicked\nset [sec v] to [0]\nforever\n    go to [front v] layer\nend\n\nwhen flag clicked\ngo to x: (3) y: (24)\nhide variable [sec v]\nhide variable [☁ money v]\nwait (.5) seconds\nrepeat (20)\n    change [ghost v] effect by (5)\nend\nbroadcast (TS v)\n\nwhen I receive [ts v]\nshow variable [sec v]\nshow variable [☁ money v]\nforever\n    wait (1) seconds\n    change [sec v] by (1)\nend\n\nwhen I receive [go v]\nstop [other scripts in sprite v]\n\n