Emojure Platformer(Mobile Friendly)

Instructions: Click The Green Flag and Then Tap To Play.\nUse The Arrow Keys Or WASD Keys To Move The Player.\nDon't Touch any Thing That Looks Nasty.

@Stage\n\nwhen flag clicked\nforever\n    play sound [Kevin Macleod - Electrodoodle v] until done\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nforever\n    play sound [Intro Sound v] until done\nend\n\n@Avatar\n\nwhen I receive [start v]\nset size to (45) %\nshow\n\nwhen I receive [start v]\nset [skips v] to [0]\nhide variable [show level v]\nforever\n    if <key (x v) pressed?> then\n        broadcast (Transition v)\n        Game On\n        wait (0.05) seconds\n        change [level v] by (1)\n        change [skips v] by (1)\n        wait until <not <key (x v) pressed?>>\n    end\nend\n\ndefine Game On\nset [sx v] to [0]\nset [x v] to [-222]\nset [y v] to [-125]\nset [sy v] to [0]\nset [in air v] to [0]\nset [finish v] to []\nshow\n\ndefine Movement\nif <<<key (a v) pressed?> or <key (left arrow v) pressed?>> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [sx v] by (-2)\nend\nif <<<key (d v) pressed?> or <key (right arrow v) pressed?>> or <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [sx v] by (2)\nend\nset [sx v] to ((sx) * (0.8))\nif <([abs v] of (sx) ) > [0.9]> then\n    Change Player x by (round (sx))\nend\nif <<<key (w v) pressed?> or <key (up arrow v) pressed?>> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(in air) < [4]> then\n        set [sy v] to [16]\n    end\nend\nif <(sy) > [-20]> then\n    change [sy v] by (-2)\nend\nChange Player y by (sy)\nDie\nPosition\nif <(y) < [-180]> then\n    set [finish v] to [No]\nend\nif <<(x position) > [240]> and <not <(Level) = [26]>>> then\n    broadcast (Show v)\n    set [finish v] to [Yes]\nend\n\nwhen I receive [start v]\nhide\ngo to [front v] layer\n\nwhen I receive [start v]\nset [level v] to [1]\nforever\n    Game On\n    repeat until <(Finish) > []>\n        Movement\n    end\n    if <(Finish) = [Yes]> then\n        Game Con\n    else\n        Game End\n    end\nend\n\ndefine Change Player y by (sy)\nchange [y v] by (sy)\nchange [in air v] by (1)\nPosition\nrepeat until <not <touching (platform v)?>>\n    if <(sy) > [0]> then\n        change [y v] by (-1)\n    else\n        change [y v] by (1)\n        set [in air v] to [0]\n    end\n    Position\n    set [sy v] to [0]\nend\n\ndefine Position\ngo to x: (x) y: (y)\n\ndefine Change Player x by (sx)\nchange [x v] by (sx)\nPosition\nif <touching (platform v)?> then\n    repeat (12)\n        change [y v] by (1)\n        Position\n        if <not <touching (platform v)?>> then\n            stop [this script v]\n        end\n    end\n    change [y v] by (-12)\n    if <<key (w v) pressed?> or <key (up arrow v) pressed?>> then\n        if <(sx) > [0]> then\n            set [sx v] to [-15]\n        else\n            set [sx v] to [15]\n        end\n        set [in air v] to [0]\n    else\n        set [sx v] to [0]\n    end\n    repeat until <not <touching (platform v)?>>\n        if <(sx) > [0]> then\n            change [x v] by (-1)\n        else\n            change [x v] by (1)\n        end\n        Position\n    end\nend\n\ndefine Game End\nset [finish v] to []\nrepeat (2)\n    hide\n    wait (0.05) seconds\n    show\n    wait (0.05) seconds\nend\nhide\nbroadcast (Transition v)\nwait (0.5) seconds\n\ndefine Die\nif <<touching (danger v)?> or <<touching (enemy v)?> or <touching (laser v)?>>> then\n    set [finish v] to [No]\nend\n\ndefine Game Con\nhide\nbroadcast (Transition v)\nchange [level v] by (1)\nwait (0.2) seconds\n\nwhen I receive [start v]\nforever\n    switch costume to (Avatar)\nend\n\nwhen flag clicked\nhide\n\n@Enemy\n\ndefine clone at x: (x) y: (y) speed: (speed) size: (size) costume: (costume)\nset size to (size) %\nswitch costume to (costume)\ngo to x: (x) y: (y)\nset [x v] to (speed)\ncreate clone of (_myself_ v)\n\nwhen I start as a clone\nshow\nforever\n    Physics\nend\n\ndefine Physics\nchange x by (x)\nchange [y v] by (-1)\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (1)\nend\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (1)\nend\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (1)\nend\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (1)\nend\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (1)\nend\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (1)\nend\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    change y by (-6)\n    repeat until <not <<touching (platform v)?> or <touching (_edge_ v)?>>>\n        change x by ((([abs v] of (x) ) / (x)) * (-1))\n    end\n    set [x v] to ((0) - (x))\nend\nchange y by (y)\nif <<touching (platform v)?> or <touching (_edge_ v)?>> then\n    repeat until <not <<touching (platform v)?> or <touching (_edge_ v)?>>>\n        change y by ((([abs v] of (y) ) / (y)) * (-1))\n    end\n    set [y v] to [0]\nend\n\nwhen I receive [create clone v]\nif <(Level) = [16]> then\n    clone at x: [8] y: [-126] speed: [2] size: [45] costume: [1]\nend\nif <(Level) = [17]> then\n    clone at x: [39] y: [-125] speed: [2] size: [45] costume: [1]\n    clone at x: [228] y: [-125] speed: [2] size: [45] costume: [1]\nend\nif <(Level) = [18]> then\n    clone at x: [44] y: [-35] speed: [2] size: [45] costume: [1]\n    clone at x: [5] y: [-9] speed: [2] size: [45] costume: [1]\nend\nif <(Level) = [19]> then\n    clone at x: [197] y: [-125] speed: [3] size: [45] costume: [2]\n    clone at x: [-7] y: [106] speed: [3] size: [45] costume: [2]\n    clone at x: [-227] y: [-15] speed: [3] size: [45] costume: [2]\nend\nif <(Level) = [20]> then\n    clone at x: [-15] y: [-127] speed: [2] size: [45] costume: [1]\n    clone at x: [102] y: [-127] speed: [3] size: [45] costume: [2]\n    clone at x: [-75] y: [-122] speed: [2] size: [45] costume: [1]\nend\nif <(Level) = [21]> then\n    clone at x: [-89] y: [-127] speed: [3] size: [45] costume: [2]\n    clone at x: [56] y: [-127] speed: [3] size: [45] costume: [2]\nend\nif <(Level) = [22]> then\n    clone at x: [-88] y: [-127] speed: [2] size: [45] costume: [1]\n    clone at x: [-76] y: [7] speed: [3] size: [45] costume: [2]\n    clone at x: [162] y: [-120] speed: [2] size: [45] costume: [1]\nend\nif <(Level) = [25]> then\n    clone at x: [167] y: [-115] speed: [2.5] size: [110] costume: [1]\n    clone at x: [30] y: [60] speed: [2] size: [45] costume: [1]\n    clone at x: [203] y: [65] speed: [3] size: [45] costume: [2]\n    clone at x: [17] y: [-22] speed: [3] size: [45] costume: [2]\n    clone at x: [-228] y: [140] speed: [2] size: [45] costume: [1]\n    clone at x: [140] y: [140] speed: [3] size: [45] costume: [2]\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [transition v]\ndelete this clone\n\nwhen I receive [transition v]\nwait (0.2) seconds\nbroadcast (Create Clone v)\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Level) = [26]> then\n        hide\n        stop [other scripts in sprite v]\n        delete this clone\n    end\nend\n\n@Danger\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Level) = [26]> then\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\n@Platform\n\nwhen I receive [start v]\nshow\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen flag clicked\nhide\n\n@Transition\n\nwhen I receive [transition v]\ngo to [front v] layer\nswitch costume to (transition v)\ngo to x: (0) y: (0)\nglide (0.2) secs to x: (0) y: (0)\nglide (1) secs to x: (490) y: (0)\nhide\n\nwhen I receive [transition v]\nshow\nforever\n    go to [front v] layer\nend\n\nwhen I receive [menu v]\nhide\n\nwhen I receive [start v]\nhide\n\nwhen flag clicked\nhide\n\n@Costume\n\nwhen I receive [menu v]\nshow\nforever\n    switch costume to (Avatar)\nend\n\nwhen I receive [start v]\nhide\n\nwhen I receive [instruction v]\nhide\n\nwhen flag clicked\nset [avatar v] to [1]\nhide\n\n@Laser\n\nwhen I receive [start v]\nforever\n    go to x: (0) y: (0)\n    switch costume to (Level)\nend\n\nwhen I receive [start v]\nforever\n    go to [back v] layer\n    show\n    wait (pick random (1) to (2)) seconds\n    hide\n    wait (pick random (1) to (2)) seconds\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nforever\n    if <(Level) = [26]> then\n        hide\n        stop [other scripts in sprite v]\n        stop [this script v]\n    end\nend\n\n@Splash\n\nwhen I receive [start v]\nhide\n\nwhen flag clicked\nswitch costume to (splash v)\ngo to [back v] layer\nshow\nforever\n    go to x: (0) y: (0)\n    if <mouse down?> then\n        broadcast (Menu v)\n        wait until <not <mouse down?>>\n        stop [this script v]\n    end\nend\n\nwhen I receive [instruction v]\nswitch costume to (instuction v)\nshow\n\nwhen I receive [menu v]\nswitch costume to (menu v)\nshow\n\n@Arrows\n\nwhen I receive [menu v]\nstop [other scripts in sprite v]\ncreate clone of (_myself_ v)\nswitch costume to (right v)\nshow\nforever\n    go to x: (0) y: (0)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            start sound [Finger Snap v]\n            change [avatar v] by (1)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nshow\nswitch costume to (left v)\nforever\n    go to x: (0) y: (0)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            start sound [Finger Snap v]\n            change [avatar v] by (-1)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\nhide\ndelete this clone\n\nwhen I receive [instruction v]\ndelete this clone\n\nwhen I receive [instruction v]\nstop [other scripts in sprite v]\nshow\nswitch costume to (close button v)\nforever\n    go to x: (0) y: (0)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            start sound [Finger Snap v]\n            broadcast (Menu v)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen flag clicked\nhide\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nforever\n    go to x: (0) y: (0)\n    switch costume to (notice v)\n    if <(Level) = [26]> then\n        show\n    else\n        hide\n    end\nend\n\n@Buttons\n\nwhen I receive [menu v]\ncreate clone of (_myself_ v)\nswitch costume to (costume1 v)\nshow\nforever\n    go to x: (0) y: (0)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            start sound [Finger Snap v]\n            wait (0.1) seconds\n            broadcast (Start v)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I start as a clone\nswitch costume to (costume2 v)\nshow\nforever\n    go to x: (0) y: (0)\n    if <touching (mouse-pointer v)?> then\n        set [brightness v] effect to (10)\n        if <mouse down?> then\n            start sound [Finger Snap v]\n            broadcast (Instruction v)\n            wait until <not <mouse down?>>\n        end\n    else\n        set [brightness v] effect to (0)\n    end\nend\n\nwhen I receive [start v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen I receive [instruction v]\nstop [other scripts in sprite v]\nhide\ndelete this clone\n\nwhen flag clicked\nhide\n\n