Clouds☁️ || A Platformer Game

Instructions: Instructions\n-Arrow keys to move Or Drag\n-Don't touch spikes,Mobs or Axes\n-Get to portals to get to the next level\n\nStory\nThere was once a blue cube that wanted to know what is up in the sky...but this blue cube is very smart and determined so he wanted to make a plane able to fly high  (there is no planes in this world of cubes) so he spent countless hours trying to make one and he failed miserably. But it doesn't mean he gives up so he tried and tried and tried then he succeeded so he went and fly.Fly to the clouds! but then... He saw a castle, he wanted to get there but then.... He fell down got lost in the castle, and that part of the castle was very dangerous,  there were spikes, swinging axes and Dangerous critters so...The adventure begins!\n\nCredits\nMusic: Castle in the Sky - LaputaFlute Cover\nCharacter art: @HenryWolfe\nPlatform art: me\nCode: @xaumil2 tutorial

@Stage\n\nwhen flag clicked\nset volume to (200) %\nforever\n    play sound [Castle in the Sky - LaputaFlute Cover v] until done\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 <<mouse down?> and <(x position) < (mouse x)>>> then\n    change [x vel. v] by (speed)\nend\nif <<key (left arrow v) pressed?> or <<mouse down?> and <(mouse x) < (x position)>>> then\n    change [x vel. v] by ((speed) * (-1))\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 <<mouse down?> and <(mouse y) > (y position)>>> then\n        set [y vel. v] to ((jump height) + (3))\n        if <(x vel.) > [0]> then\n            set [x vel. v] to [-10]\n        else\n            set [x vel. v] to [10]\n        end\n    else\n        set [x vel. v] to [0]\n    end\nend\nchange y by (y vel.)\nchange [in air v] by (1)\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    if <(([abs v] of (y vel.) ) / (y vel.)) = [-1]> then\n        set [in air v] to [0]\n    end\n    set [y vel. v] to [0]\nend\nif <<key (up arrow v) pressed?> or <<mouse down?> and <(mouse y) > (y position)>>> then\n    if <(In Air) < [4]> then\n        set [y vel. v] to (jump height)\n    end\nend\ncreate clone of (_myself_ v)\nif <touching (portal v)?> then\n    broadcast (New Level v)\n    Reset\n    start sound [Magic Spell v]\nend\nif <<touching (danger v)?> or <<<touching color (#ff0000)?> or <touching color (#ff8c8c)?>> or <touching (mob ai v)?>>> then\n    start sound [Crunch v]\n    Reset\nend\n\nwhen flag clicked\nReset\nforever\n    Platformer physics [1.2] [0.9] [12]\nend\n\ndefine Reset\nset [x vel. v] to [0]\nset [y vel. v] to [0]\ngo to x: (-202) y: (-130)\npoint in direction (90)\nshow\nswitch costume to (idle v)\nset size to (100) %\ngo to [front v] layer\nclear graphic effects\n\nwhen I start as a clone\nswitch costume to (idle - trail v)\nclear graphic effects\nrepeat (10)\n    change [ghost v] effect by (10)\nend\ndelete this clone\n\n@Level\n\nwhen flag clicked\nswitch costume to (level1 v)\ngo to x: (39) y: (37)\n\nwhen I receive [new level v]\nnext costume\n\n@Particles\n\nwhen flag clicked\nforever\n    repeat (10000000000)\n        create clone of (_myself_ v)\n        wait (0.5) seconds\n    end\n    hide\nend\n\nwhen I start as a clone\nset [ghost v] effect to (pick random (40) to (90))\nshow\ngo to [back v] layer\ngo to x: (-219) y: (pick random (-156) to (156))\nset size to (pick random (50) to (100)) %\nrepeat until <(x position) > [240]>\n    change x by (5)\nend\nrepeat until <not <touching (_edge_ v)?>>\n    change x by (5)\nend\n\nwhen I start as a clone\nforever\n    if <(x position) > [239]> then\n        delete this clone\n    end\nend\n\n@Portal\n\nwhen flag clicked\nswitch costume to (level1 v)\n\nwhen I receive [new level v]\nnext costume\n\n@DANGER\n\nwhen I receive [new level v]\nnext costume\n\nwhen flag clicked\ngo to [back v] layer\nswitch costume to (1 v)\n\n@axe\n\nwhen flag clicked\ngo to [front v] layer\nswitch costume to (1 v)\nforever\n    turn left (5.2) degrees\nend\n\nwhen I receive [new level v]\nnext costume\n\n@Mob AI\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [front v] layer\nforever\n    change [color v] effect by (25)\nend\n\nwhen I receive [new level v]\nnext costume\nforever\n    Ai\nend\n\ndefine Ai\nglide (5) secs to x: (240) y: (-105)\nglide (5) secs to x: (-240) y: (-105)\n\nwhen I receive [new level v]\ngo to x: (240) y: (-105)\n\n@Commentary\n\nwhen flag clicked\nswitch costume to (1 v)\ngo to [front v] layer\n\nwhen I receive [new level v]\nnext costume\n\n@TN\n\nwhen flag clicked\nhide\n\nshow\ngo to [front v] layer\n\n