Amazing Platformer (part 1) 

Instructions: ||||||||||||||||||||||||||||| Amazing Platformer |||||||||||||||||||||||||||||\n========== A Game by @321PLAY123 ==========\n~~ Instructions: \n~~ Use arrow keys.\n~~ Make sure to like and fav this game \nand follow @321PLAY123 for more fun games!

@Stage\n\n@PLAYER\n\nwhen I receive [play game v]\ngo to [front v] layer\nhide\n\ndefine Game on\nswitch costume to (costume1 v)\npoint in direction (90)\nset [scroll x v] to [0]\nset [scroll y v] to [0]\nset [player: x v] to [0]\nset [player: y v] to [78]\nset [speedy v] to [0]\nset [player: sx v] to [0]\nset [game v] to []\nset [in air v] to [0]\nset size to (100) %\nset [ghost v] effect to (0)\nshow\n\ndefine run player\nif <<key (right arrow v) pressed?> or <<key (d v) pressed?> or <<mouse down?> and <(mouse x) > (x position)>>>> then\n    change [player: sx v] by (2)\nend\nif <<<key (left arrow v) pressed?> or <key (a v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [player: sx v] by (-2)\nend\nset [player: sx v] to ((PLAYER: sx) * (0.8))\nif <([abs v] of (PLAYER: sx) ) > [0.9]> then\n    Change player x by (round (PLAYER: sx))\nend\nif <<<key (up arrow v) pressed?> or <key (w v) pressed?>> or <<mouse down?> and <(y position) < (mouse y)>>> then\n    if <(In air) < [4]> then\n        set [speedy v] to [16]\n    end\nend\nif <(Speedy) > [-20]> then\n    change [speedy v] by (-1.5)\nend\nChange player y by (Speedy)\nchange [scroll x v] by (round (((PLAYER: x) - (SCROLL X)) / (15)))\nif <(SCROLL X) < [0]> then\n    set [scroll x v] to [0]\nend\nif <(SCROLL Y) < [0]> then\n    set [scroll y v] to [0]\nend\nchange [scroll y v] by (round (((PLAYER: y) - (SCROLL Y)) / (10)))\nPosition\nif <<<(y position) < [-150]> and <touching (_edge_ v)?>> or <(SCROLL Y) < [-30]>> then\n    set [game v] to [Die]\nend\n\ndefine Change player y by (sy)\nchange [player: y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platformes v)?>>\n    if <(sy) > [0]> then\n        change [player: y v] by (-1)\n    else\n        change [player: y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [speedy v] to [0]\nend\n\ndefine Position\ngo to x: ((PLAYER: x) - (SCROLL X)) y: ((PLAYER: y) - (SCROLL Y))\n\ndefine Change player x by (sx)\nchange [player: x v] by (sx)\nPosition\nif <touching (platformes v)?> then\n    repeat (12)\n        change [player: y v] by (1)\n        Position\n        if <not <touching (platformes v)?>> then\n            stop [this script v]\n        end\n    end\n    change [player: y v] by (-12)\n    repeat until <not <touching (platformes v)?>>\n        if <(sx) > [0]> then\n            change [player: x v] by (-1)\n        else\n            change [player: x v] by (1)\n        end\n        Position\n    end\nend\n\nwhen I receive [begin  v]\nshow\nbroadcast (Play game v) and wait\n\nwhen flag clicked\nforever\n    broadcast (Reset v) and wait\n    broadcast (Setup v) and wait\n    Game on\n    repeat until <(game) > []>\n        run player\n        broadcast (tik\(tok\) v)\n    end\nend\n\ndefine Die? I think so\nif <touching (\(e\)pic v)?> then\n    set [game v] to [Die \(other way\)]\nend\n\nwhen flag clicked\nforever\n    play sound [MUSIC ACTION! v] until done\nend\n\n@PLATFORMES\n\nwhen I receive [play game v]\nshow\n\nwhen I receive [tik\(tok\) v]\nPosition ((PLATFORMES: x) - (SCROLL X)) ((PLATFORMES: y) - (SCROLL Y))\n\nwhen I receive [setup v]\nset [platformes: y v] to [0]\nset [platformes: x v] to [0]\nswitch costume to (costume1 v)\nPosition x: [890] y: [100]\nPosition x: [450] y: [300]\nPosition x: [600] y: [20]\nPosition x: [450] y: [30]\nPosition x: [700] y: [170]\nPosition x: [500] y: [130]\n\nPosition x: [500] y: [0]\n\ndefine Position (x) (y)\ngo to x: (x) y: (y)\nif <<(x) = (x position)> and <(y) = (y position)>> then\n    show\nelse\n    hide\nend\n\nwhen I receive [reset v]\ndelete this clone\n\ndefine Position x: (x) y: (y)\ncreate clone of (_myself_ v)\nchange [platformes: x v] by (x)\nchange [platformes: y v] by (y)\nnext costume\n\nwhen flag clicked\nwait until <[] = [5]>\nbroadcast (Costume v)\n\nwhen flag clicked\nhide\n\n@Thanks\n\nwhen I receive [thanks v]\nswitch costume to (costume2 v)\ngo to x: (-210) y: (50)\nshow\ngo to [front v] layer\nstart sound [pop v]\nrepeat (9)\n    change y by (-6)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-3)\nend\nwait (1) seconds\nrepeat (10)\n    change y by (6)\nend\nhide\n\nwhen I start as a clone\ngo to x: (0) y: (-50)\nshow\ngo to [front v] layer\nrepeat (12)\n    change y by (-9)\nend\nrepeat (5)\n    change y by (3)\nend\nrepeat (5)\n    change y by (-1)\nend\nforever\n    if <touching (mouse-pointer v)?> then\n        set [ghost v] effect to (50)\n        if <(costume [number v]) = [2]> then\n            if <mouse down?> then\n                set [costume v] to [2]\n                repeat (25)\n                    change y by (10)\n                end\n                hide\n                delete this clone\n            end\n        else\n            if <(costume [number v]) = [3]> then\n                if <mouse down?> then\n                    set [costume v] to [1]\n                    repeat (25)\n                        change y by (15)\n                    end\n                    hide\n                    delete this clone\n                end\n            end\n        end\n    else\n        set [ghost v] effect to (0)\n    end\n    if <(Costume) > [0.99]> then\n        repeat (25)\n            change y by (15)\n        end\n        hide\n        delete this clone\n    end\n    hide\n    delete this clone\nend\n\nwhen flag clicked\nhide\nset [costume v] to [0.9]\n\nwhen I receive [begin v]\nset [costume v] to [0.9]\nwait (0.1) seconds\nset [costume v] to [0.9]\nwait (0.2) seconds\nset [costume v] to [0.9]\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\nbroadcast (Thanks v)\n\ngo to x: (0) y: (0)\nshow\nreset timer\nswitch costume to (pick random (1) to (4))\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@Love fave\n\nwhen flag clicked\nset [costume v] to [0]\nhide\nforever\n    if <not <<(LOVED__) = [1]> and <(FAVED___) = [1]>>> then\n        wait (pick random (30) to (40)) seconds\n        switch costume to (costume1 v)\n        go to x: (0) y: (50)\n        show\n        go to [front v] layer\n        start sound [pop v]\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\n    end\n    if <(Costume) > [0]> then\n        hide\n        stop [this script v]\n    end\nend\n\n